Arduino stepper motor Bluetooth control project – Working principle
Arduino stepper motor control circuit
Stepper coils are controlled through arduino digital pins 2,3,4 and 5. The pins are directly connected to inputs of uln2003. The corresponding outputs of the uln2003 is supplying power to motor coils. Arduino is powered through external 12v adopter and uln2003 is powered through the same adopter. Hc06 is powered through the 3.3v supply output of arduino.
Note: The ground of the arduino must be grounded with ULN2003 ground. Both the ic’s must be at same potential to become functional. If not grounded properly the circuit floats and the output is unpredictable.
Level shifters requirement
Commands to run and control stepper motor from Bluetooth
Sending following commands from android app after it is paired with the hc06 Bluetooth module will make arduino to perform functions on stepper motor.
s or S = Starts and stops the stepper motor. First s starts motor and the coming next stops it.
f or F = Rotates stepper motor in clockwise direction.
b or B = Rotates stepper motor in anticlockwise direction.
Speed rotation for stepper motor embedded in the code
1 = —————————————————– Rotation Speed=900;
2 = —————————————————– Rotation Speed=800;
3 = —————————————————– Rotation Speed=700;
4 = —————————————————– Rotation Speed=500;
5 = —————————————————– Rotation Speed=400;
6 = —————————————————– Rotation Speed=300;
7 = —————————————————– Rotation Speed=200;
8 = —————————————————– Rotation Speed=100;
9 = —————————————————– Rotation Speed=50;
The function Move_Backward() rotates the motor in anticlockwise direction. The function StartMotor() rotates the motor in clockwise direction. User can change the commands according to his need. User can also insert the new rotation speeds.