In many of the applications it is required to alter the direction of DC motor instantly. Like in washing machine, mixer, drilling machine winding – rewinding machine etc. Changing the direction of DC motor using joystick is most suitable and handy method.
Joystick Control for DC motor is mostly used in different Robotic applications like
· Moving robotic hand up and down
· Rotating robotic arm clockwise or anticlockwise
· Moving robotic vehicle forward or reverse
· Rotating robotic eye (camera) complete 360o
Also in industries the joystick control is most preferable way to control machinery that is operated with DC motor. The best example is 3 axis or 2 axis DC motor operated crane. In this, 3 (or 2) DC motors moves crane up or down, rotate it left or right using 3 (or 2) joysticks.
And the biggest application of joystick control for DC motor is in RC (remote control) toys. RC cars, RC helicopters, RC motor boats, RC planes etc all uses wireless joystick control to control DC motor and to rotate it forward and reverse.
So this project illustrates how to change direction of DC motor using simple potentiometer as joystick. Here i have used potentiometer in place of joystick but any standard resistive joystick can be used. It is readily available in market. This is just a demonstration but one can also make real time industrial application with few modifications. Some of the ideas for advancements are discussed at the end of this project. It is assumed that the reader has gone through the project How to get started with AVR and done all the things discussed in it.
Fig. 1: Image of AVR ATega32 based Joystick operated DC Motor Controller
Schematic diagram: –
As shown in circuit diagram tab, the application is made using only two ICs, potentiometer and LEDs. AVR microcontroller ATMega32 used as motor controller and H-bridge driver L293D is used as motor driver chip. Potentiometer is used as joystick. It can be replaced by readily available joysticks in which resistance changes as joystick is moved upward or downward (here only difference is resistances changes as pot is rotated clockwise or counter clockwise). Three LEDs of different colours are used to indicate motor is rotating forward, reverse or its stop.
Connections & Operation
· From three terminals of pot, two are connected to Vcc and Gnd to provide bias to it. The sliding contact is connected to ADC0 input pin PA0 of ATMega32 controller. This gives varying voltage input to ADC
· The anodes of all three LEDs are connected to PORTD pins PD0 – PD2 through current limiting resistors
· PORTC pins PC0 and PC1 are connected to input of L293D. DC motor is connected to output pins of L293D. Thus ATMega32 controller drives 12 V DC motor through L293D chip
· A 16 MHz crystal is connected to crystal input pins. It provides basic clock to controller to do internal operations
· Initially as power is given to circuit the motor start rotating in either of the directions. This is because the digital value (corresponding to analog voltage at ADC input) is either less than mid range value or more than mid range value
· As the pot is rotated to middle position, the digital value also comes in the mid range value. This makes motor to stop rotating. The Blue LED indicates motor is stop
· Now from this middle position as the pot is rotated clockwise the digital value increases (or decreases). This starts rotating motor in one direction.
· Similarly when pot is rotated counter clockwise digital value decreases (or increases) that rotates motor in another direction
· One can set motor terminals in such a way that when pot is rotated clockwise motor also rotates clockwise and vice versa.
· To stop motor again move the pot to mid position
· Two or more such pots can be connected to simultaneously control two or more DC motors
· The speed of DC motor can be changed in 2 or 3 steps in either direction as pot is rotated further fully clockwise or counter clockwise
· Wireless joystick can be made to control DC motor operation wirelessly from remote place
· By replacing the motor driver chip with TIP122 – TIP127 bridge or SSR (solid state relay) bridge configuration one can control DC motor of higher ratings (high power, high current) used in industries.
The project is tested on AVR development board with additional DC motor driver as shown in following snap and video
Fig. 2: Prototype of AVR ATega32 based Joystick operated DC Motor Controller