In: Electrical Engineering
Design an embedded system using MSP430 to control a traffic light system. It is included a complete design description of a traffic light system to help you in your design. Show the hardware schematics and the software needed to complete your design.
MSP430 Development kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 16-bit Microcontrollers. It integrates on board PS2, UART, ADC, PWM, Temperature Sensor, Relay, Buzzer, I2c Seven Segment, I2C Serial EEPROM, Temperature Sensor LM35, Matrix Keypad, Switch, LED, Stepper Motor Driver, Traffic Light Controller, I2C RTC, LCD & GLCD Display to create a stand-alone versatile test platform. User can easily engage in Development in this platform, or use it as reference to application Development.
Traffic Light Control
Traffic lights, which may also be known as stoplights, traffic lamps, traffic signals, signal lights, robots or semaphore, are signaling devices positioned at road intersections, pedestrian crossings and other locations to control competing flows of traffic.
About the colors of Traffic Light Control
Traffic lights alternate the right of way of road users by displaying lights of a standard color (red, yellow/amber, and green), using a universal color code (and a precise sequence to enable comprehension by those who are color blind).
In the typical sequence of colored lights:
Illumination of the green light allows traffic to proceed in the direction denoted,
Illumination of the yellow/amber light denoting, if safe to do so, prepare to stop short of the intersection, and
Illumination of the red signal prohibits any traffic from proceeding.
Usually, the red light contains some orange in its hue, and the green light contains some blue, for the benefit of people with red-green color blindness, and "green" lights in many areas are in fact blue lenses on a yellow light (which together appear green).
Interfacing Traffic Light with MSP430F5529
The Traffic light controller section consists of 12 Nos. point LEDS are arranged by 4Lanes in MSP430F5529 Development Board . Each lane has Go (Green), Listen (Yellow) and Stop (Red) LED is being placed.
C Program to implement Traffic Light using MSP430F5529
Title : Program to read traffic light controller
#include
#include
void DelayMs(int Ms);
unsigned int i;
unsigned int Value[16] = { 0x0001,0x0002,0x0004,0x0008, 0x0010,0x0020,0x0040,0x0080, 0x0100,0x0200,0x0400,0x0800, 0x1000,0x2000,0x4000,0x8000, };
int main(void)
{
WDTCTL = WDTPW + WDTHOLD;
// Stop watchdog timer P1DIR |= 0xFF;
// Set P1.0-P1.7 to Output direction P7DIR |= 0x0F;
// Set P7.0-P7.3 to Output direction while(1)
{ P1OUT = 0x09;
P7OUT = 0x03; DelayMs(8000);
P1OUT = 0x89;
P7OUT = 0x02;
DelayMs(3000);
P1OUT = 0x61;
P7OUT = 0x02;
DelayMs(8000);
P1OUT = 0x51;
P7OUT = 0x02;
DelayMs(3000);
P1OUT = 0x4C;
P7OUT = 0x02;
DelayMs(8000);
P1OUT = 0x4A;
P7OUT = 0x02;
DelayMs(3000);
P1OUT = 0x49;
P7OUT = 0x08;
DelayMs(8000);
P1OUT = 0x49;
P1OUT = 04;
DelayMs(3000);
}
}
void DelayMs(int Ms)
{
int i;
while(Ms>0)
{
for(i=0;i<104;i++);
Ms--;
}
}