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

AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID

NIGHT TIME ACCIDENTS

A
MINI PROJECT REPORT

ON

AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES


TO AVOID NIGHT TIME ACCIDENTS

Submitted in the Partial Fulfilment of the

Requirements for the Award of the Degree of

BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION
ENGINEERING
Submitted By
PULLURI RAVITEJA -18R91A0494
PONNAM NAVYA -18R91A0493
MULUPOJU PREETHI -19R95A0421

Under the guidance of


Mrs. P. SHARMILA RANI
Associate Professor

Department of Electronics and Communication Engineering


TEEGALA KRISHNA REDDY ENGINEERING COLLEGE
Medbowli, Meerpet, Saroornagar, Hyderabad-097

1
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

Affiliated to JNTUH, Hyderabad 2018-20

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.

Internal Guide Project Coordinator


Ms. Y. Prathyusha Mrs. P.Sharmila Rani
Associate Professor Associate Professor

HOD-ECE External Examiner


Dr. SK. Umar Faruq
Professor

2
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

DECLARATION

We, PULLURI RAVITEJA, PONNAM NAVYA, MULUPOJU PREETHI


hereby declare that the work embodied in this dissertation entitled “AUTOMATIC
HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID NIGHT TIME
ACCIDENTS”, Submitted to Jawaharlal Nehru Technological University, Hyderabad, for partial
fulfilment of the degree of ELECTRONICS AND COMMUNICATION ENGINEERING has
been carried out by us under the super vision of, Ms. Y. Prathyusha Associate Professor. To the
best of our knowledge, this work has not been submitted for any other degree in any university.

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.

We would like to thank Dr. K. VENKATA MURALI MOHAN, Principal,


TEEGALA KRISHNA REDDY ENGINEERING COLLEGE for having permitted me to
take on this Project report.

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

The project aims in designing an efficient automatic intensity control for


head lights of the vehicles when they approach each other to avoid accidents using LDR
sensor.
Automation has created a bigger hype in the electronics. The major reason for this hype is
automation provides greater advantages like accuracy, energy conversation, reliability and
more over the automated systems do not require any human attention. Any one of the
requirements stated above demands for the design of an automated device. The energy
conversation is very important in the current scenario and should be done to a maximum
extent where ever it is possible.
Now a days technology is running with time, it completely occupied the life style of human
beings. It is being used everywhere in our daily life to fulfil our requirements. We can not
only increase the speed of life but also increase security with good ideas by making use of
advanced technology.
In our project we use high power LEDs as head light for the vehicles, LDR sensor for light
intensity detection and two robot vehicles.
To detect the presence of another vehicle, and the intensity of the head light we have used
LDR sensor, high power LEDs as a source of head light. LDR is a special type of resistance
whose value depends on the brightness of the light, which is falling on it. It has resistance of
about 1 mega ohm when in total darkness, but a resistance of only about 5k ohms when
brightness illuminated. It responds to a large part of light spectrum.
The controlling device of the whole system for the vehicle is a Microcontroller to which LDR
sensor module, High power LED. When two vehicles oppose each other, the intensity of head
lights falls on the LDR sensor and automatically the intensity will be reduced. This system
avoids accidents due to high intensity head lights of the vehicles.

7
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

INDEX

CONTENTS PAGE NO.


CHAPTER 1
INTRODUCTION
1.1 Need for the project 1
1.2 Objective 1
CHAPTER 2
EMBEDDED SYSTEMS
2.1 Introduction to embedded systems 2
2.1.1 History 3
2.1.2 Tools 4
2.1.3 Resources 5
2.1.4 Real time issues 5
2.2 Need for embedded systems 5
2.2.1 debugging 6
2.2.2 Reliability 7
2.3 Explanation of embedded systems 8
2.3.1 software architecture 8
2.3.2 stand alone embedded systems 10
2.3.3 Real time embedded systems 11
2.3.4 Network communication embedded systems 11
2.3.5 Different types of processing units 12
2.4 Applications of embedded systems 13
2.4.1 consumer applications 13
2.4.2 Office automation 13
2.4.3 industrial automation 13
2.4.5 computer networking 14
2.4.6 Telecommunications 15
CHAPTER 3
HARDWARE DESCRIPTION
3.1 Introduction 16

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

2 Network communication embedded system 24

3 Automatic cofee maker 25

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

13 Pin details of dimmer module 35

14 Waveforms for dimmer module 36

15 LDR 39

16 Transformer 40

17 Electronic components behind pcb of piezo buzzer 43

18 Piezo ceramic elementric structure 43

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

21 schematic diagram of automatic headlight intensity 46

22 Picture of opening of new project 47

23 Picture of selecting a device for target 1 48

24 picture of selecting target 1 source group 49

25 Picture of giving frequency 50

26 Picture of selecting commands 50

27 Picture of adding source group 1 51

28 Picture to create hex file 52

29 Picture showing zero errors 52

30 Automatic headlight intensity control in vehicles 54

to avoid night time accidents

12
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

LIST OF TABLES

S.NO TABLE NAME PAGE


NO.

1. Inputs and outputs of dimmer module 37


2. Snubber and without snubber 38

13
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

CHAPTER 1: INTRODUCTION

1.1 NEED FOR THE PROJECT:

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

CHAPTER 2: EMBEDDED SYSTEMS

2.1 Introduction to Embedded Systems:

An Embedded system is a computer system designed to perform one or a few dedicated


functions often with real-time computing constraints. It is embedded as part of a complete
device often including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to meet a wide
range of end-user needs. Embedded systems control many devices in common use today.

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

In general, "Embedded system" is not a strictly definable term, as most systems


have some element of extensibility or programmability. For example, handheld computers
share some elements with embedded systems such as the operating systems and
microprocessors which power them, but they allow different applications to be loaded and
peripherals to be connected. Moreover, even systems which don't expose programmability as
a primary feature generally need to support software updates. On a continuum from "general
purpose" to "Embedded", large application systems will have subcomponents at most points
even if the system as a whole is "designed to perform one or a few dedicated functions", and
15
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

is thus appropriate to call "Embedded". A modern example of embedded system is shown in


fig:2.1.

Fig 2.1: A Modern example of Embedded system

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:

In the earliest years of computers in the 1930–40s, computers were sometimes


dedicated to a single task, but were far too large and expensive for most kinds of tasks
performed by embedded computers of today. Over time however, the concept
of programmable controllers evolved from traditional electromechanical sequencers, via solid
state devices, to the use of computer technology.

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.

2.1.4 Real Time Issues:

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.

2.2 Need for Embedded Systems:

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:

Embedded debugging may be performed at different levels, depending on the facilities


available. From simplest to most Sophisticate they can be roughly grouped into the following
areas:

 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

2.3 Explanation of Embedded Systems:


2.3.1 Software Architecture:

There are several different types of software architecture in common use.

 Simple Control Loop:

In this design, the software simply has a loop. The loop calls subroutines, each of
which manages a part of the hardware or software.

 Interrupt Controlled System:

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.

Because of these complexities, it is common for organizations to buy a real-time operating


system, allowing the application programmers to concentrate on device functionality rather
than operating system services, at least for large systems; smaller systems often cannot afford
the overhead associated with a generic real time system, due to limitations regarding memory
size, performance, and/or battery life.

 Microkernels and Exokernels :

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:

2.3.2 Stand Alone Embedded System:

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

Ex: microwave oven, air conditioner etc..

2.3.3 Real-time 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.

 Hard 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.

 Soft Real Time embedded systems:

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.

2.3.4 Network communication embedded systems:

A wide range network interfacing communication is provided by using 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

Fig 2.2: Network Communication Embedded Systems

2.3.5 Different types of Processing units:

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

2.4 APPLICATIONS OF EMBEDDED SYSTEMS:


2.4.1 Consumer applications:
At home we use a number of embedded systems which include microwave oven ,
remote control, VCD players, DVD players, camera etc….

Fig 2.3: Automatic Coffee maker

2.4.2 Office automation:


Systems like fax machine, modem, printer etc come under embedded system applications

25
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

Fig 2.4: Fax Machine Fig 2.5: Printing Machine

2.4.3. Industrial automation:


Today a lot of industries are using embedded systems for process control. In
industries we design the embedded systems to perform a specific operation like monitoring
temperature, pressure, humidity ,voltage, current etc.., and basing on these monitored levels
we do control other devices, we can send information to a centralized monitoring station.

Fig 2.6: Robot


In critical industries where human presence is avoided there we can use robots which are
programmed to do a specific operation.

2.4.5 Computer Networking:

Embedded systems are used as bridges routers etc..

26
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

Fig 2.7: Computer Networking

2.4.6 Tele Communications:


Cell phones, web cameras etc.

Fig 2.8: Cell Phone Fig 2.9: Web Camera

27
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

CHAPTER 3 : HARDWARE DESCRIPTION

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

Fig 3.1 BLOCK DIAGRAM OF AUTOMATIC HEAD LIGHT INTENSITY

3.2 Micro controller

Fig 3.2 Micro controller

3.2.1 Introduction to Micro controller

Circumstances that we find ourselves in today in the field of microcontrollers had


their beginnings in the development of technology of integrated circuits. This development
has made it possible to store hundreds of thousands of transistors into one chip. That was a
prerequisite for production of microprocessors, and the first computers were made by adding

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.

Microprocessors and Microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition to a
fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed
amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them
ideal for many applications in which cost and space are critical.

The microcontroller used in this project is PIC16F877A. The PIC families of


microcontrollers are developed by Microchip Technology Inc. Currently they are some of the
most popular microcontrollers, selling over 120 million devices each year. There are basically
four families of PIC microcontrollers:

PIC12CXXX 12/14-bit program word

PIC 16C5X 12-bit program word

PIC16CXXX and PIC16FXXX 14-bit program word

PIC17CXXX and PIC18CXXX 16-bit program word

The features, pin description of the microcontroller used are discussed in the following
section

3.2.2 Description:

Introduction to PIC Microcontrollers:

PIC stands for Peripheral Interface Controller given by Microchip Technology


to identify its single-chip microcontrollers. These devices have been very successful in 8-bit
microcontrollers. The main reason is that Microchip Technology has continuously upgraded
the device architecture and added needed peripherals to the microcontroller to suit customers'
requirements. The development tools such as assembler and simulator are freely available on
the internet at www.microchip.com

29
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

Low - end PIC Architectures:

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:

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

Program memory type is indicated by an alphabet.

C = EPROM, F = Flash, RC = Mask ROM

Popularity of the PIC microcontrollers is due to the following factors.

 Speed: Harvard Architecture, RISC architecture, 1 instruction cycle = 4 clock cycles.


 Instruction set simplicity: The instruction set consists of just 35 instructions (as
opposed to 111 instructions for 8051).
 Power-on-reset and brown-out reset. Brown-out-reset means when the power supply
goes below a specified voltage (say 4V), it causes PIC to reset; hence malfunction is
avoided. A watch dog timer (user programmable) resets the processor if the
software/program ever malfunctions and deviates  from its normal operation.

30
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

 PIC microcontroller has four optional clock sources.

 Low power crystal


 Midrange crystal
 High range crystal
 RC oscillator (low cost).
 Programmable timers and on-chip ADC.
 Up to 12 independent interrupt sources.
 Powerful output pin control (25 mA (max.) current sourcing capability per
pin.)
 EPROM/OTP/ROM/Flash memory option.

3.3.1 8051 Microcontroller:

Fig 3.3 pin diagram


8051 microcontroller  is a 40 pin Dual Inline Package
(DIP). These 40 pins serve different functions like
read, write, I/O operations, interrupts etc. 8051 has four I/O ports wherein each port has 8
pins which can be configured as input or output depending upon the logic state of the pins.
Therefore, 32 out of these 40 pins are dedicated to I/O ports. The rest of the pins are
dedicated to VCC, GND, XTAL1, XTAL2, RST, ALE, EA’ and PSEN’.
 Pin 1 to Pin 8 (Port 1) –
Pin 1 to Pin 8 are assigned to Port 1 for simple I/O operations. They can be
configured as input or output pins depending on the logic control i.e. if logic zero
(0) is applied to the I/O port it will act as an output pin and if logic one (1) is

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).

 Pin 10 to Pin 17 (Port 3) –


Pin 10 to pin 17 are port 3 pins which are also referred to as P3.0 to P3.7. These pins
are similar to port 1 and can be used as universal input or output pins. These pins are
bidirectional pins.
These pins also have some additional functions which are as follows:
 P3.0 (RXD) :
10th pin is RXD (serial data receive pin) which is for serial input. Through this
input signal microcontroller receives data for serial communication.

 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.2 and P3.3 (INT0′, INT1′ ) :


12th and 13th pins are for External Hardware Interrupt 0 and Interrupt 1
respectively. When this interrupt is activated(i.e. when it is low), 8051 gets
interrupted in whatever it is doing and jumps to the vector value of the interrupt
(0003H for INT0 and 0013H for INT1) and starts performing Interrupt Service
Routine (ISR) from that vector location.

 P3.4 and P3.5 (T0 and T1) :


14th and 15th pin are for Timer 0 and Timer 1 external input. They can be
connected with 16 bit timer/counter.

 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.

 Pin 18 and Pin 19 (XTAL2 And XTAL1) –


These pins are connected to an external oscillator which is generally a quartz crystal
oscillator. They are used to provide an external clock frequency of 4MHz to
30MHz.

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 21 to Pin 28 (Port 2) –


Pin 21 to pin 28 are port 2 pins also referred to as P2.0 to P2.7. When additional
external memory is interfaced with the 8051 microcontroller, pins of port 2 act as
higher-order address bytes. These pins are bidirectional.

 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 30 (ALE/ PROG) –


ALE stands for Address Latch Enable. It is input, active-high pin. This pin is used to
distinguish between memory chips when multiple memory chips are used. It is also
used to de-multiplex the multiplexed address and data signals available at port 0.
During flash programming i.e. Programming of EPROM, this pin acts as program pulse.

 Pin 31 (EA/ VPP) –


EA stands for External Access input. It is used to enable/disable external memory
interfacing. In 8051, EA is connected to Vcc as it comes with on-chip ROM to store
programs. For other family members such as 8031 and 8032 in which there is no on-
chip ROM, the EA pin is connected to the GND.

 Pin 32 to Pin 39 (Port 0) –


Pin 32 to pin 39 are port 0 pins also referred to as P0.0 to P0.7. They are
bidirectional input/output pins. They don’t have any internal pull-ups. Hence, 10 K?
pull-up registers are used as external pull-ups. Port 0 is also designated as AD0-
AD7 because 8051 multiplexes address and data through port 0 to save pins.

 Pin 40 (VCC) –
This pin provides power supply voltage i.e. +5 Volts to the circuit.

3.4.1Digital dimmer module

33
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

Fig 3.4.1 dimmer module

 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:

 ON/OFF and dimming control


 Auto zero cross detection
 Operating voltage 12v /24vDC
 Isollated power section from the input
 0-100% dimming
 Control upto 250v

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

 PID temperature control system


 PID AC single phase speed control system

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:

 Unlike electromechanical relays, there are no moving parts.


 Complete electrical isolation between input and output contacts.
 No contact bounces issues.
 AC loads can be easily controlled with a low current DC voltage using a
solid state relay providing long life and high switching speeds.
 Zero voltage turn-on and zero current turn-off eliminating electrical noise
and transient.
 Ability to switch OFF AC loads at the point of zero load current, thereby
eliminating the arcing, electrical noise and contact bounce.

3.4.6 Pin details:

NAME DETAILS

GND Power supply Groun


d
+5V Power Supply
D0 Data 0
D1 Data 1
D2 Data 2
D3 Data 3

Fig 3.4.6 pin 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%

TABLE 1: Inputs and outputs of dimmer module

38
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

3.4.10 Digital Dimmer with Snubber and without Snubber circuit

Image

Order Code RDL/LDC/13/001/V1.0 RDL/LDC/13/001/V1.0-A

Snubber Circuit Enabled Disabled

Application Suitable for Inductive Load Suitable for LED ON/OFF and phase
dimming

TABLE 2: snubber and without snubber

3.5 LDR

A light dependent resistor, alternatively called LDR, photoresistor,photoconductor,


or photocell, is a variable resistor whose value decreases with increasing incident light
intensity.
An LDR is made of a high-resistance semiconductor. If light falling on the device is of high
enough frequency, photons absorbed by the semiconductor give bound electrons enough
energy to jump into the conduction band. The resulting free electron (and its hole partner)
conduct electricity, thereby lowering resistance.

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.

Two cadmium sulphide(cds) photoconductive cells with spectral responses similar to


that of the human eye. The cell resistance falls with increasing light intensity. Applications
include smoke detection, automatic lighting control, batch counting and burglar alarm
systems.

Fig:5.1 LDR

3.5.1 Features:

 Wide spectral response


 Low cost
 Wide ambient temperature range.
 Photoconductive cells are used in many different types of circuits and
applications.

3.5.2 Analog Applications:

 Camera Exposure Control

40
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

 Auto Slide Focus - dual cell


 Photocopy Machines - density of toner
 Colorimetric Test Equipment
 Densitometer
 Electronic Scales - dual cell
 Automatic Gain Control – modulated light source

3.5.3 Digital Applications:

 Automatic Headlight Dimmer


 Night Light Control
 Oil Burner Flame Out
 Street Light Control
 Absence / Presence (beam breaker)
 Position Sensor

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.

Fig 3.6 transformer

3.7 Turns Ratio:

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.1 Power ratio:


Because the transformer is a passive component, (it has no external power supply) it
cannot produce more power out from its secondary than is applied to its primary. Therefore if
the secondary voltage is greater than the primary voltage by a particular amount, the
secondary current will be smaller than the primary current by a similar amount, i.e. If the
voltage is doubled the current will be halved.

3.7.2 Transformation Ratio:


Basic Transformer operation can be described by two formulae relating the
transformation ratio to the turns ratio of the transformer windings.
• VP = the primary voltage.
• IP = the primary current.
• VS = the secondary voltage.
• IS = the secondary current.
• NP = the number of turns in the primary winding.
• NS = the number of t

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.

3. Eddy Current losses.


Because the iron or steel core is an electrical conductor as well as a magnetic circuit,
the changing current in the primary will tend to set up an EMF within the core as well as in
the secondary winding. The currents induced into the core will oppose the changes of
magnetic field taking place in the core. For this reason these eddy currents must be
kept as small as possible. This is achieved by dividing the metal core into thin sheets
or "laminations", each one insulated from the others by an insulating coat of lacquer
or oxide. Laminated cores greatly reduce the formation of eddy currents without
affecting the magnetic properties of the core.
In high frequency transformers eddy current losses are reduced by using a core made
of a ceramic material containing a large proportion of tiny metal particles, iron dust or
manganese zinc. The ceramic insulates the metal particles from each other, giving a
similar effect to laminations, and performing better at high frequencies.
Due to the ways of reducing losses described above, practical transformers closely
approach the ideal in performance. In large power transformers, efficiencies of about
98% can be achieved. Therefore for most practical calculations, it can be assumed that
a transformer is "Ideal" unless its losses are specified. The actual secondary voltages
in a practical transformer will be only slightly less than those calculated using the
theoretical transformation ratio.
Off Load Current. Because the action of a transformer is nearly perfect, the power in
both primary and secondary windings is the same, so when no load is put on the
secondary, no secondary current flows and the power in the secondary is zero (V x I =
0). Therefore, although a voltage is applied to the primary no current will flow, as the
power in the primary must also be zero. In practical transformers the "Off Load
Current" in the primary is actually very low.

3.8 PIEZO BUZZER


The piezo buzzer produces sound based on reverse of the piezoelectric effect. The
generation of pressure variation or strain by the application of electric potential across a
piezoelectric material is the underlying principle. These buzzers can be used alert a user of an
event corresponding to a switching action, counter signal or sensor input. They are also used
in alarm circuits.

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.

3.8.1 Electronic Components

Fig 3. 8 Electronic components Behind PCB of Piezo Buzzer

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

3.8.2 Piezoceramic Element Structure

Fig 3.8 piezoceramic elementric structure

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.

3.8.3 Working Principle of Piezo Buzzers

Fig 3.8 piezo buzzers

When an alternating voltage is applied to


the piezoceramic element, the element
extends and shrinks diametrically. This
characteristic of piezoelectric material is utilized to make the ceramic plate vibrate rapidly to
generate sound waves.

45
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

3.8.4 Piezo Buzzer Structure

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.

3.8.5 Piezo Buzzer Characteristics


 Wide operating voltage: 3~250 V

 Lower current consumption: less than 30 mA higher rated frequency

 Larger footprint

 Higher sound pressure level

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.

Fig 3.9 LM7805 PINOUT DIAGRAM


3.9.1 FEATURES:
The Features of 7805 Regulator are
 3-Terminal Regulators
 Output Current up to 1.5 A
 Internal Thermal-Overload Protection

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

3.10 SCHEMATIC DIAGRAM :

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

FIG 9.1 Schematic diagram

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

CHAPTER 4 SOFTWARE DESCRIPTION


4.1 Steps to use Keil 

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.

 For any new project, click on Project>> New µVision Project.

Fig4.1 picture of opening a new project

 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.

Fig 4.2 picture of selecting a device for target 1

 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.

Fig 4.3 picture of selecting target 1 source group

51
TKREC Electronics and Communication Engineering
AUTOMATIC HEADLIGHT INTENSITY CONTROL IN VEHICLES TO AVOID
NIGHT TIME ACCIDENTS

 To configure option value of our microcontroller project. Select the Target 1, click on


Project>>Option for target ‘target 1’”.
 Select Target tab to configure microcontroller.Change the crystal value from 4MHz
to 33MHz and go to output tab.

Fig 4.4 picture of giving frequency

 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

program) in file name.

Fig 4.5 picture of selecting commands

 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

Fig 4.6 picture of adding source group 1

 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

Fig 4.7 picture to create hex file

Fig 4.8 picture showing zero errors


 Now the hex file is created in the specified folder with “.hex” extension. We can burn
it in microcontroller through Fly pro software and burner circuit.

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.

5.3 Future scope:


The use to headlights on automobiles has involved a compromise between providing enough
light for drivers to see the road ahead and avoiding the excessive light that produces glare.
This system eliminates human error from the scenario, which in turn allows the driver to
focus on safely navigating the road instead of manually adjusting headlight settings.
Technology has brought changes to headlight, interior surfaces, and the highway environment
that directly reduce glare or indirectly reduce the effect of glare on the driver. In future the
concept of this project will be used in auto vehicles and no doubt it will be of great and
universally adopted.

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

You might also like