Professional Documents
Culture Documents
Headlight ALL
Headlight ALL
A
MINI PROJECT REPORT
ON
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION
ENGINEERING
Submitted By
PULLURI RAVITEJA -18R91A0494
PONNAM NAVYA -18R91A0493
MULUPOJU PREETHI -19R95A0421
1
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
CERTIFICATE
This is to certify that the mini project work entitled “AUTOMATIC HEADLIGHT
INTENSITY CONTROL IN VEHICLES TO AVOID NIGHT TIME ACCIDENTS”
done by P. RAVITEJA (18R91A0494), P. NAVYA (18R91A0493), M. PREETHI
(19R95A0421), of ELECTRONICS AND COMMUNICATION ENGINEERING
DEPARTMENT, is a record of bonafide work carried out by them. This project is done as a
partial fulfillment of obtaining BACHELOR OF TECHNOLOGY Degree to be awarded by
JNTUH, Hyderabad. The matter embodied in this project report has not been submitted to
any other university for the award of any other degree.
2
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
DECLARATION
PROJECT ASSOCIATES
P.RAVITEJA -18R91A0494
P.NAVYA -18R91A0493
M.PREETHI -19R95A0421
3
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
4
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
5
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
ACKNOWLEDGEMENT
We acknowledge and express our gratitude and sincere thanks to our guide Ms.
Y.Prathyusha, Associate Professor for constantly monitoring our progress and suggesting
improving at various stages for preparing the project report.
We would like to express our deepest sense of gratitude towards Dr. Sk. UMAR
FARUK, Professor, Head of the Department (ECE) for his valuable help during this project
report. His guidance has been instrumental and has proved to be of immense help during this
project report preparation.
Lastly, we would like to thank everyone who has been involved in this progress of the
project report, whose contributions have added a lot of value.
PROJECT ASSOCIATES
P.RAVITEJA 18R91A0494
P.NAVYA 18R91A0493
M.PREETHI 19R95A0421
6
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
ABSTRACT
7
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
INDEX
8
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.2 microcontroller 16
3.2.1 Introduction to microcontroller 16
3.2.2 Description 17
3.3 8051 microcontroller 19
3.4 Digital dimmer module
3.4.1 Features 22
3.4.2 Applications 22
3.4.3 Specifications 23
3.4.4 Advantages 24
3.4.5 Pin details 24
3.4.6 Working 24
3.4.7 Screen shots 25
3.4.8 Inputs and outputs 26
3.4.9 Digital dimmer with snubber and without snubber 26
3.5 LDR 27
3.5.1 Features 28
3.5.2 Analog Applications 28
3.5.3 Digital applications 28
3.6 Transformer 29
3.7 Turns ratio 29
3.7.1 Power ratio 30
3.7.2 Transformer ratio 30
3.7.3. Transformer losses 30
3.8 Piezo buzzers 31
3.8.1 Electronic components 32
3.8.2 Piezo ceramic element structure 32
3.8.3 Working principle of Piezo buzzers 33
3.8.4 Piezo buzzer structure 33
3.8.5 characteristics 34
3.8.6 Applications 34
3.9 7805 34
3.9.1 Features 35
9
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.9.2 Advantages 35
3.10 Schematic diagram 35
CHAPTER 4
SOFTWARE DESCRIPTION
4.1 steps to use keil 37
4.2 code 44
CHAPTER 5
RESULTS
5.1 Results 45
5.2 Conclusion 45
5.3 Future scope 45
5.4 References 45
10
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
LIST OF FIGURES
S. NO. FIGURE NAME PAGE NO.
1 A modern example of embedded systems 16
4 Fax machine 25
5 Printing machine 25
6 Robot 26
7 Computer networking 26
8 Cellphone 27
9 Web camera 27
10 Micro controller 28
11 8051 microcontroller 31
12 Dimmer module 33
15 LDR 39
16 Transformer 40
19 Piezo buzzers 44
11
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
20 LM7805 pinout 45
12
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
LIST OF TABLES
13
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
CHAPTER 1: INTRODUCTION
In the modern world, everyone wants to reach their destination as soon as possible so number
of vehicles daily increase. During the day time vehicle swill be more so people wish to travel
at night in order to save the time. High beam of vehicles poses a great danger during night
driving. The drivers of most vehicles use high bright beam while travelling at night. This
causes uncomfortable to the person travelling in the opposite direction. He experiences a
sudden blaze for a short period of time. This is caused due to the high intensity of headlight
beam from the other vehicle coming towards him in the opposite direction. We expect that
person to dim the headlight beam to avoid the blaze. This blaze causes a temporary blindness
to a person, resulting in accidents during the night, so we must reduce the intensity of
headlight beam in order to avoid accident during the night. Many people do not follow the
rules of making the headlight beam dim, so it must be automated. About33percentages of
accidents occur during the night instead of day and also tend to have higher percentage of
death, even the number of vehicles is very less compared to day. As per survey done by
researchers the Possible risk related to road accidents is double compare to day
time. In vehicles, Alcohol sensor is suitable for detecting alcohol concentration on our
breathe. It has a high sensitivity and fast response time and also it indicates whether the
person wearing seat belt or not.
1.2 OBJECTIVE:
In order to avoid accidents due to temporary driver blindness, a wireless sensor network
based controller id devised to quickly transmit sensor data between cars. To minimize
temporary blindness headlight intensity adjustment is allowed by low latency. Due to fatigue
caused by repeating switching, laziness, or both, this is mostly neglected by drivers, as a
result, the headlight are left on high beam continously ,resulting in the problem alluded.
14
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Embedded systems are controlled by one or more main processing cores that are typically
either Microcontrollers or Digital signal processors (DSP). The key characteristic, however,
is being dedicated to handle a particular task, which may require very powerful processors.
For example, air traffic control systems may usefully be viewed as embedded, even though
they involve mainframe computers and dedicated regional and national networks between
airports and radar sites. (Each radar probably includes one or more embedded systems of its
own).
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Physically embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants. Complexity varies from low, with a single
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure
Labelled parts include microprocessor (4), RAM (6), flash memory (7). Embedded systems
programming is not like normal PC programming. In many ways, programming for an
embedded system is like programming PC 15 years ago. The hardware for the system is
usually chosen to make the device as cheap as possible. Spending an extra dollar a unit in
order to make things easier to program can cost millions. Hiring a programmer for an extra
month is cheap in comparison. This means the programmer must make do with slow
processors and low memory, while at the same time battling a need for efficiency not seen in
most PC applications. Below is a list of issues specific to the embedded field.
2.1.1 History:
16
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
One of the first recognisable modern embedded systems was the Apollo Guidance Computer,
developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the
size and weight. An early mass-produced embedded system was the Autonetics D-17
guidance computer for the Minuteman missile, released in 1961. It was built
from transistor logic and had a hard disk for main memory. When the Minuteman II went into
production in 1966, the D-17 was replaced with a new computer that was the first high-
volume use of integrated circuits.
2.1.2 Tools:
Embedded development makes up a small fraction of total programming. There's also a large
number of embedded architectures, unlike the PC world where 1 instruction set rules, and the
UNIX world where there's only 3 or 4 major ones. This means that the tools are more
expensive. It also means that they're lowering featured, and less developed. On a major
embedded project, at some point you will almost always find a compiler bug of some sort.
Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if
you stop on a breakpoint when your system is controlling real world hardware (such as a
motor), permanent equipment damage can occur. As a result, people doing embedded
programming quickly become masters at using serial IO channels and error message style
debugging.
2.1.3 Resources:
To save costs, embedded systems frequently have the cheapest processors that can do the job.
This means your programs need to be written as efficiently as possible. When dealing with
large data sets, issues like memory cache misses that never matter in PC programming can
hurt you. Luckily, this won't happen too often- use reasonably efficient algorithms to start,
17
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
and optimize only when necessary. Of course, normal profilers won't work well, due to the
same reason debuggers don't work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually have
the least memory they can get away with. That means their algorithms must be memory
rather than the reverse. It also means you can't afford to leak memory. Embedded
applications generally use deterministic memory techniques and avoid the default "new" and
"malloc" functions, so that leaks can be found and eliminated more easily. Other resources
programmers expect may not even exist. For example, most embedded processors do not
have hardware FPUs (Floating-Point Processing Unit). These resources either need to be
emulated in software, or avoided altogether.
Embedded systems frequently control hardware, and must be able to respond to them in real
time. Failure to do so could cause inaccuracy in measurements, or even damage hardware
such as motors. This is made even more difficult by the lack of resources available. Almost
all embedded systems need to be able to prioritize some tasks over others, and to be able to
put off/skip low priority tasks such as UI in favour of high priority tasks like hardware
control.
The uses of embedded systems are virtually limitless, because every day new products are
introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much
cheaper. So, when implementing a new form of control, it's wiser to just buy the generic chip
and write your own custom software for it. Producing a custom-made chip to handle a
particular task or set of tasks costs far more time and money. Many embedded computers
even come with extensive libraries, so that "writing your own software" becomes a very
trivial task indeed. From an implementation viewpoint, there is a major difference between a
computer and an embedded system. Embedded systems are often required to provide Real-
Time response. The main elements that make embedded systems unique are its reliability and
ease in debugging.
18
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
2.2.1 Debugging:
Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
External debugging using logging or serial port output to trace operation using either
a monitor in flash or using a debug server like the Remedy Debugger which even
works for heterogeneous multi core systems.
An in-circuit debugger (ICD), a hardware device that connects to the microprocessor
via a JTAG or Nexus interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in
the processor.
An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
A complete emulator provides a simulation of all aspects of the hardware, allowing all
of it to be controlled and modified and allowing debugging on a normal PC.
Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.
Because an embedded system is often composed of a wide variety of elements, the debugging
strategy may vary. For instance, debugging a software(and microprocessor) centric embedded
system is different from debugging an embedded system where most of the processing is
performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the
embedded system design may wish to check the data traffic on the busses between the
19
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
processor cores, which requires very low-level debugging, at signal/bus level, with a logic
analyser for instance.
2.2.2 Reliability:
Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by them if an error occurs. Therefore the
software is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backup s are selected by an operator. Examples include aircraft navigation,
reactor control systems, safety-critical chemical factory controls, train signals, engines
on single-engine aircraft.
The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
A variety of techniques are used, sometimes in combination, to recover from errors
both software bugs such as memory leaks, and also soft errors in the hardware:
Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
Subsystems with redundant spares that can be switched over to
software "limp modes" that provide partial function
Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly
secure & reliable system environment
An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
20
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
propagating from one subsystem to another, improving reliability. This may also
allow a subsystem to be automatically shut down and restarted on fault detection.
Immunity Aware Programming
In this design, the software simply has a loop. The loop calls subroutines, each of
which manages a part of the hardware or software.
Some Embedded systems are predominantly interrupt controlled. This means that
tasks performed by the system are triggered by different kinds of events. An interrupt could
be generated for example by a timer in a predefined frequency, or by a serial port controller
receiving a byte. These kinds of systems are used if event handlers need low latency and the
event handlers are short and simple.
Usually these kinds of systems run a simple task in a main loop also, but this task is
not very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks
to a queue structure. Later, after the interrupt handler has finished, these tasks are executed by
the main loop. This method brings the system close to a multitasking kernel with discrete
processes.
Cooperative Multitasking:
A non-primitive multitasking system is very similar to the simple control loop scheme, except
that the loop is hidden in an API. The programmer defines a series of tasks, and each task
gets its own environment to “run” in. When a task is idle, it calls an idle routine, usually
called “pause”, “wait”, “yield”, “NOP” (stands for no operation), etc. The advantages and
21
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
disadvantages are very similar to the control loop, except that adding new software is easier,
by simply writing a new task, or adding to the queue-interpreter.
Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads based on a
timer (connected to an interrupt). This is the level at which the system is generally considered
to have an "operating system" kernel. Depending on how much functionality is required, it
introduces more or less of the complexities of managing multiple tasks running conceptually
in parallel.
As any code can potentially damage the data of another task (except in larger systems using
an MMU) programs must be carefully designed and tested, and access to shared data must be
controlled by some synchronization strategy, such as message queues, semaphores or a non-
blocking synchronization scheme.
A microkernel is a logical step up from a real-time OS. The usual arrangement is that
the operating system kernel allocates memory and switches the CPU to different threads of
execution. User mode processes implement major functions such as file systems, network
interfaces, etc. In general, microkernels succeed when the task switching and inter task
communication is fast, and fail when they are slow.
Exokernels communicate efficiently by normal subroutine calls. The hardware and all
the software in the system are available to, and extensible by application programmers.
Based on performance, functionality, requirement the embedded systems are divided into
three categories:
22
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
These systems takes the input in the form of electrical signals from transducers
or commands from human beings such as pressing of a button etc.., process them and
produces desired output. This entire process of taking input, processing it and giving output is
done in standalone mode. Such embedded systems comes under stand alone embedded
systems
Embedded systems which are used to perform a specific task or operation in a specific time
period those systems are called as real-time embedded systems. There are two types of real-
time embedded systems.
These embedded systems follow an absolute dead line time period i.e.., if the tasking
is not done in a particular time period then there is a cause of damage to the entire equipment.
Ex: consider a system in which we have to open a valve within 30 milliseconds. If this
valve is not opened in 30 ms this may cause damage to the entire equipment. So in such cases
we use embedded systems for doing automatic operations.
Ex: Consider a TV remote control system, if the remote control takes a few milliseconds
delay it will not cause damage either to the TV or to the remote control. These systems which will not
cause damage when they are not operated at considerable time period those systems comes under soft
real-time embedded systems.
Ex:
23
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Consider a web camera that is connected to the computer with internet can be used to
spread communication like sending pictures, images, videos etc.., to another computer
with internet connection throughout anywhere in the world.
Consider a web camera that is connected at the door lock.
Whenever a person comes near the door, it captures the image of a person and
sends to the desktop of your computer which is connected to internet. This gives an
alerting message with image on to the desktop of your computer, and then you can
open the door lock just by clicking the mouse. Fig: 2.2 show the network
communications in embedded
The central processing unit can be any one of the following microprocessor,
microcontroller, digital signal processing.
Among these Microcontroller is of low cost processor and one of the main advantage
of microcontrollers is, the components such as memory, serial communication
interfaces, analog to digital converters etc.., all these are built on a single chip. The
numbers of external components that are connected to it are very less according to the
application.
24
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires
many external components like memory, serial communication, hard disk, input
output ports etc.., so the power consumption is also very high when compared to
microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved
with processing of signals
25
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
26
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
27
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.1 Introduction
In this chapter the block diagram of the project and design aspect of independent modules
are considered. Block diagram is shown in fig:3.1:
MICRO DIMMER
LDR CONTR LIGHT
OLLER MODULE
28
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
external peripherals such as memory, input-output lines, timers and other. Further increasing
of the volume of the package resulted in creation of integrated circuits. These integrated
circuits contained both processor and peripherals. That is how the first chip containing a
microcomputer, or what would later be known as a microcontroller came about.
The features, pin description of the microcontroller used are discussed in the following
section
3.2.2 Description:
29
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Microchip PIC microcontrollers are available in various types. When PIC microcontroller
MCU was first available from General Instruments in early 1980's, the microcontroller
consisted of a simple processor executing 12-bit wide instructions with basic I/O functions.
These devices are known as low-end architectures. They have limited program memory and
are meant for applications requiring simple interface functions and small program & data
memories. Some of the low-end device numbers are
12C5XX
16C5X
16C505
Midrange PIC architectures are built by upgrading low-end architectures with more number
of peripherals, more number of registers and more data/program memory. Some of the mid-
range devices are
16C6X
16C7X
16F87X
30
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
31
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
applied the pin will act as an input pin. These pins are also referred to as P1.0 to
P1.7 (where P1 indicates that it is a pin in port 1 and the number after ‘.’ tells the
pin number i.e. 0 indicates first pin of the port. So, P1.0 means first pin of port 1,
P1.1 means second pin of the port 1 and so on). These pins are bidirectional pins.
Pin 9 (RST) –
Reset pin. It is an active-high, input pin. Therefore if the RST pin is high for a
minimum of 2 machine cycles, the microcontroller will reset i.e. it will close and
terminate all activities. It is often referred as “power-on-reset” pin because it is used
to reset the microcontroller to it’s initial values when power is on (high).
P3.1 (TXD) :
11th pin is TXD (serial data transmit pin) which is serial output pin. Through this
output signal microcontroller transmits data for serial communication.
P3.6 (WR’) :
16th pin is for external memory write i.e. writing data to the external memory.
P3.7 (RD’) :
17th pin is for external memory read i.e. reading data from external memory.
32
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Pin 20 (GND) –
This pin is connected to the ground. It has to be provided with 0V power supply.
Hence it is connected to the negative terminal of the power supply.
Pin 29 (PSEN) –
PSEN stands for Program Store Enable. It is output, active-low pin. This is used to
read external memory. In 8031 based system where external ROM holds the
program code, this pin is connected to the OE pin of the ROM.
Pin 40 (VCC) –
This pin provides power supply voltage i.e. +5 Volts to the circuit.
33
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Switch off the supply voltage of this product as well as of attached devices before
connecting or disconnecting them.
Always use insulated tools while working.
Do not touch any components of the board in open hand during power
The board uses BTA12-600B, Triacsuitable for general purpose mains power AC switching. They can
be used as ON/OFF function in applications such as static relays, heating regulation or induction
motor starting circuit. They are also recommended for phase control operations in light dimmers and
appliance motors speed controllers.
The dimmer board enabled with snubber circuit, especially recommended for use on inductive loads
(Motor/Fan), because of their high commutation performance. The dimmer board controls up to 0-
600V AC 50/60Hz.4 bit 16 levels of input can be given from any controllers/PLC to control dimming
0-100% or ON/OFF.
3.4.2Features:
3.4.3 Applications:
LED light dimming using phase control
Motor or fan speed control
High speed ON/OFF control application
Heater/Temperature control application
34
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
35
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.4.4 Specifications:
Specifications
Digital Input Voltage(D0 -D1) Max input voltage 5V
Operating Voltage 5V
Control level (0 -100%) 16 level digital input
Triac Max Load current 6A
Max Voltage 250V
Frequency 50/60 Hz
Dimension (L * W) 50MM * 30MM
Weight 20g
3.4.5 Advantages:
NAME DETAILS
36
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.4.7 Working:
Another common type of triac switching circuit uses phase control to vary the amount of
voltage, and therefore power applied to a load, in this case a load, for both the positive and
negative halves of the input waveform. This type of AC motor speed control gives a fully
variable and linear control because the voltage can be adjusted from zero to the full applied
voltage as shownin Fig A), Fig B) and Fig C).
This basic phase triggering circuit uses the triac in series with the load across an AC
sinusoidal supply. The 16 level of digital input can control the amount of phase shift on the
gate of the triac which in turn controls the amount of voltage applied to the load by turning
it ON at different times during the AC cycle.
3.4.8 Waveforms:
shows 25% Dimming for given voltage Fig B) shows 25% Dimming
given voltage when D3=1 ,D2=0, D1=1, D0=0 when D3=0 ,D2=1
37
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.4.9
Inputs and outputs of Dimmer Module
INPUT OUTPUT
D3 D2 D1 D0 Dimming %
1 1 1 1 0%
1 1 1 0 5%
1 1 0 1 10%
1 1 0 0 15%
1 0 1 1 20%
1 0 1 0 25%
1 0 0 1 30%
1 0 0 0 40%
0 1 1 1 50%
0 1 1 0 60%
0 1 0 1 65%
0 1 0 0 70%
0 0 1 1 75%
0 0 1 0 80%
0 0 0 1 85%
0 0 0 0 100%
38
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Image
Application Suitable for Inductive Load Suitable for LED ON/OFF and phase
dimming
3.5 LDR
A photoelectric device can be either intrinsic or extrinsic. In intrinsic devices, the only
available electrons are in the valence band, and hence the photon must have enough energy to
excite the electron across the entire bandgap. Extrinsic devices have impurities added, which
39
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
have a ground state energy closer to the conduction band - since the electrons don't have as
far to jump, lower energy photons (i.e. longer wavelengths and lower frequencies) are
sufficient to trigger the device.
Fig:5.1 LDR
3.5.1 Features:
40
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.6 Transformers:
A transformer uses the principles of electromagnetism to change one A.C. voltage level to
another. Faraday's work in the 19th century showed that a changing current in a conductor (e.g. a
transformer primary winding) sets up a changing magnetic field around the conductor. If another
conductor (secondary winding) is placed within this changing magnetic field a voltage will be induced
into that winding.
41
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Faraday also calculated that the voltage induced into the secondary winding would
have a magnitude that depends on the TURNS RATIO of the transformer. i.e. If the
secondary winding has half the number of turns of the primary winding, then the secondary
voltage will be half the voltage across the primary winding. Likewise, if the secondary
winding has twice the number of turns of the primary winding, the secondary voltage will be
double the primary voltage.
3.7.3Transformer Losses:
The formulae in Fig. 11.1.1 relate to an ideal transformer, i.e. a transformer with no power
losses, in which, Primary volt amperes = Secondary volt amperes.
While practical transformers can be extremely efficient, some losses will occur because not
all of the magnetic flux produced by the primary winding will link with the secondary
winding. The power losses that occur in a transformer are of three types:
1. Copper Losses.
These losses can also be called winding losses or I2R losses, because they can occur
in windings made from metals other than copper. The losses become evident as heat,
generated in the (copper) wire windings as they dissipate power due to the resistance
of the wire.
The power loss in a transformer winding can be calculated by using the current in the
winding and its resistance, in formula for power, P = I2R. This formula is the reason
copper losses are sometimes called I2R losses. To minimise the losses the resistance
42
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
of the winding must be kept low, using wire of suitable cross sectional area and low
resistivity.
2. Hysteresis losses.
Each time the alternating current reverses (once each cycle), tiny "magnetic
domains" within the core material are reversed. These are physical changes within the
core material and take up some energy. The amount of energy used depends on the
"reluctance" of the core material; in large cores of power transformers where
hysteresis loss maybe a problem it is largely overcome by using special low
reluctance "grain oriented" steel as the core material.
43
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
The buzzer produces a same noisy sound irrespective of the voltage variation applied to it. It
consists of piezo crystals between two conductors. When a potential is applied across these
crystals, they push on one conductor and pull on the other. This, push and pull action, results
in a sound wave. Most buzzers produce sound in the range of 2 to 4 kHz.
The Red lead is connected to the Input and the Black lead is connected to Ground.
Piezo buzzer is an electronic device commonly used to produce sound. Light weight, simple
construction and low price make it usable in various applications like car/truck reversing
indicator, computers, call bells etc. Piezo buzzer is based on the inverse principle of piezo
electricity discovered in 1880 by Jacques and Pierre Curie. It is the phenomena of generating
electricity when mechanical pressure is applied to certain materials and the vice versa is also
true. Such materials are called piezo electric materials. Piezo electric materials are either
naturally available or manmade. Piezoceramic is class of manmade material, which poses
piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When
subjected to an alternating electric field they stretch or compress, in accordance with the
frequency of the signal thereby producing sound.
This is the opposite side of the PCB, having the necessary electronic components: a resistor, a
transistor and an inductor. The input to the transducer is a low voltage DC signal, however in
order to produce sound the piezoceramic disc needs oscillations of high voltage. The
transistor and resistor combination works as an oscillator circuit to produce low amplitude
oscillations from the DC voltage. The magnitude of these oscillations is amplified by the
inducto
44
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
At the heart of all piezo-type buzzers is the piezoelectric element. The piezoelectric element
is composed of a piezoelectric ceramic and a metal plate held together with adhesive. Both
sides of the piezoelectric ceramic plate contain an electrode for electrical conduction. Piezo
materials exhibit a specific phenomenon known as the piezoelectric effect and the reverse
piezoelectric effect. Exposure to mechanical strain will cause the material to develop an
electric field, and vice versa.
45
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
There are two types of piezo buzzers - transducers and indicators. Transducers consist of a
casing, a piezoceramic element and a terminal. In order to operate a transducer, the user must
send a square wave signal to the buzzer. Indicators consist of a casing, a piezoceramic
element, a circuit board and a terminal. In order to operate an indicator, the user must send
the buzzer a specified dc voltage.
Larger footprint
3.8.6 Applications
Buzzers are typically used for identification and alarm purposes across many major
industries. The major application categories that utilize buzzers for indication or alert
purposes include: home appliances, automotive electronics, medical, safety and security,
industrial, and office automation.
46
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
3.9 7805
This series of fixed-voltage integrated-circuit voltage regulators is designed for a wide
range of applications. These applications include on-card regulation for elimination of noise
and distribution problems associated with single-point regulation. Each of these regulators
can deliver up to 1.5 A of output current. The internal current-limiting and thermal-shutdown
features of these regulators essentially make them immune to overload. In addition to use as
fixed-voltage regulators, these devices can be used with external components to obtain
adjustable output voltages and currents, and also can be used as the power-pass element in
precision regulators.
3.9.2 ADVANTAGES:
The Advantages of 7805 Regulator are
High Power-Dissipation Capability
Internal Short-Circuit Current Limiting
Output Transistor Safe-Area Compensation
47
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
C1 L1 LAMP
33p X1
CRYSTAL
C2
230V AC 12V
33p
19 39
XTAL1 P0.0/AD0
38
P0.1/AD1
37
P0.2/AD2
18 36
XTAL2 P0.3/AD3
10uF 35 AC i/p
P0.4/AD4
34 AC o/p
P0.5/AD5
33 DIMMER MODULE
P0.6/AD6
9 32
RST P0.7/AD7
R1
10k 21
P2.0/A8
22
P2.1/A9
23
P2.2/A10
29 24
PSEN P2.3/A11
30 25
ALE P2.4/A12
31 26
EA P2.5/A13
27 +5V
P2.6/A14
28
P2.7/A15
1 10
P1.0 P3.0/RXD
2 11
P1.1 P3.1/TXD
3 12
1.0 LDR1 4
P1.2 P3.2/INT0
13
LDR P1.3 P3.3/INT1
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1
7 16
P1.6 P3.6/WR
8 17
P1.7 P3.7/RD
RV1 80C31
10k
The above schematic diagram of Automatic head light intensity control for avoid accidents
explains the interfacing section of each component with micro controller and LDR sensor
,dimmer module and light crystal oscillator is connected to 13th and 14th pins of micro
controller and dimmer module is connected to micro controller.
48
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Firstly we will download Keil µVision 4 setup and install it by following the
guidelines of installation. That is not a big issue, since user manual guide is
available with the software package. Start the Keil Vision software and follow
these steps.
A new window will appear on screen which will prompt for project name and
directory.Give a name to your project or also change the directory to specific folder
where you want to collect all your work. Here, I have given the project name as “First
Program”.
When you click on save button, a new window will appear naming “Select Device for
Target ‘Target 1’”. Now we have to select specific microcontroller. Here, we have to
49
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
use 8051, which belong to Atmel family, so double click on Atmel. All Atmel
microcontrollers will get available. Select AT89C51 and then click on OK.
When you click on OK, another window will appear which will ask for “Copy
Standard 8051 Startup Code to Project Folder and Add File to Project?” Click on YES
to proceed further.
50
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
If we see on left side of screen i-e, in ‘Project workspace’ you can see
‘STARTUP.A51’ file. It is the file which contains the assembly language commands
of 8051 microcontroller. Leave it just as it is, because we have to first set option
values for target1.
51
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Now click on File << New.Or simply create new file. Blank text file will open and we
have to write our code in it. After writing the code, save this file and the most
52
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
important thing is to give extension of .c or .asm (according to the language used for
Right click the target and select manage components.From the Project component
tab >> select STARTUP.A51 >> click add files.
53
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
Add saved file and close the components window by clicking OK.
Now we are again on the code. Just click on the “Rebuild all target files” from tool
bars. We can also choose Project << Rebuild all target files. By clicking this button
our program will start compilation and give the compilation results at bottom output
window. If our code is correct then there will be no errors.
54
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
55
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
APPENDIX
#include<regx51.h>
Sbit sensor = p1^0;
Void main ()
{
P2=0*00;
While (1)
{
If (sensor = = 1)
{
P2= 0*08;
}
Else
{
P2=0*00;
}
}
}
56
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
CHAPTER 5 : RESULTS
5.1 Result:
When the LDR detects the large amount of intensity of light falling on it, the microcontroller
reduces the amount intensity of light in the vehicle. This gives the clear vision for the drivers.
Thus, it prevents the collision and accidents before occurring it
Fig :
Automatic headlight
intensity control in vehicles to avoid night time accidents
5.2 Conclusion:
Glare during driving is a serious problem for drivers. This is caused due to the sudden
exposure of our eyes to a very bright light; the bright headlights of vehicles in this case. This
causes a temporary blindness called the Troxler effect. Eventually this becomes the major
reason for night accidents. The driver should actually turn down the bright lights immediately
to avoid glare to the other person which is not happening. Hence, is the idea for the design
and development of a prototype circuit called the automatic headlight dimmer. It gives the
driver to use high beam light when required. But it automatically switches the headlight to
low beam when it senses a vehicle approaching from the opposite side. thus the
57
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
implementation of this device in every vehicle in future will not only avoid accidents but also
provide a safe and a comfortable driving.
58
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS
5.4 References:
Niraimathi.S, M.Arthanari, M.Sivakumar, A Fuzzy Approach to Prevent Headlight
Glare, IJCSIS) International Journal of Computer Science and Information
Security,Vol. 9, No. 2, February 2011.
Joseph S. Stam et al, Continuously variable headlamp control, US Patent number
6049171, issue date, Apr 11, 2000.
Roumen Petkov, Interactive headlight control system, US patent publication number
2006/0152935 A1, july 13, 2006
Kenji Kobayashi, YukimasaTamatsu, Special application vehicle head light systems.
Muralikrishnan. R, “Automatic headlight dimmer a prototype for vehicles,” IJRET,
eISSN: 2319-1163, vol. 3, February 2014.
S. G. Magar, “Development of adaptive front light systems,” IJERT, ISSN: 2278-
0181, vol. 3, November 2014.
S. Parhad, “Development of automotive adaptive front lighting system,” proceedings
of IRF international conference, ISBN: 978- 93-82702-56-6, February 2014
S. S. Kapse, A. A. Abhale, A. C. Kudake, and B. S. Shirsath, “Automatic street light
control system,” IJETAE, ISSN:2250- 2459, Vol. 3, May 2013.
Ying Li, and S. Pankanti, “Intelligent headlight control using camera sensor,”US
8493446 B2, July 2013 [6] Victor Nutt, and S. Kher, “Headlight intensity controller
design using wireless sensors,” International Journal of Computer applications (0975-
8887), November 2012
59
TKREC Electronics and Communication Engineering