This small project sets your miniature christmas tree (or something else) spinning!
The project uses the following components:
- ESP32 dev board
- Step motor (https://www.sparkfun.com/products/9238)
- EasyDriver - Stepper Motor Driver (https://www.sparkfun.com/products/12779)
- Battery power supply (at least 7V).
- Something to connect everything. I used
- A breadboard
- M/M jumper cables
- Something to spin
Put everything together as shown in the image. The ESP32 pin connection to the EasyDriver are as follows:
- GPIO15 > STEP
- GPIO16 > DIR
- GPIO17 > MS1
- GPIO18 > MS2
- GPIO19 > ENABLE
Prepare the open source Toit language by following the steps here.
Compile an ESP32 image from the program:
cd <path-to-toit-lang>
make esp32 ESP32_ENTRY=<path-to-spin-tree>/spin-tree/src/main.toit
Connect the ESP32 to your computer and flash the program by pasting the output from make esp32
into the terminal.
Once the program has been flashed, it will start running every time the ESP32 is powered on.
- The stepper motor driver has been compiled into a Toit package: https://github.com/toitware/toit-A3967
- I used this guide to figure out how to wire up the stepper motor with the driver: https://learn.sparkfun.com/tutorials/easy-driver-hook-up-guide
- The EasyDriver webpage provided the step resolution values: http://www.schmalzhaus.com/EasyDriver/