67% found this document useful (3 votes)
5K views16 pages

A Micro Project On 2020-21: Traffic Signal

This document summarizes a student project on simulating a traffic signal using computer graphics. The project was guided by Mr. D.D. Borase and completed by three students. It describes the basic functioning of real-world traffic signals using red, yellow, and green lights. It then discusses the technologies and OpenGL functions used to implement a simulated traffic signal in a computer graphics program, including allowing a user to control a car and interact with the traffic lights. The output of the program is described along with conclusions about illustrating concepts of computer graphics through this simulation.

Uploaded by

N Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
5K views16 pages

A Micro Project On 2020-21: Traffic Signal

This document summarizes a student project on simulating a traffic signal using computer graphics. The project was guided by Mr. D.D. Borase and completed by three students. It describes the basic functioning of real-world traffic signals using red, yellow, and green lights. It then discusses the technologies and OpenGL functions used to implement a simulated traffic signal in a computer graphics program, including allowing a user to control a car and interact with the traffic lights. The output of the program is described along with conclusions about illustrating concepts of computer graphics through this simulation.

Uploaded by

N Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

A Micro Project On 2020-21

TRAFFIC SIGNAL
BY

Under the Guidance of,

Mr.D.D.Borase.

Department of Computer Engineering,


Sau. Shantidevi Chavan Polytechnic,Bhoras

2020-2021

1|P a g e
Sau.Shantidevi Chavan Institute Polytechnic,Bhoras Chalisgaon-424101

CERTIFICATE

This is to certify that Mr. Pardeshi Chetan Gangasing

Mr. Mahajan Sunil Rajendra

Mr.Borase Pavan Ashok

has successfully completed the micro Project on “TRAFFIC


SIGNAL” under my supervision in the partially fulfillment of
diploma of engineering (computer)of Sau.Shantidevi Chavan
Institute Polytechnic,Bhoras.
Date:

Place:

Prof.D.D.Borase Prof.Y.K.Pardeshi Prof.D.A.Patil


Project Guide HOD PRINCIPAL
2|P a g e
INDEX

Sr.no TOPIC PAGE.N


O
1 ACKNOWLEDGEMENT 4
2 ABSTRACT 5
3 INTRODUCTION 6

4 TECHNOLOGY 8
5 IMPLEMENTATION 9

6 LIGHT DESIGN 11

7 C PROGRAM IN GRAPHICS 12
8 OUTPUT 14
9 CONCLUSION 15
10 REFERENCE 16

3|P a g e
Acknowledgement
We would take this opportunity to express my sincere thanks
and gratitude to my teacher Mr.D.D.Borase for his vital support
and guidance in completing this project.

We also express our gratitude to all the facility members,parents


and our fellow mates who have helped me in making this project
a success. We also thank our almighty God for his blessings
showed on me during this period.

Abstract
Main aim of this Mini Project is to illustrate the concepts and usage of
pre-built functions in OpenGL.

 Simulation of a traffic signal is being done using computer graphics

.  The car built using cubes can be moved using arrow keys and based
on traffic signal light the user can obey the traffic rules.

 If the car hits other car then accident scene is shown.

 We have used input devices like mouse and key board to interact with
program.

Introduction

5|Page
Traffic lights, traffic signals, stoplights or robots are signalling
devices positioned at road intersections, pedestrian crossings, and other
locations to control flows of traffic.
The world's first traffic light was a manually operated gas-lit signal
installed in London in December 1868. It exploded less than a month
after it was implemented, injuring its policeman operator. Earnest Sirrine
from Chicago patented the first automated traffic control system in 1910.
It used the words "STOP" and "PROCEED", although neither word was
illuminated.
Traffic lights follow a universal colour code which alternates the right of
way accorded to users with a sequence of illuminating lamps or LEDs of
three standard colours:

 Green light
Allows traffic to proceed in the direction denoted, if it is safe to do so
and there is room on the other side of the intersection. The green light
was traditionally green in colour (hence its name) though modern
LED green lights are turquoise.
 Red light
Prohibits any traffic from proceeding. A flashing red indication
requires traffic to stop and then proceed when safe (equivalent to
a stop sign).
 Amber light (also known as 'orange light' or 'yellow light')
Warns that the signal is about to change to red, with some
jurisdictions requiring drivers to stop if it is safe to do so, and others
allowing drivers to go through the intersection if safe to do so. In
some European countries (such as the UK), red and amber is
displayed together, indicating that the signal is about to change to
green.
A flashing amber indication is a warning signal. In the United
Kingdom and Ireland, a flashing amber light is used only at pelican
crossings, in place of the combined red–amber signal, and indicates
that drivers may pass if no pedestrians are on the crossing.

6|Page
In some countries traffic signals will go into a flashing mode if the
conflict monitor detects a problem, such as a fault that tries to display
green lights to conflicting traffic. The signal may display flashing amber
to the main road and flashing red to the side road, or flashing red in all
directions. Flashing operation can also be used during times of day when
traffic is light, such as late at night.

technology
Optics and lighting:-
7|Page
Traditionally, incandescent and halogen bulbs were used Because of the
low efficiency of light output and a single point of failure (filament
burnout) municipalities are retrofitting traffic signals with LED arrays
that consume less power, have increased light output, last significantly
longer Moreover, in the event of an individual LED failure, the aspect
will still operate albeit with a reduced light output. The light pattern of
an LED array can be comparable to the pattern of an incandescent or
halogen bulb fitted with a prismatic lens.
The low energy consumption of LED lights can pose a driving risk in
some areas during winter. Unlike incandescent and halogen bulbs, which
generally get hot enough to melt away any snow that may settle on
individual lights, LED displays – using only a fraction of the energy –
remain too cool for this to happen. As a response to the safety concerns,
a heating element on the lens was developed.

Programmable visibility signals:-


Signals such as the 3M High Visibility Signal and McCain
Programmable Visibility signal utilize light-diffusing optics and
a Fresnel lens to create the signal indication. The light from a 150 W
PAR46 sealed-beam lamp in these "programmable visibility" signals
passes through a set of two glass lenses at the back of the signal. The
first lens, a frosted glass diffusing lens, diffuses the light into a uniform
ball of light around five inches in diameter. The light then passes
through a nearly identical lens known as an optical limiter (3M's
definition of the lens itself), also known as a "programming lens", also
five inches in diameter.

Implementation

8|Page
This program is implemented using various openGL functions which are
shown below.Various functions used in this program.
glutInit() : interaction between the windowing system and OPENGL is
initiated
glutInitDisplayMode() : used when double buffering is required and
depth information is required
glutCreateWindow() : this opens the OPENGL window and displays the
title at top of the window
glutInitWindowSize() : specifies the size of the window
glutInitWindowPosition() : specifies the position of the window in
screen coordinates
glutKeyboardFunc() : handles normal ascii symbols
glutSpecialFunc() : handles special keyboard keys
glutReshapeFunc() : sets up the callback function for reshaping the
window
glutIdleFunc() : this handles the processing of the background
glutDisplayFunc() : this handles redrawing of the window
glutMainLoop() : this starts the main loop, it never returns
glViewport() : used to set up the viewport
glVertex3fv() : used to set up the points or vertices in three dimensions
glColor3fv() : used to render color to faces
glFlush() : used to flush the pipeline
glutPostRedisplay() : used to trigger an automatic redrawal of the object
9|Page
glMatrixMode() : used to set up the required mode of the matrix
glLoadIdentity() : used to load or initialize to the identity matrix
glTranslatef() : used to translate or move the rotation centre from one
point to another in three dimensions
glRotatef() : used to rotate an object through a specified rotation angle

Light design
In the United States, traffic lights are currently designed with lights
approximately 12 inches (300 mm) in diameter. Previously the standard
10 | P a g e
had been 8 inches (200 mm); however, those are slowly being phased
out in favor of the larger and more visible 12 inch lights. Variations used
have also included a hybrid design, which had one or more 12 inch
lights along with one or more lights of 8 inches (200 mm) on the same
light. For example, these "12-8-8" (along with 8-8-8) lights are standard
in most jurisdictions in Ontario, Manitoba, and British Columbia (that,
is, the red light is 12 and others 8, making the red more prominent).
In the United Kingdom, 12 inch lights were implemented only with
Mellor Design Signal heads designed by David Mellor. These were
designed for symbolic optics to compensate for the light loss caused by
the symbol. However, following a study sponsored by the UK Highways
Agency and completed by Aston University, Birmingham, UK, an
enhanced optical design was introduced in the mid 1990s. Criticism of
sunlight washout (cannot see the illuminated signal due to sunlight
falling on it), and sun-phantom (signal appearing to be illuminated even
when not due to sunlight reflecting from the parabolic mirror at low sun
angles), led to the design of a signal that used lenslets to focus light from
a traditional incandescent bulb through apertures in a matt black front
mask. This cured both problems in an easily manufactured solution. This
design proved very successful and was taken into production by a
number of traffic signal manufacturers through the engineering designs
of Dr Mark Aston, working firstly at the SIRA Ltd in Kent, and latterly
as an independent optical designer. The manufacturers took a licence for
the generic design from the Highways Agency, with Dr Aston
engineering a unique solution for each manufacturer. Producing both
bulb and LED versions of the signal aspects, these signals are still the
most common type of traffic light on UK roads. With the invention of
anti-phantom, highly visible Aston lenses, lights of 8 inches (200 mm)
could be designed to give the same output as plain lenses, so a larger
surface area was unnecessary.
C program in graphics
/**********************************************
Statement - Traffic Light Simulation

11 | P a g e
Programmer - Vineet Choudhary
Written For - http://developerinsider.co
**********************************************/

#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>

main()
{
int gd = DETECT, gm, midx, midy;

initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");

midx = getmaxx()/2;
midy = getmaxy()/2;

setcolor(RED);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(midx, midy-10, "Traffic Light Simulation");
outtextxy(midx, midy+10, "Press any key to start");
getch();
cleardevice();
setcolor(WHITE);
settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
rectangle(midx-30,midy-80,midx+30,midy+80);
circle(midx, midy-50, 22);
setfillstyle(SOLID_FILL,RED);
floodfill(midx, midy-50,WHITE);
setcolor(BLUE);
outtextxy(midx,midy-50,"STOP");

12 | P a g e
delay(2000);
graphdefaults();
cleardevice();
setcolor(WHITE);
rectangle(midx-30,midy-80,midx+30,midy+80);
circle(midx, midy, 20);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(midx, midy,WHITE);
setcolor(BLUE);
outtextxy(midx-18,midy-3,"READY");

delay(2000);
cleardevice();
setcolor(WHITE);
rectangle(midx-30,midy-80,midx+30,midy+80);
circle(midx, midy+50, 22);
setfillstyle(SOLID_FILL,GREEN);
floodfill(midx, midy+50,WHITE);
setcolor(BLUE);
outtextxy(midx-7,midy+48,"GO");
setcolor(RED);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 4);
outtextxy(midx-150, midy+100, "Press any key to exit...");
getch();
clrscr();
cleardevice();
setcolor(RED);
settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(midx, midy, "Project by http://www.turboc.codeplex.com");
delay(5000);
closegraph();
return 0;

13 | P a g e
}

Output

Conclusion
The improvement of town traffic condition is largely dependent on the
modern ways of traffic management and control. Advanced traffic signal

14 | P a g e
controllers and control system contribute to the improvement of the
urban traffic problem. The intelligent of traffic signal controller that is
introduced in this project with powerful functions and hardware
interface. Good quality social benefit has been made through the
application of the intelligent traffic controller in practice, and the
application result shows that the intelligent traffic signal controller will
improve. Before design the circuit and program, it is important to
understand and identify the problem of the system. First, a block
diagram or structure for traffic controller systems must be design.
Referring an interface block diagrams (Figure 3.1), we know the inputs,
outputs, types and the number of states are uses in this project. Using
states machine, it is easy to design and gives the designer nice flexibility
when the designer needs to pathetic the design either for speed or area
optimization. Most synthesis tools in the market have special option to
allow a designer to synthesize a state machine design.

References
 http://dspace.unimap.edu.my/bitstream/handle/123456789/1342/Conclus

ion.pdf?sequence=2

15 | P a g e
 https://developerinsider.co/c-and-cpp-insider/

 https://developerinsider.co/make-traffic-light-simulation-c-language-

programming/

 https://en.wikipedia.org/wiki/Traffic_light#Effects

 https://en.wikipedia.org/wiki/Traffic_light#Types_and_placement_of_co

lours

 file:///C:/Users/PCP/Downloads/448607745-Traffic-Signal-Cg-mini-

Project-using-OpenGL-Report-docx.pdf

16 | P a g e

You might also like