AT8951 Remote Controller Robot (Con)
Transcript of AT8951 Remote Controller Robot (Con)
-
8/3/2019 AT8951 Remote Controller Robot (Con)
1/5
Microcontroller Based RF
Remote Controller Robot
Roboticists develop man-made mechanicaldevices that can move by themselves, whosemotion must be modelled, planned, sensed,actuated and controlled, and whose motionbehaviour can be influenced by programming.Robots are called intelligent when they succeed inmoving in safe interaction with an unstructuredenvironment, while autonomously achieving their
specified tasks. A robot contains a movablemechanism, influenced by sensing, planning,actuation and control components. It does notimply that a minimum number of these componentsmust be implemented in software. Here an RFremote controlled robot is implemented with thehelp of a At89S52 microcontroller.
A micro-controller can be compared to a smallstand alone computer, it is a very powerful device,which is capable of executing a series of pre-
programmed tasks and interacting with otherhardware devices. Being packed in a tiny integratedcircuit (IC) whose size and weight is usuallynegligible, it is becoming the perfect controller forrobots or any machines requiring some kind of
Microcontroller
EM TESTEDEM TESTED
EMTESTED
MUDIT AGARWAL
intelligent automation. A single microcontroller canbe sufficient to control a small mobile robot, anautomatic washer machine or a security system.Any microcontroller contains a memory to store theprogram to be executed, and a number ofinput/output lines that can be used to interact withother devices, like reading the state of a sensor orcontrolling a motor. Some machines and robots will
even rely on a multitude of microcontrollers, eachone dedicated to a certain task. Most recentmicrocontrollers are 'In System Programmable',meaning that you can modify the program beingexecuted, without removing the microcontrollerfrom its place. Today, microcontrollers are anindispensable tool for the robotics hobbyist as wellas for the engineer. Starting in this field can be alittle difficult, because you usually can't understandhow everything works inside that integrated circuit,so you have to study the system gradually, a smallpart at a time, until you can figure out the wholeimage and understand how the system works. Thespecial features of the 89S52 microcontroller aregrouped in the blue box at the bottom of figure 1. Itis clear that the CPU (Central Processing Unit) is theheart of the microcontrollers, It is the CPU that willRead the program from the FLASH memory andexecute it by interacting with the differentperipherals.
Voltage regulators comprise a class of widely usedICs. Regulator IC units contain the circuitry forreference source, comparator amplifier, control
device, and overload protection all in a single IC.IC units provide regulation of either a fixed positivevoltage, a fixed negative voltage, or an adjustablyset voltage. The regulators can be selected foroperation with load currents from hundreds of milliamperes to tens of amperes, corresponding topower ratings from milli watts to tens of watts. Here7805 regulator is used.
IC voltage regulators
CONSTRUCTION
P1.01
P1.7
RST
10P3.0
P3.717
19
XTAL1XTAL2
PORT1
PORT3
RAMEEPROM(FLASH)
CPU
PORT0
VCC
40
PORT2
GND 20
Timers, Counters,Interrupts, Serial
Port, SFRs,Watch-dog.
39P0.0
P0.7
P2.021
EA
ALE
PSEN
P2.7
Fig.1. Pin Diagram & Features of 8051 core
-
8/3/2019 AT8951 Remote Controller Robot (Con)
2/5
Motor Driver
Software
An H-bridge is an electronic circuit which enables avoltage to be applied across a load in eitherdirection. These circuits are often used in roboticsand other applications to allow DC motors to run
forwards and backwards. The term "H-bridge" isderived from the typical graphical representation ofsuch a circuit. An H-bridge is built with four switches(solid-state or mechanical). When the switches S1and S4 (according to the below right figure) areclosed (and S2 and S3 are open) a positive voltagewill be applied across the motor. By opening S1 andS4 switches and closing S2 and S3 switches, thisvoltage is reversed, allowing reverse operation ofthe motor. Using the nomenclature above, theswitches S1 and S2 should never be closed at thesame time, as this would cause a short circuit on theinput voltage source. The same applies to the
switches S3 and S4. This condition is known asshoot-through. This H-bridge uses MOSFETs forone main reason - to improve the efficiency of thebridge. When BJT transistors (normal transistors)were used, they had a saturation voltage ofapproximately 1V across the collector emitterjunction when turned on. A power supply of 10Vconsumes 2V across the two transistor required tocontrol the direction of the motor. 20% of powerwas eaten up by the transistors. The transistors alsowould get quite hot. MOSFETs are used herebecause when they turn on they have an ONresistance called RDS(on). This is the resistance
between the Drain and Source when turned on. It isquite easy to buy MOSFETs that have very lowRDS(on) ratings of less than 0.1 ohm. At 4 amps,this would mean that the voltage drop would be0.4V per MOSFET. A MOSFETs having an RDS(on)of 0.04 ohms will improve efficency greatly. Now,when a MOSFET has a low RDS(on) rating, itusually has quite a high current rating typically inthe 10s of amps. RF transmitter used is ofapproximately 433MHZ frequency microcontrolleris used to write an d read RF transmitter & receiver.Circuit diagram RF Robot Receiver is shown in fig. 3& Circuit diagram RF Robot Transmitter is shown infig. 4. Component Layout RF Robot Transmitter isshown in fig. 5. PCB Layout RF Robot Transmitter isshown in fig. 6. Component Layout RF RobotReceiver is shown in fig. 7. PCB Layout RF RobotReceiver is shown in fig. 8.
#include #include
sbit buffer=P0^0;sbit rotate=P0^1;sbit D7=P0^7;sbit D6=P0^6;sbit D5=P0^5;sbit D4=P0^4;sbit P10=P1^0;sbit P11=P1^1;sbit P12=P1^2;sbit P13=P1^3;
sbit P14=P1^4;sbit P15=P1^5;sbit P16=P1^6;sbit P17=P1^7;sbit P30=P3^0;sbit P31=P3^1;sbit P34=P3^4;sbit P35=P3^5;sbit P36=P3^6;sbit P37=P3^7;sbit P20=P2^0;sbit P21=P2^1;sbit P22=P2^2;sbit P23=P2^3;sbit P24=P2^4;
sbit P25=P2^5;sbit P26=P2^6;sbit P27=P2^7;void wait(void);void ready(void);void pickp(unsigned char);void rom(unsigned char *);void got(void);void ram1(unsigned short k);void ram3(unsigned long tt);void ram4(unsigned long tt);void ram5(unsigned long);char write_random_data(char device, unsigned intaddress,unsigned char byte);
char read_random_data(int device, int address);void senddata(char o_byte);char readdata(void);char ack(char device);char nack(void);void DATA1(void);void DATA2(void);void secondGENERATE(void);void firstGENERATE(void);
CONSTRUCTION
M
S1
S2
S4
S3
Fig.2 : Block Diagram of H-Bridge.
-
8/3/2019 AT8951 Remote Controller Robot (Con)
3/5
void second_SCL(void);void first_SCL(void);void Delay_ms(unsigned int);void romstringonlcd0(void);void RFData1(void);void RFData2(void);
void RFData3(void);void RFData4(void);void RFData5(void);void noData(void);unsigned long semaphore(void);void pqrotate1(void);
CONSTRUCTION
RF
Ic
Ic1
Fig. 5:Component Layout of RF Robot Transmitter
1
9Beyu
+2 3
C2
Ic1
GDS
GDS
SDG
SDG
+ ++
T5
T8 T7
T6M2
J2 M Sup J3
R8
R1
R5
R7
R6 R2
R4
R31Bey
+3 Q4 Q1 Q2
R1
Ic2 C1C2XTAL
GDS
GDS
SDG
DG
T1
T4 T3
T2M1
J1
R1
R1
R1 R9Q7 Q8 Q5 Q6
C3
R
Fig. 7: Component Layout of RF Robot Receiver
-
8/3/2019 AT8951 Remote Controller Robot (Con)
4/5
CONSTRUCTION
Fig. 3: Circuit Diagram of RF Robot Receiver
R4
+ +
R2R3
B3 B3
Q1 Q2
+ +
R5 R6
B3 B3
Q3Q4
R7
+ +
R8 R9
B3 B3
Q5
Q6
R10
+ +
R11 R12
B3 B3
Q7Q8
R13
B2+
B2+
T6
T7
T8
T5
T2
T4
T1
T3
14
RFRX
2
8
67
5
B1=9V
B2=12V
B3=18V
+5 V DC+
B1
Ic13 1
2
9
31
Ic2
VDD
40+5 V DC
+
C1
C2
XTAL
18
19
20
R1
+
12
3
15
10
10
11
12
13
Output 1
Output 2
Output 3Output 4
Output 5
Output 6
Output 7
Output 8
Output 9
Output 10
Output 11
Output 12
16
17
21
22
23
24
25
26
27
7
8
M1
M2
C3
-
8/3/2019 AT8951 Remote Controller Robot (Con)
5/5
void pqrotate2(void);void pqrotate3(void);void pqrotate4(void);void flag(void);void dig(void);void deliver(void);
unsigned long total1,total2,total3,product;main(){unsigned char i_byte;unsigned int i;unsigned char as1,as2,as3,as4,as5;
CONSTRUCTION
Fig. 6: PCB Layout of RF Robot Transmitter
Fig. 8:PCB Layout of RF Robot Receiver