DC Motor Control with Joystick & AVR Microcontroller Using Atmega

DC Motor Control

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.

DC Motor Control

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.

DC Motor Control schematic

stick, avr
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

Connections:

·         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

Operation:

·         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

 

Read more: DC Motor Control with Joystick & AVR Microcontroller

Leave a Comment

Your email address will not be published. Required fields are marked *