GOUTAM CEP Microcnotroller

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

COMPLEX ENGINEERING PROBLEM

Page 1
Microcontroller and embedded system

DEPARTMENT OF MECHATRONICS ENGINEERING

COMPLEX ENGINEERING PROBLEM

Design a traffic light signal


SUBMITTED TO: Mam Memona Memon

SUBMITTED BY: GOUTAM KUMAR (20MTE037)

S.NO TABLE OF CONTENTS


1 OBJECTIVE

2 INTRODUCTION

3 COMPONENTS REQUIREMENT

 COMPONENTS LIST

 COMPONENTS DESCRIPTION

4 SYSTEM IMPLEMENTATION

 WORKING PRINCIPLE

 SOFTWARE USED

Page 2
 CODE

 CIRCUIT DIAGRAM

5 CONCLUSION

 APPLICATIONS

6 REFERENCES

OBJECTIVE
Design a traffic light signal containing Interfacing and operation of
seven segment display (down counter) starting from 15 seconds to
allow and forbid the flow of traffic through an 8051 microcontroller.

INTRODUCTION
Traffic lights are essential components of any modern transportation
system, enabling the safe and efficient flow of vehicular and
pedestrian traffic. A traffic signal typically uses a combination of

Page 3
Microcontroller and embedded system

light-emitting diodes (LEDs) to signal drivers and pedestrians when


to proceed or stop.
To design a traffic light signal, one needs to consider the interfacing
and operation of a seven-segment display with a down counter. A
down counter is used to count down the time from 15 seconds to
allow and forbid the flow of traffic through the intersection. An 8051
microcontroller is used to control the operation of the traffic light
signal.

The seven-segment display is a common type of electronic display


that uses seven LEDs to display numbers, letters, and other
characters. The down counter is programmed to decrement the time
by 1 second until it reaches 0, and then it resets to 15 seconds. The
seven-segment display is updated with the current time at each step
of the countdown.

The traffic light signal consists of three lights, namely red, yellow,
and green. Each light is connected to a relay, which is controlled by
the microcontroller. The red light is turned on when the countdown
reaches 0, indicating that traffic should stop. The yellow light is
turned on for a few seconds, indicating that traffic should prepare to
stop. Finally, the green light is turned on, indicating that traffic can
proceed.

Page 4
Overall, the design of a traffic light signal using a down counter and
seven-segment display involves the integration of several
components, including an 8051 microcontroller, relays, and LEDs.
Proper interfacing and operation of these components are critical to
ensure the safe and efficient flow of traffic through an intersection.

COMPONENTS REQUIREMENT
 8051 microcontroller

 Seven segment display

 LEDs

 9v battery

 Ground wire

Page 5
Microcontroller and embedded system

COMPONENTS DESCRIPTION
1) 8051 microcontroller:

An 8051 microcontroller is used to control the operation of the traffic


light signal.

2) Seven segment display:

The seven-segment display is a common type of electronic display that


uses seven LEDs to display numbers, letters, and other characters. The
down counter is programmed to decrement the time by 1 second until it
reaches 0, and then it resets to 15 seconds. The seven-segment display is
updated with the current time at each step of the countdown.

3) LEDs:

Red led:

The red light is turned on when the countdown reaches 0, indicating that
traffic should stop.

Yellow led:

The yellow light is turned on for a few seconds, indicating that traffic
should prepare to stop.

Green led:

The green light is turned on, indicating that traffic can proceed.

Page 6
4) 9v battery:

A 9V battery is used as a single power source.

5) Ground wire:

When running a ground wire, it should be connected to the designated


place on the device, and then run to a safe location where the energy can
be dispersed.

Working principle:
The working principle of the traffic light signal involves the use of a
down counter to count down the time for each signal, a seven-
segment display to display the countdown time, and an 8051
microcontroller to interface with both the down counter and the
seven-segment display. The microcontroller receives input from the
down counter and changes the signal by switching on/off the
appropriate lights at the appropriate times.

Software used:
 Proteus:

The Proteus Design Suite is a proprietary software tool suite used


primarily for electronic design automation. The software is used mainly

Page 7
Microcontroller and embedded system

by electronic design engineers and technicians to create schematics and


electronic prints for manufacturing printed circuit boards.

 AVR:

AVR studio is an Integrated Development Environment (IDE) developed


by ATMEL for developing different embedded applications based on 8-
bit AVR microcontroller.

CODE:

#include <reg51.h> // Include header file for 8051 microcontroller


sbit red_signal = P1^0; // Define red signal pin as P1.0
sbit yellow_signal = P1^1; // Define yellow signal pin as P1.1
sbit green_signal = P1^2; // Define green signal pin as P1.2
void delay(unsigned int); // Declare delay function
void main() {
while(1) { // Loop indefinitely
// Green light on for 15 seconds
green_signal = 1; // Turn on green signal
delay(15000); // Delay for 15 seconds
green_signal = 0; // Turn off green signal
// Yellow light on for 3 seconds
yellow_signal = 1; // Turn on yellow signal
delay(3000); // Delay for 3 seconds
yellow_signal = 0; // Turn off yellow signal
// Red light on for 12 seconds
red_signal = 1; // Turn on red signal

Page 8
delay(12000); // Delay for 12 seconds
red_signal = 0; // Turn off red signal
}
}
// Function to create a delay
void delay(unsigned int count) {
unsigned int i, j;
for(i=0; i<count; i++)
for(j=0; j<100; j++);
}

Circuit diagram:

Page 9
Microcontroller and embedded system

CONCLUSION

Applications:
Intersection control:
Traffic lights are used at intersections to control the flow of traffic, allowing
vehicles to pass through the intersection safely and efficiently. The signals
indicate when it is safe for vehicles to proceed, and when they should stop.

Page 10
Pedestrian safety: Traffic lights are also used to provide safe crossings for
pedestrians. They help to regulate pedestrian traffic, allowing them to cross
busy roads without endangering their lives.
Emergency vehicle management:
Traffic lights are used to control the flow of emergency vehicles, such as
ambulances, fire trucks, and police cars, through intersections. They ensure
that emergency vehicles can reach their destination quickly and safely.
Transit priority:
Traffic lights can be programmed to give priority to buses or other forms of
public transportation, ensuring that they can travel quickly and efficiently
through busy areas.

References:
https://www.electronics-tutorials.ws/blog/7-segment-display-tutorial.html
https://chat.openai.com/chat/0cbfbcb5-63a5-4c9d-8548-d74a4c2a33b8
https://www.circuitstoday.com/interfacing-seven-segment-display-to-8051

Page 11
Microcontroller and embedded system

Page 12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy