Introduction: Arduino Light Sensitive Stepper Motor

About: I like finding new uses for things, making things, and improving things. I'm a student who is currently looking for a better job, one where I can make an actual difference.

I've come up with a simple way to make a stepper motor move from one position to another based on the lighting in a room. Using a handful of basic components I had lying around, no need for fancy motor / stepper shields. This setup could be used to automate blinds, so they open and close based on ambient light. The code allows you to edit amount of steps in either direction and sensitivity to light. I've also wrote in code to turn off the stepper once it is done moving. The components required are : Arduino board with 4 digital outputs and 1 analog input, 4x general purpose npn transistors, 4x 1k resistors,10k resistor, light dependent resistor (LDR),12volt stepper motor,12 volt power supply, 5 volt power supply for the arduino, I used a 7805 5 volt regulator for this.

Step 1: Code

This code steps the motor 150 steps clockwise when it gets dark, then steps the motor counterclockwise 150 steps once it detects light again. The amount of steps, speed, and light sensitivity are all easily adjustable. Make sure to enter how many steps your motor has where it says define steps (mine had 48). Also I used a 5 wire 12v motor where one wire always received positive voltage, and the other four wires were grounded in sequence to turn the motor.