Friday, February 7, 2014

Simple Remote control mobile bot


Components RequiredATmega32 microcontroller

  • AVR Programmer Board
  • Crystal
  • Capacitors
  • Motors 
  • L293D IC 
  • +5V supply
  • Battery equivalent to voltage rating of motor 
  • Breadboard
  • Connecting Wires
  • HT12D and HT12E 
  • RF module

Circuit Diagram


Transmitter Circuit:

Receiver Circuit:



Description

  • Enable is directly connected to +5 volt.
  • PC0,PC1,PC2 and PC3 are connected to Input 1-4 of first L293d.
  • PD0,PD1,PD2 and PD3 are connected to Input 1-4 of second L293d.
  • OUT1 and OUT2 are connected to the terminals of first motor and OUT3 and OUT4 are connected to the terminals of the second motor.(L293D -1)
  • OUT1 and OUT2 are connected to the terminals of third motor and OUT3 and OUT4 are connected to the terminals of the fourth motor.(L293D-2)
  • Reset is connected to +5V.
Note:
  • A crystal needs to be connected to XTAL1 and XTAL2 pins to provide the clock pulse in real time.

Source Code


#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
DDRD = 0xFF;         //All pins of PORT D as output
DDRC = 0xFF;        //All pins of PORT C as output 
DDRB = 0x00;         //All pins of PORT B as input 
PORTB = 0xFF;      //Initially all pins at high output
PORTD = 0x00;      //Initially all pins at low output
PORTC = 0x00;      //Initially all pins at low output
    while(1)                      //Infinite Loop
    {
PORTB = 0xFF;
        if(bit_is_clear(PINB,0))     //Forward Run
{
PORTC = 0b00001010;
PORTD = 0b00001010;
_delay_ms(100);
}
if(bit_is_clear(PINB,1))    //Reverse Run
{
PORTC = 0b00000101;
PORTD = 0b00000101;
_delay_ms(100);
}
if(bit_is_clear(PINB,2))    //Rotate on axis(clockwise)
{
PORTC = 0b00001010;
PORTD = 0b00000101;
_delay_ms(100);
}
if(bit_is_clear(PINB,3))      //Rotate on axis(anticlockwise)
{
PORTC = 0b00000101;
PORTD = 0b00001010;
_delay_ms(100);
}
PORTC = 0x00; //reset PORTC to output zero 
PORTD = 0x00;              //reset PORTD to output zero
    }
return 0;
}




The given circuit cannot be simulated in proteus because of the absence of RF modules and HT12D and HT12E. So, in order to check the program the following circuit can be useful.





Thank you for reading.
For more tutorial and information, like the Facebook Page.