Main Iot Based Project
Main Iot Based Project
BACHELOR OF TECHNOLOGY
in
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted by
D.Kushalove - 229P1A0440
S.Ashok - 229P1A0405
B.Raghavendra - 239P5A0404
CERTIFICATE
This is to certify that the project report entitled. IoT-Based Highway Lights Control
Based on Density that is being submitted by
G.Sravan Kumar - 229P1A0436
D.Kushalove - 229P1A0440
S.Ashok - 229P1A0405
B.Raghavendra - 239P5A0404
External Examiner
ACKNOWLEDGEMENT
We would like to thank Chairman sir G. Panduranga Reddy Garu and Vice chairmen sir
G. N. Vibhav Reddy Garu for providing all the facilities to complete our project with in
time.
We would like to express our deep sense of gratitude to our principal Dr. M Senthil
Kumar Garu, Sree Dattha Group of Institutions, for his continuous effort in creating a
competitive environment in our college and encouraging through this course .
Working and writing our thesis in exchange at Sree Dattha Group of Institutions, was a great
opportunity and we would like to thank from the bottom of our heart Dr. P Rama
Koteswara Rao, HOD, Department of Electronics and Communication
Engineering for providing it to us. There was never such a resourceful and enriching time in
our life.
D.Kushalove 229P1A0440
S.Ashok 229P1A0405
B.Raghavendra 239P5A0404
SREE DATTHA GROUP OF INSTITUTIONS
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
DECLARATION
This is to certify that the work reported in the present project . IoT-Based Highway
Lights Control Based on Density is a record work done by us in the Department of
Electronics and Communication Engineering, Sree Dattha Group of Institutions.
D.Kushalove 229P1A0440
S.Ashok 229P1A0405
239P5A0404
B.Raghavendra
ABSTRACT i
LIST OF TABLES ii
LIST OF FIGURES iii
LIST OF ABBREVIATIONS iv
1.INTRODUCTION
1.1 Introduction 1
2.1.2 Features 12
2.1.3 Architectural overview 14
2.1.5 Memories 20
2.2.3 Rectifier 22
2.2.5 Regulator 25
4. SOURCE CODE
5. SOFTWARE DEVELOPMENT
5.1 INTRODUCTION 51
6. ANALYSIS
BIBILOGRAPHY 53
REFERENCES 54
ABSTRACT
White Light Emitting Diodes (LED) replaces HID lamps in street lighting system to include
dimming feature. An Arduino board is used to control the intensity by developing pulse
width modulated signals that drives a MOSFET to switch the LEDs according to achieve
desired operation. In the present system, mostly the lightning up of highways is done
through High Intensity Discharge lamps (HID), whose energy consumption is high.
Its intensity cannot be controlled according to the requirement so there is a need to switch
on to an alternative method of lightning system i.e., by using LEDs. This system is build to
overcome the present day drawbacks of HID lamps. This system demonstrates the usage of
the LED’s (light emitting diodes) as the light source and its variable intensity control,
according to the requirement.
LED’s consume less power and its life time is more, as compared to the conventional HID
lamps. The more important and interesting feature is its intensity can be controlled
according to the requirement during non peak hours which is not feasible in HID lamps. A
cluster of LEDs are used to form a street light. The Arduino board contains programmable
instructions which controls the intensity of lights based on the PWM (Pulse width
modulation) signals generated.
The intensity of lights are kept high during the peak hours, as the traffic on the roads tend
to decrease slowly in the late nights, the intensity also decreases progressively till morning.
Final it completely shuts down at morning 6, and again resumes at 6pm in the evening. The
process is repeated. This concept in future can be enhanced by integrating it with the solar
panel, which converts the solar intensity into corresponding voltage, and this energy is used
to feed up the highway lights. This project deals with “Development of an embedded system
for automatic street light controlling while vehicle passing” using micro controller
AT89S52 and IR transmitter and receiver are used for informing vehicle passing on road
and corresponding front lights are glowing ,while vehicle passed away back street lights are
off.LDR is used for light intensity if light intensity is low when the vehicles passing on the
road corresponding light will be ON. If light intensity is high all lights are off.
i
List of Tables
2.1.2 Features 12
ii
List of Figures
Figure no. Figure Name Page no.
2.2.2 Transformer 23
2.2.3 Rectifier
3.Bridge rectifier 23
2.2.4 Waveforms 23
iii
List of Abbreviations
ICSP In-circuit Serial programming
iv
CHAPTER 1
This is in direct contrast to the personal computer in the family room. It too is
comprised of computer hardware and software and mechanical components (disk drives, for
example). However, a personal computer is not designed to perform a specific function rather;
it is able to do many different things. Many people use the term general-purpose computer to
make this distinction clear. As shipped, a general-purpose computer is a blank slate; the
manufacturer does not know what the customer will do wish it. One customer may use it for
a network file server another may use it exclusively for playing games, and a third may use it
to write the next great American novel.
1
If an embedded system is designed well, the existence of the processor and software
could be completely unnoticed by the user of the device. Such is the case for a microwave
oven, VCR, or alarm clock. In some cases, it would even be possible to build an equivalent
device that does not contain the processor and software. This could be done by replacing the
combination with a custom integrated circuit that performs the same functions in hardware.
However, a lot of flexibility is lost when a design is hard-cooled in this way. It is mush easier,
and cheaper, to change a few lines of software than to redesign a piece of custom hardware.
The issue of what if a deadline is missed is a crucial one. For example, if the
real-time system is part of an airplane's flight control system, it is possible for the lives of the
passengers and crew to be endangered by a single missed deadline. However, if instead the
system is involved in satellite communication, the damage could be limited to a single corrupt
data packet. The more severe the consequences, the more likely it will be said that the deadline
is "hard" and thus, the system is a hard real-time system. Real-time systems at the other end
of this discussion are said to have "soft" deadlines.
All of the topics and examples presented in this book are applicable to the
designers of real-time system who is more delight in his work. He must guarantee reliable
operation of the software and hardware under all the possible conditions and to the degree
that human lives depend upon three system's proper execution, engineering calculations and
descriptive paperwork.
2
Application Areas:
Consumer appliances:
Office automation:
The office automation products using em embedded systems are copying machine,
fax machine, key telephone, modem, printer, scanner etc.
Industrial automation:
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific tasks
such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take
appropriate action based on the monitored levels to control other devices or to send
information to a centralized monitoring station. In hazardous industrial environment, where
human presence has to be avoided, robots are used, which are programmed to do specific jobs.
The robots are now becoming very powerful and carry out many interesting and complicated
tasks such as hardware assembly.
3
Medical electronics:
Computer networking:
Telecommunications:
Wireless technologies:
Security:
Security of persons and information has always been a major issue. We need
to protect our homes and offices; and also the information we transmit and store.
Developing embedded systems for security applications is one of the most lucrative
businesses nowadays. Security devices at homes, offices, airports etc. for authentication and
verification are embedded systems. Encryption devices are nearly 99 per cent of the
processors that are manufactured end up in~ embedded systems. Embedded systems find
applications in . every industrial segment- consumer electronics, transportation, avionics,
biomedical engineering, manufacturing, process control and industrial
automation, data communication, telecommunication, defense, security etc. Used
to encrypt the data/voice being transmitted on communication links such as telephone lines.
Biometric systems using fingerprint and face recognition are now being extensively used for
user authentication in banking applications as well as for access control in high security
buildings.
Finance:
Financial dealing through cash and cheques are now slowly paving way for
transactions using smart cards and ATM (Automatic Teller Machine, also expanded as Any
Time Money) machines. Smart card, of the size of a credit card, has a small micro-controller
and memory; and it interacts with the smart card reader! ATM machine and acts as an
electronic wallet. Smart card technology has the capability of ushering in a cashless society.
Well, the list goes on. It is no exaggeration to say that eyes wherever you go, you can see, or
at least feel, the work of an embedded system!
Like all good things, this powerful component is basically very simple. It is made by mixing
tested and high- quality "ingredients" (components) as per following receipt:
5
1. The simplest computer processor is used as the "brain" of the future system.
2. Depending on the taste of the manufacturer, a bit of memory, a few A/D converters,
timers, input/output lines etc. are added
3. All that is placed in some of the standard packages.
4. A simple software able to control it all and which everyone can easily learn about has
been developed.
On the basis of these rules, numerous types of microcontrollers were designed and they
quickly became man's invisible companion. Their incredible simplicity and flexibility
conquered us a long time ago and if you try to invent something about them, you should know
that you are probably late, someone before you has either done it or at least has tried to do it.
The following things have had a crucial influence on development and success of the
microcontrollers:
So, if you are infected with a virus called electronics, there is nothing left for you to do but to
learn how to use and control its power.
Even though there is a large number of different types of microcontrollers and even more
programs created for their use only, all of them have many things in common. Thus, if you
learn to handle one of them you will be able to handle them all. A typical scenario on the basis
of which it all functions is as follows:
6
1. Power supply is turned off and everything is still…the program is loaded into the
microcontroller, nothing indicates what is about to come…
2. Power supply is turned on and everything starts to happen at high speed! The control
logic unit keeps everything under control. It disables all other circuits except quartz
crystal to operate. While the preparations are in progress, the first milliseconds go by.
3. Power supply voltage reaches its maximum and oscillator frequency becomes stable.
SFRs are being filled with bits reflecting the state of all circuits within the
microcontroller. All pins are configured as inputs. The overall electronis starts
operation in rhythm with pulse sequence. From now on the time is measured in micro
and nanoseconds.
4. Program Counter is set to zero. Instruction from that address is sent to instruction
decoder which recognizes it, after which it is executed with immediate effect.
5. The value of the Program Counter is incremented by 1 and the whole process is
repeated...several million times per second.
7
As you can see, all the operations within the microcontroller are performed at high speed and
quite simply, but the microcontroller itself would not be so useful if there are not special
circuits which make it complete. In continuation, we are going to call your attention to them.
Read Only Memory (ROM) is a type of memory used to permanently save the program being
executed. The size of the program that can be written depends on the size of this memory.
ROM can be built in the microcontroller or added as an external chip, which depends on the
type of the microcontroller. Both options have some disadvantages. If ROM is added as an
external chip, the microcontroller is cheaper and the program can be considerably longer. At
the same time, a number of available pins is reduced as the microcontroller uses its own
input/output ports for connection to the chip. The internal ROM is usually smaller and more
expensive, but leaves more pins available for connecting to peripheral environment. The size
of ROM ranges from 512B to 64KB.
Random Access Memory (RAM) is a type of memory used for temporary storing
data and intermediate results created and used during the operation of the microcontrollers.
The content of this memory is cleared once the power supply is off. For example, if the
program performes an addition, it is necessary to have a register standing for what in everyday
life is called the “sum” . For that purpose, one of the registers in RAM is called the "sum" and
used for storing results of addition. The size of RAM goes up to a few KBs.
The EEPROM is a special type of memory not contained in all microcontrollers. Its contents
may be changed during program execution (similar to RAM ), but remains permanently saved
even after the loss of power (similar to ROM). It is often used to store values, created and
used during operation (such as calibration values, codes, values to count up to etc.), which
must be saved after turning the power supply off. A disadvantage of this memory is that the
process of programming is relatively slow. It is measured in miliseconds.
8
Special Function Registers (SFR)
Special function registers are part of RAM memory. Their purpose is predefined by the
manufacturer and cannot be changed therefore. Since their bits are physically connected to
particular circuits within the microcontroller, such as A/D converter, serial communication
module etc., any change of their state directly affects the operation of the microcontroller or
some of the circuits. For example, writing zero or one to the SFR controlling an input/output
port causes the appropriate port pin to be configured as input or output. In other words, each
bit of this register controls the function of one single pin.
Program Counter
Program Counter is an engine running the program and points to the memory
address containing the next instruction to execute. After each instruction execution, the value
of the counter is incremented by 1. For this reason, the program executes only one instruction
at a time just as it is written. However…the value of the program counter can be changed at
any moment, which causes a “jump” to a new memory location. This is how subroutines and
branch instructions are executed. After jumping, the counter resumes even and monotonous
automatic counting +1, +1, +1…
BLOCK DIAGRAM
9
Hardware Requirements
• ARDUINO UNO
• POWER SUPPLAY
• LEDS
• LDR
• IR TAX AND RX
• IOT MODULE
10
CHAPTER 2
DESCRIPTION OF HARDWARE COMPONENTS
2.1 ATmega328p:
2.1.1.INTRODUCTION:
"Uno" means one in Italian and was chosen to mark the release of Arduino Software
(IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference
versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of
USB Arduino boards, and the reference model for the Arduino platform; for an extensive list
of current, past or outdated boards see the Arduino index of boards.
2.1.2 Features:
Microcontroller ATmega328P
Operating Voltage 5V
32 KB (ATmega328P)
Flash Memory
of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
68.6
53.4
25 g
12
Programming
The Arduino/Genuino Uno can be programmed with the (Arduino Software (IDE)). Select
"Arduino/Genuino Uno from the Tools > Board menu (according to the microcontroller on
your board). For details, see the reference and tutorials.
The ATmega328 on the Arduino/Genuino Uno comes preprogrammed with a bootloader that
allows you to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP
(InCircuit Serial Programming) header using Arduino ISP or similar; see these instructions
for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available in
the Arduino repository. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can
be activated by:
• On Rev1 boards: connecting the solder jumper on the back of the board (near the map
of Italy) and then rese ing the 8U2.
• On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.
13
2.1.3 Internal block diagram:
14
2.1.4 PIN DIAGRAM OF ATMEGA328P:
2.1.4.2 Clock
Some sort of clock signal must be provided in order for the microcontroller to operate. On the
ATmega328P the clock can come from one of three di_erent sources. The selection of the
clock source is done by program ming fuse bits in the chip. A TTL-compatible clock signal
can be generated externally by other logic and connected to the XTAL1 input (pin 9.) This
15
probably the easiest way to generate the clock for the EE 459 projects. The lab has a supply
of DIP oscillators in some of the more common frequencies. These output a TTL level square
wave that can be fed directly into the microcontroller and to other chips. Alternatively, the
processor can generate a clock if a crystal is connected to the XTAL1 and XTAL2 inputs.
This method uses a plain crystal, not the DIP crystal oscillators as described above. The third
method uses an internal oscillator that runs at approximately 8MHz. This is probably the least
accurate way to generate a clock. Do not use this method if your project requires a clock
running close to a specified frequency. The advantage of using the internal clock is that you
do not need to provide any external signal and other functions are now available on pin 9. For
example it can now be used as Port B bit 6 (PB6) thus giving the microcontroller 22 I/O pins.
In applications where the UART0 serial communications interface is being used, the choice
of clock frequency determines the baud rates that can be used for transmitting and receiving
serial data. The accuracy of the frequency of the baud rate depends on the clock frequency
used for the microcontroller. If a high degree of accuracy is required, an external oscillator of
the correct frequency will be needed..
2.1.4.3 Reset
The reset input (RESET, pin 1) must be in the high state for the processor to operate
normally. This pin has an internal pull-up and does not have to be externally pulled-up to
VCC in order for the processor to operate normally.
16
an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA
is the value that must not be exceeded on any I/O pin to avoid permanent damage to the
microcontroller.
Port B (PB)
Port B on the ATmega328P has seven usable pins (PB0 through PB5 and PB7). A eighth bit,
PB6, shares a pin with the XTAL1 input. If the chip is configured for an external clock, this
pin is not available for I/O. Three of the pins (PB3, PB4 and PB5) are use for the SPI interface
for programming the Flash memory. These pins should not be used as inputs connected to
sources that will continue to drive signals at the 328P while in the reset state. 2.2.2 Port C
(PC)
Port C on the 328P has six pins (PC0 through PC5). A seventh bit, PC6, shares a pin with the
RESET input. By changing the configuration fuse settings this bit can be use for I/O. Most of
the pins in PC are shared with the analog-to-digital converter so if the ADC function is used
one or more pins will not be available for general purpose I/O. In addition, PC4 and PC5 are
use for the I2C interface and will not be available for general I/O if I2C is used
Port D (PD)
Port D on the 328P has eight pins (PD0 through PD7). Two of the pins, PD0 and PD1, are
shared with the serial communications interface and can not be used as I/O if the USART0
functions are used.
2.1.4.6 Timer/Counters
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though
is it possible to change the upper end of their range using the AREF pin and the anal og
Reference() function. There are a couple of other pins on the board:
• AREF. Reference voltage for the analog inputs. Used with analog Reference().
• Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
Communication
Arduino/Genuino Uno has a number of facilities for communicating with a computer, another
Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL
(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The 16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a .inf file is required.
The Arduino Software (IDE) includes a serial monitor which allows simple textual data to be
sent to and from the board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
A Software Serial library allows serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino Software
(IDE) includes a Wire library to simplify use of the I2C bus; see the documentation for details.
For SPI communication, use the SPI library.
This setup has other implications. When the Uno is connected to either a computer running
Mac OS X or Linux, it resets each time a connection is made to it from software (via USB).
For the following half-second or so, the bootloader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after opening the connection
and before sending this data.
The Uno board contains a trace that can be cut to disable the auto-reset. The pads on either
side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may
also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset
line; for details.
Revisions
Revision 3 of the board has the following new features:
• 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible with both the board that
uses the AVR, which operates with 5V and with the Arduino Due that operates with 3.3V.
The second one is a not connected pin, that is reserved for future purposes.
• Stronger RESET circuit.
• Atmega 16U2 replace the 8U2.
2.1.5 Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
20
2.2 Power Supply
2.2.1 INTRODUCTION
There are many types of power supply. Most are designed to convert high voltage
AC mains electricity to a suitable low voltage supply for electronics circuits and other
devices. A power supply can by broken down into a series of blocks, each of which
performs a particular function. For example a 5V regulated supply can be shown as below
2.2.2 Transformer:
A transformer steps down high voltage AC mains to low voltage AC. Here we
are using a center-tap transformer whose output will be sinusoidal with 36volts peak
to peak value.
21
Fig: 2.3.1 Output Waveform of transformer
The low voltage AC output is suitable for lamps, heaters and special AC
motors. It is not suitable for electronic circuits unless they include a rectifier and a
smoothing capacitor. The transformer output is given to the rectifier circuit.
2.2.3 Rectifier:
A rectifier converts AC to DC, but the DC output is varying. There are several
types of rectifiers; here we use a bridge rectifier.
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series
with the load resistance RL and hence the current flows through RL in the same
direction as in the previous half cycle. Thus a bi-directional wave is converted into
unidirectional.
22
Figure 3.3 Rectifier circuit
Now the output of the rectifier shown in Figure 3.3 is shown below in Figure 3.4
The varying DC output is suitable for lamps, heaters and standard motors. It
is not suitable for lamps, heaters and standard motors. It is not suitable for electronic
circuits unless they include a smoothing capacitor.
Smoothing:
The smoothing block smoothes the DC from varying greatly to a small ripple
and the ripple voltage is defined as the deviation of the load voltage from its DC value.
Smoothing is also named as filtering.
23
prolonging Ted, and the ripple is considerably decreased. The action of the capacitor
is shown with the help of waveform.
2.2.4 Regulator:
24
Many of the fixed voltage regulator ICs has 3 leads (input, output and high
impedance). They include a hole for attaching a heat sink if necessary. Zener diode is
an example of fixed regulator which is shown here.
Circuit diagram:
25
LDR
Working
A photo resistor or Light Dependent Resistor or CdS Cell is a resistor whose resistance
decreases with increasing incident light intensity. It can also be referred to as a
photoconductor. A photo resistor 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.
26
Applications:
An LDR can even be used in a simple remote control circuit using the backlight of a mobile
phone to turn on a device - call the mobile from anywhere in the world, it lights up the LDR, and
lighting can be turned on remotely!
There are two basic circuits using light dependent resistors - the first is activated by darkness,
the second is activated by light.
In the circuit diagram on the left, the led lights up whenever the LDR is in darkness. The 10K
variable resistor is used to fine-tune the level of darkness required before the LED lights up. The 10K
standard resistor can be changed as required to achieve the desired effect, although any replacement
must be at least 1K to protect the transistor from being damaged by excessive current.
By swapping the LDR over with the 10K and 10K variable resistors , the circuit will be
activated instead by light. Whenever sufficient light falls on the LDR (manually fine-tuned using the
10K variable resistor), the LED will light up.
27
The circuits shown above are not practically useful. In a real world circuit, the LED
(and resistor) between the positive voltage input (Vin) and the collector (C) of the transistor
would be replaced with the device to be powered.
Typically a relay is used - particularly when the low voltage light detecting circuit is used to switch
on (or off) a 240V mains powered device. A diagram of that part of the circuit is shown above. When
darkness falls (if the LDR circuit is configured that way around), the relay is triggered and the 240V
device - for example a security light - switches on.
The relationship between the resistance RL and light intensity Lux for a typical LDR
is
With the LDR connected to 5V through a 3.3K resistor, the output voltage of the LDR is
Vo = 5*RL / (RL+3.3)
28
Reworking the equation, we obtain the light intensity
IR LEDs
An electroluminescent IR LED is a product which requires care in use. IR LEDs are
fabricated from narrow band heterostructures with energy gap from 0.25 to 0.4 eV. That's why
the bias used to initiate current flow is low compared to the well known visible or NIR LEDs.
Typical forward bias is V~0.1- 1 V only for mid-IR LEDs!
29
Be sure not to exceed I*max which is given in each LED specification and do not use test
instrument that contain sources/batteries with voltage greater that Vcw max given in
specification. For LED current restriction and further LED current measurement we
recommend to use resistor (1-5 Ohms) connected in serial to LED. This is important to note
that un-grounded devices (e.g. computers) can give V=1-5 V that is enough to destroy the
LED!
It is highly desirable that the user has I-V meter for small currents (10-100 x10 -6 A). We
guarantee the existence of the LED output as long as V-I characteristic shows saturation in
the reverse bias (10-100 x10-6 A).
We recommend activating pulse generator prior connecting LED to generator. On switching
off the procedure is reversed: disconnect LED, switch off pulse generator. Long wires
connecting LED with pulse generator may be the reason for LED failure because of
unexpected voltage surges when switching on and off the LED supply.
Please test all elements and circuits before applying voltage to LED. Remember that ground
(T0-18 or another holder) should be biased positively (if not specially designed). Usually the
negative electrode is made shorter than the positive one.
The expected signal is not very big and it is important to test and eliminate noise in the detector
circuits.
In some cases it is possible to increase pulse duration. Imax in such cases can be estimated
using the following equation: Imax=I* max /20*SQRT(f*t), where f-is the frequency (Hz),
tis the pulse duration (s), I* max-is the maximum current (A) for t=5 us and f=500 Hz. The
equation gives an order of magnitude and may be used for t< 0.1 ms only. Pulses with t > 0.15
ms should be considered as adequate to CW operation and Imax and Vmax should be taken
close to CW operation parameters. Please, note that long pulses can increase heat dissipation
and the chip temperature. This effect decreases LED emission power and can be traced due
to the LED resistance decrease during each pulse. CW power often decreases with time due
to heatsink temperature increase.
Micro immersion LEDs are made with chalcogenide glass that have low melting temperature
(50-70oC). That’s why, please, avoid any heater source close to the LED. Even sunlight
concentrated onto the lens can melt glass the lens. That’s why we recommend vertical position
for the LEDs at the initial stage of the research work. We are working now to increase the
glass melting temperature or/and to strengthen its position and shape.
Be patient in adjusting the optical system. It is only experience that allows fast work.
30
Lifetime Tests
ESP8266 Features
32
The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and MCU (Micro Controller
Unit) capability produced by Shanghai-based Chinese manufacturer,
The chip first came to the attention of western makers in August 2014 with the ESP-01
module, made by a third-party manufacturer, AI-Thinker. This small module allows
microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections using
Hayes-style commands. However, at the time there was almost no English-language
documentation on the chip and the commands it accepted. The very low price and the fact that
there were very few external components on the module which suggests that it could
eventually be very inexpensive in volume, attracted many hackers to explore the module,
chip, and the software on it, as well as to translate the Chinese documentation.
The ESP8285 is an ESP8266 with 1 MB of built-in flash, allowing for single-chip devices
capable of connecting to Wi-Fi.
ESP-
2×9 FCC ID 2AC7Z- No PCB
Yes
WROOM- 18 0.1" 18 × 20 trace
DIL ESPWROOM02
02
In the table above (and the two tables which follow), "Active pins" include the GPIO and
ADC pins with which you can attach external devices to the ESP8266 MCU. The "Pitch" is
the space between pins on the ESP8266 module, which is important to know if you are going
to breadboard the device. The "Form factor" also describes the module packaging as "2 x 9
DIL", meaning two rows of 9 pins arranged "Dual In Line", like the pins of DIP ICs. Many
ESP-xx modules include a small on-board LED which can be programmed to blink and
thereby indicate activity. There are several antenna options for ESP-xx boards including a
trace antenna, an on-board ceramic antenna, and an external connector which allows you to
attach an external Wi-Fi antenna. Since Wi-Fi communications generates a lot of RFI (Radio
33
Frequency Interference), governmental bodies like the FCC like shielded electronics to
minimize interference with other devices. Some of the ESP-xx modules come housed within
a metal box with an FCC seal of approval stamped on it. First and second world markets will
likely demand FCC approval and shielded Wi-Fi devices.
AI-Thinker modules
ESP-01 module
These are the first series of modules made with the ESP8266 by the third-party manufacturer
AI-Thinker and remain the most widely available. They are collectively referred to as "ESPxx
modules". To form a workable development system they require additional components,
especially a serial TTL-to-USB adapter (sometimes called a USB-to-UART bridge) and an
external 3.3 Volt power supply. Novice ESP-8266 developers are encouraged to consider
larger ESP8266 Wi-Fi development boards like the Node MCU which includes the USB-
toUART bridge and a Micro-USB connector coupled with a 3.3 Volt power regulator already
built into the board. When project development is complete, you may not need these
components and can consider using these cheaper ESP-xx modules as a lower power, smaller
footprint option for your production runs.
In the table above (and the two tables which follow), "Active pins" include the GPIO and
ADC pins with which you can attach external devices to the ESP8266 MCU. The "Pitch" is
34
the space between pins on the ESP8266 module, which is important to know if you are going
to breadboard the device. The "Form factor" also describes the module packaging as "2 x 9
DIL", meaning two rows of 9 pins arranged "Dual In Line", like the pins of DIP ICs. Many
ESP-xx modules include a small on-board LED which can be programmed to blink and
thereby indicate activity. There are several antenna options for ESP-xx boards including a
trace antenna, an on-board ceramic antenna, and an external connector which allows you to
attach an external Wi-Fi antenna. Since Wi-Fi communications generates a lot of RFI (Radio
Frequency Interference), governmental bodies like the FCC like shielded electronics to
minimize interference with other devices. Some of the ESP-xx modules come housed within
a metal box with an FCC seal of approval stamped on it. First and second world markets will
likely demand FCC approval and shielded Wi-Fi devices.
AI-Thinker modules
ESP-01 module
These are the first series of modules made with the ESP8266 by the third-party manufacturer
AI-Thinker and remain the most widely available. They are collectively referred to as "ESPxx
modules". To form a workable development system they require additional components,
especially a serial TTL-to-USB adapter (sometimes called a USB-to-UART bridge) and an
external 3.3 Volt power supply. Novice ESP-8266 developers are encouraged to consider
larger ESP8266 Wi-Fi development boards like the Node MCU which includes the USB-
toUART bridge and a Micro-USB connector coupled with a 3.3 Volt power regulator already
built into the board. When project development is complete, you may not need these
components and can consider using these cheaper ESP-xx modules as a lower power, smaller
footprint option for your production runs.
35
ESP8266 offers a complete and self-contained Wi-Fi networking solution, allowing it to either
host the application or to offload all Wi-Fi networking functions from another application
processor.
When ESP8266 hosts the application, and when it is the only application processor in the
device, it is able to boot up directly from an external flash. It has integrated cache to improve
the performance of the system in such applications, and to minimize the memory
requirements.
Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any
microcontroller-based design with simple connectivity through UART interface or the CPU
AHB bridge interface.
The popularity of many of these "other boards" over the earlier ESP-xx modules is the
inclusion of an on-board USB-to-UART bridge (like the Silicon Labs' CP2102 or the WCH
CH340G) and a Micro-USB connector coupled with a 3.3 Volt regulator to provide both
power to the board and connectivity to the host (software development) computer commonly
referred to as the console. With earlier ESP-xx modules, these two items (the USB-to-Serial
adaptor and a 3.3 Volt regulator) had to be purchased separately and be wired into the ESP-
xx circuit. Modern ESP8266 boards like the Node MCU boards are a lot less painful and offer
more GPIO pins to play with. Most of these "other boards" are based on the ESP-12E module,
but new modules are being introduced seemingly every few months.
36
CHAPTER 3
3.1 CIRCUIT DIAGRAM
Circuit
Diagram:
LDR
CIRCUIT OPERATION
In our daily life we are observing street lights still on night even if vehicles are not presented,
In this type of conditions are more effected the electricity board by electricity.
This project deals the how to avoid this condition using embedded. The project presented here
to on/off the street lights automatically when the vehicle moving in nights automatically.
Here we are mainly using the sensor for detect the IR(Infra red rays).The Microcontroller was
used to control the whole system, it monitors the sensor out put and according to the sensor
condition the street lights operated. The whole program written in embedded c and burned
into the microcontroller ROM.
The ARDUNIO UNO is an 8-bit microcontroller with 8k bytes of flash ROM, 256 bytes of
RAM and is preferred in using this micro due to its quick programming and ease of use.
37
CHAPTER 4
3.3 SOURCE CODE
unsigned int Light;
float adcValue; char
light_flag,bulb_flag; int
BULB = 3;
void setup() {
pinMode(BULB,OUTPUT);
digitalWrite(BULB,LOW);
void loop() {
adcValue =
((analogRead(A0))*0.0049); Light =
(((2500/adcValue)-500)/2.2); if(Light
analogWrite(BULB,150);
analogWrite(BULB,50);
analogWrite(BULB,0);
}}
38
SAMPLE PROGRAMS
Example 1:
#define F_CPU
#define F_CPU 16000000UL // 16 MHz clock speed
#endif
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC = 0xFF; //Nakes PORTC as Output
while(1) //infinite loop
{
PORTC = 0xFF; //Turns ON All LEDs
_delay_ms(1000); //1 second delay
PORTC= 0x00; //Turns OFF All LEDs
_delay_ms(1000); //1 second delay
}
}
39
Example 2:
#include <avr/io.h>
#include <util/delay.h>
int main(void)
// OR DDRC = 0x01;
Example3:
40
#include <LiquidCrystal.h>
LiquidCrystal lcd(0, 1, 8, 9, 10, 11); /// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5
PIN, D6 PIN, D7 PIN
void setup()
void loop()
0, line1
41
CHAPTER 5
SOFTWARE DEVELOPMENT
5.1 Introduction:
In this chapter the software used and the language in which the program code is
defined is mentioned and the program code dumping tools are explained. The chapter also
documents the development of the program for the application. This program has been termed
as “Source code”. Before we look at the source code we define the two header files that we
have used in the code.
Required Equipment:
An Arduino Uno
42
An A-to-B USB Cable
If you’re new to Arduino in general, you want to check out this tutorial to familiarize yourself
with everyone’s favorite microcontroller platform.
• What is an Arduino?
If you’re ready to get started, click on the link in the column on the left that matches up with
your operating system, or you can jump to your operating system here.
• Windows
• Mac
• Linux
This page will show you how to install and test the Arduino software with a Windows
operating system (Windows 8, Windows 7, Vista, and XP).
43
• Go to the Arduino download page and download the latest version of the Arduino
software for Windows.
• When the download is finished, un-zip it and open up the Arduino folder to confirm
that yes, there are indeed some files and sub-folders inside. The file structure is
important so don’t be moving any files around unless you really know what you’re
doing.
• Power up your Arduino by connecting your Arduino board to your computer with a
USB cable (or FTDI connector if you’re using an Arduino pro). You should see the
an LED labed ‘ON’ light up. (this diagram shows the placement of the power LED on
the UNO).
• If you’re running Windows 8, you’ll need to disable driver signing, so go see the
Windows 8 section. If you’re running Windows 7, Vista, or XP, you’ll need to install
some drivers, so head to the Windows 7, Vista, and XP section down below.
(b) Windows 8
Windows 8 comes with a nice little security ‘feature’ that ‘protects’ you from unsigned driver
installation. Some older versions of Arduino Uno come with unsigned drivers, so in order to
use your Uno, you’ll have to tell Windows to disable driver signing. This issue has been
addressed in newer releases of the Arduino IDE, but if you run into issues, you can try this
fix first.
For a nice, step-by-step tutorial with pictures click here, otherwise the steps are outlined
below.
• From the Metro Start Screen, open Settings (move your mouse to the bottom-
rightcorner of the screen and wait for the pop-out bar to appear, then click the Gear
icon)
• Click ‘More PC Settings’
• Click ‘General’
• Scroll down, and click ‘Restart now’ under ‘Advanced startup’.
• Wait a bit.
• Click ‘Troubleshoot’.
• Click ‘Advanced Options’
44
• Click ‘Windows Startup Settings’
• Click Restart.
• When your computer restarts, select ‘Disable driver signature enforcement‘ from the
list.
To permanently disable driver signing (recommended, but has some minor security
implications):
• Plug in your board and wait for Windows to begin it’s driver installation process
• After a few moments, the process will fail, despite its best efforts
• Click on the Start Menu, and open up the Control Panel
• While in the Control Panel, navigate to System and Security. Next, click on System
• Once the System window is up, open the Device Manager
• Look under Ports (COM & LPT). You should see an open port named “Arduino UNO
(COMxx)”. If there is no COM & LPT section, look under ‘Other Devices’ for
‘Unknown Device’
45
• Right click on the “Arduino UNO (COMxx)” or “Unknown Device” port and choose
the “Update Driver Software” option
• Next, choose the “Browse my computer for Driver software” option
46
• Finally, navigate to and select the Uno’s driver file, named “ArduinoUNO.inf”,
located in the “Drivers” folder of the Arduino Software download (not the “FTDI USB
Drivers” sub-directory). If you cannot see the .inf file, it is probably just hidden. You
can select the ‘drivers’ folder with the ‘search sub-folders’ option selected instead.
• Windows will finish up the driver installation from there
For earlier versions of the Arduino boards (e.g.Arduino Duemilanove, Nano, or Diecimila)
check out this page for specific directions.
After following the appropriate steps for your software install, we are now ready to test your
first program with your Arduino board!
47
• Select the type of Arduino board you’re using: Tools > Board > your board type
• Select the serial/COM port that your Arduino is attached to: Tools > Port > COMxx
48
• If you’re not sure which serial device is your Arduino, take a look at the available
ports, then unplug your Arduino and look again. The one that disappeared is your
Arduino.
• With your Arduino board connected, and the Blink sketch open, press the ‘Upload’
button
49
• After a second, you should see some LEDs flashing on your Arduino, followed by the
message ‘Done Uploading’ in the status bar of the Blink sketch.
• If everything worked, the onboard LED on your Arduino should now be blinking! You
just programmed your first Arduino!
(e) Troubleshooting
This guide from Arduino has some more details and troubleshooting tips if you get stuck.
50
CHAPTER 6
ADVANTAGES DISADVANTAGES & APPLICATIONS
ADVANTAGES
DISADVANTAGES
APPLICATIONS
51
Results and Conclusion
The project “INTELLIGENT HIGH WAY STREET LIGHT CONTROLLER WHILE
VEHICLE PASSING ” has been successfully designed and tested. Integrating features of all
the hardware components used have developed it. Presence of every module has been
reasoned out and placed carefully thus contributing to the best working of the unit. Secondly,
using highly advanced IC’s and with the help of growing technology the project has been
successfully implemented.
52
BIBILOGRAPHY
1. WWW.MITEL.DATABOOK.COM
2. WWW.ATMEL.DATABOOK.COM
3. WWW.FRANKLIN.COM
53
REFERENCES
1. "Power Electronics” by M D Singh and K B Khanchandan
54
68