{"id":1690,"date":"2018-07-14T13:04:05","date_gmt":"2018-07-14T20:04:05","guid":{"rendered":"http:\/\/www.donluc.com\/?p=1690"},"modified":"2018-07-14T13:04:05","modified_gmt":"2018-07-14T20:04:05","slug":"project-9-stepper-easydriver-mk04","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=1690","title":{"rendered":"Project #9: Stepper &#8211; EasyDriver &#8211; Mk04"},"content":{"rendered":"<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07a.png\" alt=\"\" width=\"720\" height=\"500\" class=\"alignnone size-full wp-image-1691\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07a-300x208.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07b.png\" alt=\"\" width=\"720\" height=\"499\" class=\"alignnone size-full wp-image-1692\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07b-300x208.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07c.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1693\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07c-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07d.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1694\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07d-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1690-1\" width=\"720\" height=\"406\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk07.mp4<\/a><\/video><\/div>\n<p><strong>EasyDriver &#8211; Hook-Up<\/strong><\/p>\n<p>Once you have all the headers soldered on, it\u2019s time to hook up the EasyDriver to your Arduino. Using the picture below, make all the necessary connections.<\/p>\n<p><strong>Note:<\/strong> The small stepper motor looks different than the one pictured. It should have a 4-pin connector on the end. This will be attached to the 4-pin male header facing upward. Because of the nature of this particular stepper, you can hook up the connector in either orientation, i.e. either the black wire on the left or the yellow wire on the left. It will work either way. If you are using a different motor, consult its documentation to find out which wires should go where.<\/p>\n<p><strong>IMPORTANT:<\/strong> Stepper motors require more power than can be supplied by the Arduino. In this example we will be powering the Uno with a 12V external supply. Notice that the power input (M+) on the EasyDriver is attached to the Vin pin on the Arduino. This will allow you to power both the Arduino and the motor with the same power supply.<\/p>\n<p><strong>DonLuc1807Mk07<\/strong><\/p>\n<p>1 x RGB LCD Shield 16\u00d72 Character Display<br \/>\n1 x Arduino UNO &#8211; R3<br \/>\n1 x ProtoScrewShield<br \/>\n1 x EasyDriver<br \/>\n1 x Small Stepper Motor<br \/>\n1 x Pololu Mounting<br \/>\n3 x Jumper Wires 3&#8243; M\/M<br \/>\n4 x Jumper Wires 6&#8243; M\/M<br \/>\n1 x Half-Size Breadboard<\/p>\n<p><strong>Arduino UNO<\/strong><\/p>\n<p>Spe &#8211; Digital 3<br \/>\nDir &#8211; Digital 2<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DonLuc1807Mk07p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"DonLuc1807Mk07p.ino\">\r\n\/\/ ***** Don Luc *****\r\n\/\/ Software Version Information\r\n\/\/ Project #9: Stepper - EasyDriver - Mk04\r\n\/\/ 7-7\r\n\/\/ DonLuc1807Mk07p 7-7\r\n\/\/ Stepper\r\n\/\/ EasyDriver\r\n\r\n\/\/ include the library code:\r\n#include &lt;Adafruit_MCP23017.h&gt;\r\n#include &lt;Adafruit_RGBLCDShield.h&gt;\r\n\r\nAdafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield();\r\n#define GREEN 0x2\r\n\r\n\/\/ EasyDriver\r\nint dirPin = 2;                           \/\/ EasyDriver\r\nint stepPin = 3;                          \/\/ stepPin\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);\r\n  RGBLCDShield.print(&quot;EasyDriver&quot;);       \/\/ EasyDriver\r\n  \r\n  \/\/ EasyDriver\r\n  int i;\r\n\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  RGBLCDShield.print(&quot;Left&quot;);             \/\/ Left\r\n  \r\n  digitalWrite(dirPin, LOW);              \/\/ Set the direction.\r\n  delay(100);\r\n\r\n  for (i = 0; i&lt;4000; i++)                \/\/ Iterate for 4000 microsteps.\r\n  {\r\n    digitalWrite(stepPin, LOW);           \/\/ This LOW to HIGH change is what creates the\r\n    digitalWrite(stepPin, HIGH);          \/\/ &quot;Rising Edge&quot; so the easydriver knows to when to step.\r\n    delayMicroseconds(500);               \/\/ This delay time is close to top speed for this\r\n  }                                       \/\/ particular motor. Any faster the motor stalls.\r\n\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  RGBLCDShield.print(&quot;Right&quot;);            \/\/ Right\r\n  \r\n  digitalWrite(dirPin, HIGH);             \/\/ Change direction.\r\n  delay(2000);\r\n\r\n  for (i = 0; i&lt;4000; i++)                \/\/ Iterate for 4000 microsteps\r\n  {\r\n    digitalWrite(stepPin, LOW);           \/\/ This LOW to HIGH change is what creates the\r\n    digitalWrite(stepPin, HIGH);          \/\/ &quot;Rising Edge&quot; so the easydriver knows to when to step.\r\n    delayMicroseconds(500);               \/\/ This delay time is close to top speed for this\r\n  }                                       \/\/ particular motor. Any faster the motor stalls.\r\n\r\n  delay(2000);\r\n  \r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n  \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"setup.ino\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ set up the LCD&#039;s number of columns and rows: \r\n  RGBLCDShield.begin(16, 2);\r\n  RGBLCDShield.setBacklight(GREEN);\r\n  \r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);  \r\n  RGBLCDShield.print(&quot;Don Luc&quot;);         \/\/ Don luc\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  RGBLCDShield.print(&quot;EasyDriver&quot;);      \/\/ EasyDriver\r\n\r\n  delay(5000);\r\n\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n\r\n  \/\/ EasyDriver\r\n  pinMode(dirPin, OUTPUT);\r\n  pinMode(stepPin, OUTPUT);\r\n\r\n}\r\n<\/pre>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>EasyDriver &#8211; Hook-Up Once you have all the headers soldered on, it\u2019s time to hook up the EasyDriver to your Arduino. Using the picture below, make all the necessary connections. Note: The small stepper motor looks different than the one pictured. It should have a 4-pin connector on the end. This will be attached to &#8230; <a title=\"Project #9: Stepper &#8211; EasyDriver &#8211; Mk04\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=1690\" aria-label=\"Read more about Project #9: Stepper &#8211; EasyDriver &#8211; Mk04\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76,50,38,59,5,46,58,10,43],"tags":[],"class_list":["post-1690","post","type-post","status-publish","format-standard","hentry","category-stepper","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-arduino-programming","category-projects","category-sparkfun"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1690"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1690\/revisions"}],"predecessor-version":[{"id":4310,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1690\/revisions\/4310"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}