TRAFFIC LIGHT CONTROLLER
BASED ON 8051 MICRO CONTROLLER
SAYYAD FARHAAN ALI (45)
SUMMIT SABLE (42)
ROHAN PANDEY (33)
ROHAN JAITPAL (56)
INTRODUCTION
• This project uses a LED light as an indicator.
• A Microcontroller for auto change signal after a specific
time interval.
• The LEDs are automatically on and off by making the
corresponding port pin of the MicroController High.
COMPONENTS REQUIRED
• 8051 MICROCONTROLLER
• RESISTORS (10 kilo ohms)
• CRYSTAL OSCILLATORS (11.0592MHz)
• LED LIGHTS (RED,GREEN,YELLOW)
• BREADBOARD
• POWER SUPPLY
BLOCK DIAGRAM
CIRCUIT DIAGRAM
WORKING
• The pins of the various input output ports of the
microcontroller are connected directly to the given LEDs.
• The 8051 is programmed in a manner that the respective
LEDs glow by setting the required bit using assembly
language and a certain amount of delay is provided
depending on the user.
PROGRAM
// Traffic light project prototype with AVR microcontroller
#define F_CPU 8000000UL
#include<avr/io.h>
#include<util/delay.h>
int main()
{
unsigned int ch[]={0x90,0x80,0xF8,0x82,0x92,0x99,0xB0,0xA4,0xF9,0xC0};
unsigned int i;
DDRC=0xFF;
DDRA=0xFF;
DDRB=0xFF;
DDRD=0xFF;
PORTA=(1<<5);
PORTB=(0<<5);
PORTD=(0<<5);
while(1)
{
for(i=0;i<10;i++)
{
PORTC=ch[i];
_delay_ms(1000);
}
PORTA=(0<<5);
PORTB=(0<<5);
PORTD=(1<<5);
for(i=6;i<10;i++)
{
PORTC=ch[i];
_delay_ms(1000);
}
PORTA=(0<<5);
PORTB=(1<<5);
PORTD=(0<<5);
for(i=0;i<10;i++)
{
PORTC=ch[i];
_delay_ms(1000);
}
PORTA=(0<<5);
PORTB=(0<<5);
PORTD=(1<<5);
for(i=6;i<10;i++)
{
PORTC=ch[i];
_delay_ms(1000);
}
PORTA=(1<<5);
PORTB=(0<<5);
PORTD=(0<<5);
}
}
THANK YOU.......