Real Control
Real Control
VEHICLE MOVEMENT
Submitted By
It is a matter of great pleasure for us to express our gratitude to people without whom we
would not have been able to carry out our project successfully.
We would like to thank our faculty, Prof MALAYA KUMAR HOTA for their
continued support in all our endeavours.
Special thanks to all the people who took our survey, without which we wouldn’t have
been able to carry forward our report and analysis.
We thank our friends who helped us in this project through their guidance and
encouragement.
Our thanks and appreciations also go to the team members in developing the project
and people who have willingly helped out with their abilities.
VIT VELLORE, 632014
CERTIFICATE
SIGNATURE
ABSTRACT
With the increasing energy requirements and demands caused due to the rapid
increase in population, there is a crucial need for better energy management and
using. Our project indirectly aims at the same along with better traffic lighting with
the use of simple optoelectronic requisites in sync with our syllabus.
During the night all the lights on the highway remain switched ON for the vehicles,
but lots of energy is wasted when there is no movement. As a vehicle moves along
the highway, the lights few blocks ahead switch on as the trailing lights go down
to save energy.
AIM
1. To promote energy efficiency and the balanced use of energy resources.
CONTENTS
1. INTRODUCTION
3. CIRCUIT DIAGRAM
4. COMPONENTS REQUIRED
5. PROCEDURE
6. WORKING
8. RESULT
1. INTRODUCTION
A light-emitting diode (LED) is a semiconductor device that emits visible light when
an electric current pass through it. The light is not particularly bright, but in most
LEDs, it is monochromatic, occurring at a single wavelength and therefore
frequency.
With the use of a system of transistors and capacitors, a band pass filter can be
designed that will filter the digital sound frequencies into the desired categories. This
was the base of our project.
Saving energy means decreasing the amount of energy used while achieving a similar
outcome of end use. Using less energy has lots of benefits – you can save money and
help the environment. Generating energy requires precious natural resources, for
instance coal, oil or gas.
If we didn't have energy efficiency, we'd have to produce or import energy sources like
oil, natural gas, and coal. So, energy efficiency helps us keep more resources on the
earth longer. This project is an attempt to provide a better alternative for highway
lighting and a classic example of how various little alterations can make a huge
difference in the field of energy saving.
3. CIRCUIT DIAGRAM
4. COMPONENTS REQUIRED
1. IR Sensor
3. LED
4. Resistor
5. Battery
5. PROCEDURE
1. Design a circuit diagram for the required layout for the project.
2. The next thing we did was finalize and write the code with the help of
various online tools and the according to the requirement of arduino Pro
Mini
3. In the code, we first define the pin outputs of all the components
viz, IR sensor, LEDs. Other components include resistor and jumper
wires.
5. If the input sensed by the IR is less than 500 then it’s considered to
be night time and the LEDs should glow but with a low intensity.
IR LED emits infrared rays. Photodetector detects the infrared rays emitted.
If an obstacle is present in the path then as a result the IR light is reflected back and
is detected by the photo detector.
Microcontroller
Analog input is from the Adruino. If input voltage is low, the LED glows with a low
intensity and is dim.
IR sensor gives digital input. If the input from IR sensor is LOW, the intensity of LED
is increased and is no longer dim.
7. BENEFITS TO SOCIETY
When we use less energy, the less energy we need to generate at power plants,
which reduces greenhouse gas emissions and improves the quality of our air. Energy
efficiency helps the economy, too, by saving consumers and businesses millions of
dollars in energy costs.
It’s a no-brainer: When we use less energy, we save precious natural resources and
cut down on pollution.
Energy efficiency safeguards our nation by decreasing the overall demand for energy,
and therefore the need to import and transport fossil fuels.
Safer highway lights will provide better security while travelling in a vehicle at night.
Better light intensity control and cuts down expenditure.
8. RESULT
We have successfully completed the project and built a prototype that lights up on passing
of vehicles and controls the intensity of light. This project can further be built up and can
really bring a change in energy management and can be economical.
ADRUINO CODE
#define ROAD1_SENSOR A0
#define ROAD1_GREEN 13
#define ROAD1_YELLOW 12
#define ROAD1_RED 11
#define ROAD2_SENSOR A1
#define ROAD2_GREEN 10
#define ROAD2_YELLOW 9
#define ROAD2_RED 8
#define ROAD3_SENSOR A2
#define ROAD3_GREEN 7
#define ROAD3_YELLOW 6
#define ROAD3_RED 5
#define ROAD4_SENSOR A3
#define ROAD4_GREEN 4
#define ROAD4_YELLOW 3
#define ROAD4_RED 2
#define DELAY_GREEN 500 /*500*20mS = 10 sec*/
#define DELAY_YELLOW 100 /*100*20mS = 2 Sec*/
#define STATE_CLOSED 0
#define STATE_CLOSING 1
#define STATE_OPENING 2
#define STATE_OPENED 3
#define openRoad1(){r1s = STATE_OPENING; yellowCount = DELAY_YELLOW;}
#define closeRoad1(){r1s = STATE_CLOSING; yellowCount = DELAY_YELLOW;}
#define openRoad2(){r2s = STATE_OPENING; yellowCount = DELAY_YELLOW;}
#define closeRoad2(){r2s = STATE_CLOSING; yellowCount = DELAY_YELLOW;}
#define openRoad3(){r3s = STATE_OPENING; yellowCount = DELAY_YELLOW;}
#define closeRoad3(){r3s = STATE_CLOSING; yellowCount = DELAY_YELLOW;}
#define openRoad4(){r4s = STATE_OPENING; yellowCount = DELAY_YELLOW;}
#define closeRoad4(){r4s = STATE_CLOSING; yellowCount = DELAY_YELLOW;}
unsigned r1s, r2s, r3s, r4s;
unsigned r1d, r2d, r3d, r4d;
unsigned yellowCount;
unsigned greenCount;
byte s1ls, s2ls, s3ls, s4ls;
void pciSetup();
void setup() {
Serial.begin(115200);
Serial.print("Density based traffic control");
pinMode(ROAD1_SENSOR, INPUT);
pinMode(ROAD1_GREEN, OUTPUT);
pinMode(ROAD1_YELLOW, OUTPUT);
pinMode(ROAD1_RED, OUTPUT);
pinMode(ROAD2_SENSOR, INPUT);
pinMode(ROAD2_GREEN, OUTPUT);
pinMode(ROAD2_YELLOW, OUTPUT);
pinMode(ROAD2_RED, OUTPUT);
pinMode(ROAD3_SENSOR, INPUT);
pinMode(ROAD3_GREEN, OUTPUT);
pinMode(ROAD3_YELLOW, OUTPUT);
pinMode(ROAD3_RED, OUTPUT);
pinMode(ROAD4_SENSOR, INPUT);
pinMode(ROAD4_GREEN, OUTPUT);
pinMode(ROAD4_YELLOW, OUTPUT);
pinMode(ROAD4_RED, OUTPUT);
closeRoad1();
closeRoad2();
closeRoad3();
openRoad4();
r4d = r3d = r2d = r1d = 0;
s1ls = s2ls = s3ls = s4ls = 0;
}
void loop() {
byte s1cs, s2cs, s3cs, s4cs;
switch(r1s){
case STATE_CLOSED:
digitalWrite(ROAD1_GREEN, LOW);
digitalWrite(ROAD1_YELLOW, LOW);
digitalWrite(ROAD1_RED, HIGH);
break;
case STATE_CLOSING:
if(yellowCount){
digitalWrite(ROAD1_GREEN, LOW);
digitalWrite(ROAD1_YELLOW, HIGH);
digitalWrite(ROAD1_RED, LOW);
}
else
r1s = STATE_CLOSED;
break;
case STATE_OPENING:
if(!yellowCount){
r1s = STATE_OPENED;
}
break;
case STATE_OPENED:
if(yellowCount){
r1s = STATE_CLOSING;
}else{
digitalWrite(ROAD1_GREEN, HIGH);
digitalWrite(ROAD1_YELLOW, LOW);
digitalWrite(ROAD1_RED, LOW);
}
break;
}
switch(r2s){
case STATE_CLOSED:
digitalWrite(ROAD2_GREEN, LOW);
digitalWrite(ROAD2_YELLOW, LOW);
digitalWrite(ROAD2_RED, HIGH);
break;
case STATE_CLOSING:
if(yellowCount){
digitalWrite(ROAD2_GREEN, LOW);
digitalWrite(ROAD2_YELLOW, HIGH);
digitalWrite(ROAD2_RED, LOW);
}
else
r2s = STATE_CLOSED;
break;
case STATE_OPENING:
if(!yellowCount){
r2s = STATE_OPENED;
}
break;
case STATE_OPENED:
if(yellowCount){
r2s = STATE_CLOSING;
}else{
digitalWrite(ROAD2_GREEN, HIGH);
digitalWrite(ROAD2_YELLOW, LOW);
digitalWrite(ROAD2_RED, LOW);
}
break;
}
switch(r3s){
case STATE_CLOSED:
digitalWrite(ROAD3_GREEN, LOW);
digitalWrite(ROAD3_YELLOW, LOW);
digitalWrite(ROAD3_RED, HIGH);
break;
case STATE_CLOSING:
if(yellowCount){
digitalWrite(ROAD3_GREEN, LOW);
digitalWrite(ROAD3_YELLOW, HIGH);
digitalWrite(ROAD3_RED, LOW);
}
else
r3s = STATE_CLOSED;
break;
case STATE_OPENING:
if(!yellowCount){
r3s = STATE_OPENED;
}
break;
case STATE_OPENED:
if(yellowCount){
r3s = STATE_CLOSING;
}else{
digitalWrite(ROAD3_GREEN, HIGH);
digitalWrite(ROAD3_YELLOW, LOW);
digitalWrite(ROAD3_RED, LOW);
}
break;
}
switch(r4s){
case STATE_CLOSED:
digitalWrite(ROAD4_GREEN, LOW);
digitalWrite(ROAD4_YELLOW, LOW);
digitalWrite(ROAD4_RED, HIGH);
break;
case STATE_CLOSING:
if(yellowCount){
digitalWrite(ROAD4_GREEN, LOW);
digitalWrite(ROAD4_YELLOW, HIGH);
digitalWrite(ROAD4_RED, LOW);
}
else
r4s = STATE_CLOSED;
break;
case STATE_OPENING:
if(!yellowCount){
r4s = STATE_OPENED;
}
break;
case STATE_OPENED:
if(yellowCount){
r4s = STATE_CLOSING;
}else{
digitalWrite(ROAD4_GREEN, HIGH);
digitalWrite(ROAD4_YELLOW, LOW);
digitalWrite(ROAD4_RED, LOW);
}
break;
}
s1cs = digitalRead(ROAD1_SENSOR);
s2cs = digitalRead(ROAD2_SENSOR);
s3cs = digitalRead(ROAD3_SENSOR);
s4cs = digitalRead(ROAD4_SENSOR);
if(s1ls != s1cs && s1cs == LOW){
r1d++;
}
s1ls = s1cs;