Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 1.53 KB

README.md

File metadata and controls

18 lines (14 loc) · 1.53 KB

robocurtain

Source code for an arduino-controlled circuit that opens or closes my curtain depending on an opened / closed switch on my desk.

parts

  • Adafruit Metro Mini (or other Arduino-type controller)
  • A4988 or other Arduino-compatible stepper motor driver
  • A stepper motor that can be driven by the driver. I used a NEMA-17 motor like this one
  • SPST switch
  • Compatible timing belt, cogs, and ball bearings.
  • 12V power supply with enough amps to drive the motor and processor at the same time.
  • Miscellaneous resistors, capacitors, wires.

circuit

circuit

The switch provides an open (0V) or closed (5V) signal to the arduino. When the arduino registers a change in the switch's state, it tells the stepper motor driver to run the motor in order to open or close the curtain.

The 12V supply powers both the motor (through the stepper motor driver) and the arduino (via the Vin pin). In order to prevent the motor's high inductance from messing with the arduino supply, put two electrolytic capacitors (one larger, one smaller) between the Vin and Gnd pins of the arduino. Use a pull-up resistor to make sure that the switch cycles the input between 0V and 5V.