Interactive kinetic sculpture system using a Raspberry Pi 5, DRV8825 stepper motor driver, NEMA 17 stepper motor, and magnetic reed switch sensor. The installation activates motion when a door opens and runs for a programmable amount of time.
- Raspberry Pi 5
- MicroSD Card
- Raspberry Pi Power Supply
- NEMA 17 Stepper Motor (42-40)
- DRV8825 Stepper Motor Driver
- 12V 5A Power Supply
- Magnetic Reed Switch Sensor
- Breadboard
- Jumper Wires
- 22 AWG Wire
- Capacitor (100uF–470uF, 25V)
- Inline Fuse Holder
- 5A Slow-Blow Fuse
- DC Rocker Switch
- Screw Terminal Connectors
- Heat Shrink Tubing
- Zip Ties
- Adhesive Cable Clips
- Door opens
- Magnet separates from reed switch
- Raspberry Pi detects trigger
- DRV8825 receives STEP and DIR signals
- Stepper motor rotates sculpture
- System runs for programmed duration
- Cooldown timer prevents immediate retriggering
| Function | GPIO | Physical Pin |
|---|---|---|
| STEP | GPIO23 | Pin 16 |
| DIR | GPIO24 | Pin 18 |
| Sensor Input | GPIO17 | Pin 11 |
| Logic GND | GND | Pin 14 |
| Sensor GND | GND | Pin 6 |
| 3.3V | 3.3V | Pin 1 |
Raspberry Pi GPIO23 (Pin 16)
→ DRV8825 STEP
Raspberry Pi GPIO24 (Pin 18)
→ DRV8825 DIR
Raspberry Pi GND (Pin 14)
→ DRV8825 Logic GND
Connect RESET and SLEEP together.
Then connect:
→ Raspberry Pi Pin 1 (3.3V)
Connect ENABLE
→ Logic GND
12V Power Supply (+)
→ Inline Fuse Holder
→ Rocker Switch RED wire
→ Other RED wire from rocker switch
→ DRV8825 VMOT
12V Power Supply (-)
→ DRV8825 GND next to VMOT
The rocker switch has:
- 2 red wires
- 2 black wires
Use ONLY the red wires.
The black wires are typically for the internal LED and are not required.
Install capacitor across:
VMOT ↔ GND
on the DRV8825 motor power side.
| DRV8825 Pin | Motor Wire |
|---|---|
| A1 | Black |
| A2 | Green |
| B1 | Red |
| B2 | Blue |
If the motor locks but does not rotate:
- swap coil pairs
- verify motor wiring with multimeter continuity mode
| Reed Switch Terminal | Connection |
|---|---|
| NO | Raspberry Pi GPIO17 (Pin 11) |
| COM | Raspberry Pi GND (Pin 6) |
The reed switch has:
- Sensor body
- Magnet piece
Mount:
- sensor body on door frame
- magnet on moving door
When the door opens, the magnet separates from the sensor and triggers the system.
Use Raspberry Pi Imager to install:
- Raspberry Pi OS (64-bit)
onto the MicroSD card.
Insert SD card into Raspberry Pi.
Connect:
- monitor using Micro HDMI
- USB keyboard
- USB mouse
- Raspberry Pi USB-C power supply
Power on Raspberry Pi.
sudo apt update
sudo apt install code -yInstall GPIO library:
pip install RPi.GPIOSave Python file as:
main.pyRun:
python3 main.pyInstall heatsink directly on DRV8825 chip.
Recommended for long runtime operation.