{"id":929,"date":"2012-05-17T06:33:48","date_gmt":"2012-05-17T06:33:48","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=929"},"modified":"2012-05-21T03:57:49","modified_gmt":"2012-05-21T03:57:49","slug":"dvd-drive-stepper-motor-unl2003-driver-and-arduino","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2012\/05\/dvd-drive-stepper-motor-unl2003-driver-and-arduino\/","title":{"rendered":"DVD drive stepper motor, ULN2003 driver and Arduino"},"content":{"rendered":"<p>Playing with a DVD drive stepper and an Arduino today. I mostly used the information from <a href=\"http:\/\/elabz.com\/driving-a-bipolar-stepper-motor-with-arduino-and-uln2803ag\/\">here<\/a><\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/arduinostepper.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/arduinostepper-1024x764.jpg\" alt=\"\" title=\"arduinostepper\" width=\"630\" height=\"470\" class=\"aligncenter size-large wp-image-930\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/arduinostepper-1024x764.jpg 1024w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/arduinostepper-300x224.jpg 300w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/arduinostepper.jpg 1296w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<p>I omitted the Zener, from the circuit shown. And I&#8217;m driving stepper with a cut down version of his code:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\nconst int motorPin1 =8;\r\nconst int motorPin2 =9;\r\nconst int motorPin3 =10;\r\nconst int motorPin4 =11;\r\n\r\n\r\nvoid setup() {                \r\n  \/\/ initialize the digital pin as an output.\r\n  \/\/ Pin 13 has an LED connected on most Arduino boards:\r\n  pinMode(motorPin1, OUTPUT);    \r\n  pinMode(motorPin2, OUTPUT);    \r\n  pinMode(motorPin3, OUTPUT);    \r\n  pinMode(motorPin4, OUTPUT);     \r\n}\r\n\r\nvoid loop() {\r\n \/\/ HALF STEP  \r\n int motorDelay=10;\r\n  digitalWrite(motorPin1, HIGH);\r\n  digitalWrite(motorPin2, LOW);\r\n  digitalWrite(motorPin3, HIGH);\r\n  digitalWrite(motorPin4, LOW);\r\n  delay(motorDelay);\r\n \r\n  digitalWrite(motorPin1, HIGH);\r\n  digitalWrite(motorPin2, LOW);\r\n  digitalWrite(motorPin3, HIGH);\r\n  digitalWrite(motorPin4, HIGH);\r\n  delay(motorDelay);  \r\n \r\n  digitalWrite(motorPin1, HIGH);\r\n  digitalWrite(motorPin2, LOW);\r\n  digitalWrite(motorPin3, LOW);\r\n  digitalWrite(motorPin4, HIGH);\r\n  delay(motorDelay);  \r\n \r\n  digitalWrite(motorPin1, HIGH);\r\n  digitalWrite(motorPin2, HIGH);\r\n  digitalWrite(motorPin3, LOW);\r\n  digitalWrite(motorPin4, HIGH);\r\n  delay(motorDelay); \r\n \r\n  digitalWrite(motorPin1, LOW);\r\n  digitalWrite(motorPin2, HIGH);\r\n  digitalWrite(motorPin3, LOW);\r\n  digitalWrite(motorPin4, HIGH);\r\n  delay(motorDelay); \r\n \r\n  digitalWrite(motorPin1, LOW);\r\n  digitalWrite(motorPin2, HIGH);\r\n  digitalWrite(motorPin3, HIGH);\r\n  digitalWrite(motorPin4, HIGH);\r\n  delay(motorDelay); \r\n \r\n  digitalWrite(motorPin1, LOW);\r\n  digitalWrite(motorPin2, HIGH);\r\n  digitalWrite(motorPin3, HIGH);\r\n  digitalWrite(motorPin4, LOW);\r\n  delay(motorDelay); \r\n \r\n  digitalWrite(motorPin1, HIGH);\r\n  digitalWrite(motorPin2, HIGH);\r\n  digitalWrite(motorPin3, HIGH);\r\n  digitalWrite(motorPin4, LOW);\r\n  delay(motorDelay); \r\n}\r\n<\/pre>\n<p>Video:<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/zErDwRtqd4Y\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>Circuit diagram from link for reference:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/bipolar_stepper_with_ULN2803.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/bipolar_stepper_with_ULN2803-300x167.png\" alt=\"\" title=\"bipolar_stepper_with_ULN2803\" width=\"300\" height=\"167\" class=\"aligncenter size-medium wp-image-931\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/bipolar_stepper_with_ULN2803-300x167.png 300w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2012\/05\/bipolar_stepper_with_ULN2803.png 644w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Playing with a DVD drive stepper and an Arduino today. I mostly used the information from here I omitted the Zener, from the circuit shown. And I&#8217;m driving stepper with a cut down version of his code: const int motorPin1 =8; const int motorPin2 =9; const int motorPin3 =10; const int motorPin4 =11; void setup() [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-929","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-eZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=929"}],"version-history":[{"count":4,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/929\/revisions"}],"predecessor-version":[{"id":952,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/929\/revisions\/952"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}