ACCELEROMETER WITH ROBOT USING 8051 (iBOT)

Accelerometer is a device which is used for measuring the acceleration and the tilt angle of any body over which it is mounted. The output of an Accelerometer IC is in terms of variable voltage linear to the acceleration or the tilt angle. So accelerometers can used in lot of applications as two wheel balancing system, vibration sensing machine , tilting remote etc .This concept can be used in robotics wherein one can control an RC car/robot’s motion. In remote controlled robots, minimum of two axes are required; one for the forward-backward motion while the other is for left-right motion.

The Accelerometer IC (MMA7260) used in this project is sourced from Freescale Semiconductors. The wireless control transmission is achieved by using a combination of RF modules (TLP-RLP 434) with a pair of encoder decoder ICs (HT12E &HT12D).

The project makes use of the MMA7260’s voltage levels (0 to Vcc/2) corresponding to X and Y axes. Since an RC car/robot requires four channel control commands we feed these voltage levels into a set of four comparators (LM324) with reference voltages governed by the POTs R3 R4 settings and the output of these comparators are fed into the encoder IC, which in-turn sends the control command wirelessly through the transmitter module. The attached diagram depicts the schematics for the remote.

1.JPG

On receiver end, RF receiver module data pin is connected to decoder IC(HT12D) .

And four data pins of decoder are connected to iBOT sensor port .

Building a RF remote control click here

iBoard ,RF module with encoder/decoder ICs available on TRI Roboshop : Click here

img_1052.jpg

img_1053.jpg

img_1054.jpg

img_1058.jpg

PROGRAM CODE IN TRIC

For Downloading TRIC click here

For learning about TRIC click here

#include<P89V51RD2.h>

#include<delay.h>

#define fwd 0×05 // 01 01 Motor 1 and 2 in forward direction

#define left 0×06 // 01 10 Motor 2 in forward direction and Motor 1 in reverse direction

#define right 0×09 // 10 01 Motor 1 in forward direction and Motor 2 in reverse direction

#define rev 0×0A // 10 10 Motor 1 and 2 in reverse direction

void main()

{

P1= 0xFF; // Port 1 initialized as input

P2= 0×00; // Port 2 initialized as output

while(1)

{

if(P1_0==0) //If receive data D0 then move Forward

{

P2=fwd;

}

else if (P1_1==0) //If receive data D1 then move Backward

{

P2=rev;

}

else if (P1_2==0) // If receive data D2 then turn Left

{

P2=left;

}

else if (P1_3==0) // If receive data D3 then turn Right

{

P2=right;

}

else // and when don’t receive data then both motors are stopped

{

P2=0;

}

}

}

Leave a Reply