Microcontroller and Embedded Systems: Project Description by M. Awais Ijaz
Microcontroller and Embedded Systems: Project Description by M. Awais Ijaz
Project Description By M. Awais Ijaz Abdul Rauf Atif Rahim ee307070 ee307184r ee307148r
Introduction
Imagine yourself controlling a wireless device using your Computer. We will incorporate this idea into the control of a remote control. We will control it from our computer with all for directions and speed control as well. The two major parts to the project is the computer software and the car hardware. The software consists of receiving input from the keyboard, decoding the input and outputting the data over the serial port to the microcontroller which will send it to the relays connected to remote control, at the receiver end the receiver will get the combination and forward it to microcontroller over the car which is having the instructions to operate motors.
Transmitter end:
Serial connector RS232. Max 232 Microcontroller with serial communication circuit. Uln 2803 4 Relays RF transmitter(remote control)
Receiver end:
RF receiver Microcontroller Uln 2803 Motors
Design
Relays
Front
Rs 232
MAX 232
ULN 2003
Back Left
Controller
Right
Motors
Forward/back
Receiver
ULN 2003
Controller
Left/right
Codes
Transmitter end
Transmitter
#include <AT89x52.h> void main() { Unsigned char c; SCON=0x50; TMOD=0x20; TH1=-3; TR1=1; while(1) { if(1==RI) { c=SBUF; if(c=='S') { P0_0=0; // connected to LEFT switch P0_1=0; P0_2=0; // connected to RIGHT switch P0_3=0; P0_4=0; // connected to BACK switch P0_5=0; } else if(c=='B') { P0_0=1; P0_1=1; P0_2=0; P0_3=0; P0_4=0; P0_5=0; } else if(c=='R') { P0_0=0; P0_1=0; P0_2=1; P0_3=1; P0_4=0; P0_5=0; }
else if(c=='L') { P0_0=0; P0_1=0; P0_2=0; P0_3=0; P0_4=1; P0_5=1; } else if(c=='F') { P0_0=1; P0_1=1; P0_2=0; P0_3=0; P0_4=1; P0_5=1; } else if(c=='H') { P0_0=1; P0_1=1; P0_2=1; P0_3=1; P0_4=0; P0_5=0; } RI=0; } } }
Transmitter end:
#include<AT89x52.h>
void delay(unsigned int D); void main() { P0=0x07; // making it input to take 0,1,2(0 from left switch, 1 form right switch and 2 from Back switch) while(1) { if(P0_0==0 && P0_1==0 && P0_2==0) // when input is S { P0_4=0; // for forward P0_5=0; // for backward P0_6=0; // for left P0_7=0; // for right } else if(P0_0==0 && P0_1==0 && P0_2==1) // when input is L { P0_4=0; P0_5=0; P0_6=1; P0_7=0; } else if(P0_0==0 && P0_1==1 && P0_2==0) // when input is R { P0_4=0; P0_5=0; P0_6=0; P0_7=1; } else if(P0_0==1 && P0_1==0 && P0_2==0) // when input is B { P0_4=0; P0_5=1; P0_6=0; P0_7=0; } else if(P0_0==1 && P0_1==0 && P0_2==1) // when input is F { P0_4=1; P0_5=0; P0_6=0;
P0_7=0; } else if(P0_0==1 && P0_1==1 && P0_2==0) // when input is H { P0_4=0; P0_6=0; P0_7=0; P0_5=1; delay(50); P0_5=0; delay(50); } } } void delay(unsigned int D) { unsigned int x,y; for(x=0;x<1275;x++) for(y=0;y<D;y++); }