Editing Stepper Motor and ULN2003

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
= IMPORTANT =
+
see https://github.com/zhcong/ULN2003-for-ESP32
'''In many computers the current is not enough to drive the servo!!!'''
 
  
'''If it does not work, keeps disconnecting, or rebooting the ESP the power is not sufficent and you need an extra power supply.'''
 
 
See [[SG90 Servo#Power Issues]] and the video on the [[SG90 Servo]] page for details how to do this.
 
  
 
= Description =
 
= Description =
Line 11: Line 7:
 
Our motor has about 508 steps for 360° (the motor itself has 64 steps but there is a gear train on top)
 
Our motor has about 508 steps for 360° (the motor itself has 64 steps but there is a gear train on top)
  
more details:
+
[[File:Stepper03.JPG|300px]]
* http://www.jangeox.be/2013/10/stepper-motor-28byj-48_25.html
 
* https://cookierobotics.com/042/
 
* see https://github.com/zhcong/ULN2003-for-ESP32
 
 
 
[[File:Stepper.JPG|x300px]]
 
[[File:Stepper03.JPG|x300px]]
 
  
 
ULN2003 driver module.
 
ULN2003 driver module.
 
 
[[File:Stepper02.JPG|300px]]
 
[[File:Stepper02.JPG|300px]]
  
 
= How to connect it electrically =
 
= How to connect it electrically =
  
[[File:Stepper-c.JPG|x250px]]
+
[[File:Stepper-cables01.JPG|x200px]]
[[File:Elko-stepper.JPG|x250px]]
 
  
We recommend to add the capacitor to keep the power supply more stable. This issue is similar to the power issue with the servo [[SG90 Servo]].
 
 
[[File:Stepper-cables01.JPG|x200px]]
 
 
[[File:Stepper-cable02.JPG|x200px]]
 
[[File:Stepper-cable02.JPG|x200px]]
  
= Required Module and Files =
+
== Required Module and Files ==
 
* We use '''[https://www.sketching-with-hardware.org/files/Stepper.py Stepper.py]'''
 
* We use '''[https://www.sketching-with-hardware.org/files/Stepper.py Stepper.py]'''
 
* this is downloaded from https://github.com/zhcong/ULN2003-for-ESP32
 
* this is downloaded from https://github.com/zhcong/ULN2003-for-ESP32
 
* the original file is at https://github.com/zhcong/ULN2003-for-ESP32/blob/master/Stepper.py
 
* the original file is at https://github.com/zhcong/ULN2003-for-ESP32/blob/master/Stepper.py
 
* this is based on: https://github.com/IDWizard/uln2003 by (c) IDWizard 2017,MIT License.
 
* this is based on: https://github.com/IDWizard/uln2003 by (c) IDWizard 2017,MIT License.
 +
 +
  
 
= How to control it in MicroPython =
 
= How to control it in MicroPython =
Line 45: Line 32:
 
from machine import Pin
 
from machine import Pin
  
# for the ESP8266
 
# In1 = Pin(2,Pin.OUT) # IN1-> GPIO2
 
# In2 = Pin(0,Pin.OUT) # IN1-> GPIO0
 
# In3 = Pin(4,Pin.OUT) # IN1-> GPIO4
 
# In4 = Pin(5,Pin.OUT) # IN1-> GPIO5
 
 
# for ESP32
 
 
In1 = Pin(32,Pin.OUT)
 
In1 = Pin(32,Pin.OUT)
 
In2 = Pin(33,Pin.OUT)
 
In2 = Pin(33,Pin.OUT)
Line 65: Line 45:
 
s1.step(509)
 
s1.step(509)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
  
 
= Related Tutorial Videos =
 
= Related Tutorial Videos =
<youtube>EIwjeek5hnM</youtube>
+
<youtube>PEKjvD1uQe4</youtube>
<!-- <youtube>PEKjvD1uQe4</youtube> -->
 

Please note that all contributions to Sketching with Hardware at LMU Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see My wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)