L293 Based DC Driver Circuit
In order to drive our DC motors, we used a breakout board featuring the L293. Using two separate PWM pins on the Arduino, we were able to control the motor speeds independently. This turned out to be crucial for allowing the robot to move relatively straight and turn in a reliable manner as we had to run each motor at a different PWM cycle. We found that our motors were fairly well matched at full speed, but at almost any other speed they responded differently, and that our bot almost never turned exactly how we wanted it to.
The Arduino code below should allow you to easily test out your DC motor configuration. Adjust the values manually between -255 and +255 to vary speed on each motor. Once you're ready to integrate the DC motor code into your larger integrated system sketch, copy the motor() function to the new file. You should be able to control your bot's motion with one quick line of code! Use motor(0,0) to stop the motors.
The Arduino code below should allow you to easily test out your DC motor configuration. Adjust the values manually between -255 and +255 to vary speed on each motor. Once you're ready to integrate the DC motor code into your larger integrated system sketch, copy the motor() function to the new file. You should be able to control your bot's motion with one quick line of code! Use motor(0,0) to stop the motors.
dc.ino | |
File Size: | 0 kb |
File Type: | ino |
Stepper Motor Driver Circuit
To drive the stepper motor for the token delivery system, we used the Pololu DRV8825 driver circuit. The driver allowed us to easily control the angle of the chip holding disk as well as the speed at which it turned. Our stepper motor turned in 1.8º increments, so 17 steps would turn the device 30.6º, or alternatively allow us to deposit one of our 12 chips. The extra 0.6º is a small error and does not require any corrections.
The Arduino sketch below allows you to verify your circuit via the Arduino serial monitor. Simply type the number of chips, n, you would like the apparatus to drop. If the wiring is good, then the disk should rotate by n*30º. A good test of your overall system is to rotate by 360º
The Arduino sketch below allows you to verify your circuit via the Arduino serial monitor. Simply type the number of chips, n, you would like the apparatus to drop. If the wiring is good, then the disk should rotate by n*30º. A good test of your overall system is to rotate by 360º
stepper.ino | |
File Size: | 0 kb |
File Type: | ino |
We used the following circuit layout. The 5V Arduino pin must be connected to the RESET and SLEEP pins on the driver. We used 12V for the motor power supply. Be sure to connect the Arduino GND, DRV8825 GND, and power supply GND together. Also note that images of our physical stepper motor driver circuit can be seen below.