Final Year Project
Final Year Project
                  BACHELOR OF TECHNOLOGY
                    in
 ELECTRONICS AN 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
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 to
the respected Dr.P RamaKoteswaraRao, HOD, Department of Electronics and
Communication Engineering for providing it to us. There was never such a
resourceful and enriching time in our life.
PROJECT ASSOCIATES
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.
     No part of thesis is copied from books/journals/internet and where ever
     portion is      taken, the same has been duly referred in the text the report
     is based on major project done entirely by us, not copied from any other
     source.
PRPOJECT ASSOCIATES
D.Kushalove 229P1A0440
S.Ashok 229P1A0405
B.Raghavendra 239P5A0404
ABSTRACT i
LIST OF TABLES ii
2. LITERATURE SURVEY
         2.1 Introduction                                     4
         2.2 Survey                                           4
         2.3 Existing system                                   5
         2.4 Drawbacks in the existing system                 6
         2.5 Proposed system                                  6
  3.   OVERVIEW OF THE PROJECT
         3.1 Introduction                                     7
         3.2 System Architecture                               8
         3.3 Block Diagram                                 10
                  3.3.1 Control and Reader Section         10
         3.4 Power Supply
                  3.4.1 Circuit Diagram                    11
                  3.4.2 Circuit Explanation                12
         3.5 Pin Diagram of ESP 8266                      22
                 3.5.1 Working Of ESP8266                  23
                 3.5.2 Featues of ESP8266                 24
              3.5.3 Arduino Microcontroller                           28
              3.6 Pin Description of Arduino UNO                       29
                      3.6.1 Working of Arduino Uno                     30
                      3.6.2 Technical specifications of Arduino Uno    32
4.   HARDWARE DESIGN
              4.1   Introduction                                       33
              4.2   Schematic Diagram of control section              33
              4.2.1 Hardware Interface of control section             33
                      4.3 Interfacing of Arduino uno with ESP8266     36
5    SOFTWARE DESIGN
              5.2 Introduction                                        43
              5.3 Flow Chart                                          43
              5.4 Software Tools
                      5.4.1 Arduino IDE                               44
                      5.4.2 Embedded C Language                       45
              5.5 Key Functions                                       46
              5.6 Key Command
                      5.6.1 LCD Commands                              47
                      5.6.2 ESP8266 Commands                          48
6    IMPLEMENTATION
              6.2 Introduction                                        49
              6.3 Methods of Implementation                           49
              6.4 Forms and Output screens                            49
7    RESULT
              7.2 Introduction                                        58
              7.3 EnergynEfficiency through Smart Lighting Control    58
8    CONCLUSION AND FUTURE SCOPE
              8.2 Conclusion                                          61
              8.3 Future Scope                                        61
              REFERENCE                                               62
                                      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
                               ii
                                 List of Figures
3.4.6 Regulator 16
                                             iii
         List of Abbreviations
ICSP   In-circuit Serial programming
                              iv
                                       CHAPTER 1
INTRODUCTION
1.1 OVERVIEW
                                              1
1.2 NEED FOR IOT HIGHWAY STREET LIGHT CONTROL BASED
ON DENSITY
: 1. Energy Efficiency
2. Cost Reduction
         IoT enables intelligent usage, reducing electricity bills and maintenance costs by
          identifying faulty lights automatically.
         Reduces manpower requirements for manual monitoring and switching.
3. Smart Maintenance
4. Environmental Benefits
□ 5. Intelligent Automation
         A central dashboard can manage and monitor thousands of lights across highways in
          real-time.
         Remote control and scheduling reduce the need for physical interve
                                            2
1.3 OBJECTIVE OF PROJECT
The main objective of this project is to design and implement a smart, energy-
efficient, and automated street lighting system for highways using IoT
technologies. This system aims to reduce energy consumption, minimize manual
intervention, and enhance road safety by intelligently controlling street lights based
on real-time conditions
1.4 ORGANIZATION OF DOCUMENTATION
Chapter 1: This chapter discusses about the overview of the project, the need for Iot
based highway street light control. It also defines the objectives of the project.
Chapter 2: This chapter discusses about the existing system of the project and
explains about their drawbacks. To avoid these disadvantages how proposed system
was being implemented. Chapter 3: This chapter discusses about the overview of the
proposed system of the project and explains about the Block Diagram. It also gives the
brief details about each and every block along with its functionality, features and
operation.
Chapter 4: This chapter discusses about the hardware design, Pin description of each
component and their functioning, Interfacing of different hardware components with
each other.
Chapter 5: This chapter discusses about the software design, Flowchart and its
explanation, the software tools, commands and the functions.
Chapter 6: This chapter discusses about the methods of Implementation, Steps for
setting up Arduino uno, ThingSpeak server and for creating app in MIT App Inventor.
It also shows the pictorial guide to follow the steps.
Chapter 7: This chapter discusses about the ending topic of the project that is nothing
but the result. Outcome, consequence of a problem is discussed. This chapter also
includes the output view of the project in the form of figures and the analysed output
will be shown as screenshot of results in the mobile application.
Chapter 8: This chapter discusses about the conclusion statement of the project and
the modifications and updates that can be done to this project to make it more effective
in future.
                                             3
                                    CHAPTER 2
LITERATURE SURVEY
2.1 INTRODUCTION
This chapter discusses about the existing system of the project and explains about their
drawbacks. To avoid these disadvantages how proposed system was being
implemented.
      Some studies introduced PIR (Passive Infrared) or LDR (Light Dependent Resistor) based
       systems.
      These systems improved efficiency by turning lights ON/OFF based on motion detection
       or ambient light.
      However, they often operated standalone and lacked network integration for centralized
       monitoring.
Reference Example:
      S. Ahmed et al., “Energy Efficient Street Lighting System Using PIR Sensor”, IEEE 2016:
       Proposed a motion-based lighting control but lacked IoT integration and scalability.
      Recent research focuses on using IoT platforms (like NodeMCU, Arduino, Raspberry Pi)
       for smart lighting systems.
      These systems use cloud connectivity, mobile/web interfaces, and real-time data analysis.
      They enable centralized monitoring, automated control, and predictive maintenance.
Reference Example:
      P. Kumar et al., “Smart Street Light System using IoT”, IJERT 2019: Demonstrated an
       IoT-enabled system with cloud control, achieving significant power savings.
                                               4
4. Communication Technologies Used
      Projects have used Wi-Fi, Zigbee, LoRa, and GSM for communication between lights and
       central servers.
      LoRa is preferred for long-distance, low-power applications like highway lighting.
      Wi-Fi is suitable for local, urban environments but limited in rural highways.
      Advanced systems use data analytics to monitor traffic patterns, predict peak hours, and
       optimize light usage.
      Some proposals include to enhance automation and learn patterns over time.
Reference Example:
      R. Patel et al., “Machine Learning Approach to Smart Street Lighting”, IEEE Xplore
       2021: Introduced traffic prediction for intelligent lighting decisions.
                                                 5
2.4 DRAWBACKS IN THE EXISTING SYSTEM
2. Power Dependency
      Issue: IoT sensors and communication modules rely on a continuous power supply or
       batteries.
      Impact: Battery-powered nodes may fail if not maintained; solar-powered systems may
       struggle in adverse weather.
      Issue: Many systems use basic ON/OFF automation (e.g., based on LDR or timers)
       without adaptive intelligence.
      Impact: Cannot adjust brightness based on traffic density or weather conditions, leading
       to energy waste or poor visibility.
camerabased sensors are installed along the highway to count vehicles and measure
sensor data locally. IoT Connectivity o Communication Modules: Wi-Fi, GSM, LoRa,
or NBIoT are used to transmit data to a central server or cloud. o Data Aggregation: All
traffic data is sent in real-time to a centralized system for analysis and control
lighting levels High density → Full brightness Medium density → 50% brightness Low
                                               6
                                          CHAPTER 3
3.1 INTRODUCTION
This chapter discusses about the overview of the proposed system of the project and
explains about the Block Diagram. It also gives the brief details about each and every block
along with its functionality, features and operation.
    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:
        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
What is what in the microcontroller?
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.
                                             8
Random Access Memory (RAM)
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.
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
                                              9
  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…
Hardware Requirements
• ARDUINO UNO
• POWER SUPPLAY
• LEDS
• LDR
• IR TAX AND RX
• IOT MODULE
                                               10
       3.4 POWER SUPPLY
supplies electrical or other types of energy to an output load or group of loads is called a power
supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to
mechanical ones, and rarely to others. This power supply section is required to convert AC signal to
DC signal and also to reduce the amplitude of the signal. The available voltage signal from the mains
is 230V/50Hz which is an AC voltage, but the required is DC voltage (no frequency) with the
amplitude of +5V and +12V for various applications. In this section we have Transformer, Bridge
rectifier, are connected serially and voltage regulators for +5V and +12V (7805 and 7812) via a
capacitor (1000µF) in parallel are connected parallel as shown in the circuit diagram below. Each
voltage regulator output is again is connected to the capacitors of values (100µF, 10µF, 1 µF, 0.1 µF)
are connected parallel through which the corresponding output (+5V or +12V) are taken into
consideration.
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.
            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
                                                 12
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.
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.
                                                    13
        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.
Now the output of the rectifier shown in Figure 3.3 is shown below in Figure
3.4
                                      14
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.
                                               15
Regulator:
                    Regulator eliminates ripple by setting DC output to a fixed voltage.
             Voltage regulator ICs are available with fixed (typically 5V, 12V and 15V) or
             variable output voltages. Negative voltage regulators are also available
             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.
                                     LDR
   Working :
                                                  16
The resulting free electron (and its hole partner) conduct electricity, thereby lowering
resistance.
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!
                                                   17
        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.
                                                 18
        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)
Reworking the equation, we obtain the light intensity Lux = (2500/Vo - 500)/3
                                                  19
IR LEDs
   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.
                                                20
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.
Lifetime Tests
                                             21
   ambient temperatures. The samples operated at currents I = 0, 0.5, 1, 2 A for 150
   h at room temperature, 450 h at T = 130°C, and 800 h at T =180°C. The LEDs
   were cooled to room temperature and heated again to T = 130°C eight times and
   to 180°C three times.
   The lower graph shows the output
   power as a function of the working
   time. As can be seen, the output
   power decreased, on average, by
   25% after 1400 h of operation. It is
   noteworthy that the operating
   current strength has no effect on the
   degradation of the LEDs. With
   increasing operating time, the
   reverse currents at a bias U = 1 V
   increased from 0.5–1 mA (0 h) to
   3–4 mA (1400 h). On “cleaning” the sample surface by etching in CP-4, the reverse
   current returned to its initial values, and the output power tended to regain its initial
   value: P(1400 h) = (0.85–0.9)P(0 h).
   This confirms that LED encapsulation or by protection with window should increase
   LED lifetime at elevated temperatures.
                                                  22
           Pin       Pin Name    Alternate         Normally used for       Alternate purpose
         Number                   Name
                There are so many methods and IDEs available to interface with ESP modules,
        but the most commonly used on is the Arduino IDE. The ESP8266 module works with
        3.3V only, anything more than 3.7V would kill the module hence be cautions with your
        circuits. The best way to program an ESP-01 is by using the FTDI board that supports
        3.3V programming. If you don‟t have one it is recommended to buy one or for time
        being you can also use an Arduino board. One commonly problem that everyone faces
        with ESP-01 is the powering up problem. The module is a bit power hungry while
        programming and hence you can power it with a 3.3V pin on Arduino or just use a
        potential divider. So it is important to make a small voltage regulator for
                                              23
3.5.2 FEATURES OF ESP8266
   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.
                                                24
                                        PCB
                                 No               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 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 USBtoUART bridge and a Micro-USB connector
                                            25
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.
AI-Thinker modules
       ESP-01 module
                                           26
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 USBtoUART 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.
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 ESPxx 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.
                                              27
    3.5.3 ARDUINO MICROCONTROLLER
header, and a reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get
started. The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter. "Uno"
means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno and
                                               28
3.6 PIN DESCRIPTION OF ARDUINO UNO
                                29
     Pin Category    Pin Name               Details
     Power           Vin, 3.3V,       5V,   Vin: Input voltage to Arduino when using an
                     GND                    external power source. 5V: Regulated power
                                            supply used to power microcontroller and other
                                            components on the board. 3.3V: 3.3V supply
                                            generated by on-board voltage regulator.
                                            Maximum current draw is 50mA.
                                            GND: ground pins.
Serial 0(Rx), 1(TX) Used to receive and transmit TTL serial data.
                                            30
computer. The ATmega16U2 firmware uses the standard USB COM drivers, and no external
driver is needed. However, on Windows, an .inf file is required. The Arduino software includes
a serial monitor which allows simple textual data to be sent to and from the Arduino board.
There are two RX and TX LEDs on the Arduino board which will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (not for serial
communication on pins 0 and 1). A Software Serial library allows for serial communication on
any of the Uno's digital pins. The ATmega328P also supports I2C (TWI) and SPI
communication.
       Software: Arduino IDE (Integrated Development Environment) is required to
       program the Arduino Uno board.
       Programming of Arduino Uno: Once Arduino IDE is installed on the computer,
       connect the board with computer using USB cable. Now open the Arduino IDE and
       choose the correct board by selecting Tools>Boards>Arduino/Genuino Uno, and
       choose the correct Port by selecting Tools>Port. Arduino Uno is programmed using
       Arduino programming language based on Wiring. To get it started with Arduino Uno
       board and blink the built-in LED, load the example code by selecting
       Files>Examples>Basics>Blink. Once the example code (also shown below) is loaded
       into your IDE, click on the „upload‟ button given on the top bar. Once the upload is
       finished, you should see the Arduino‟s built-in LED blinking.
               // the setup function runs once when you press reset or power
               the board
Void loop () {
                                                     31
3.6.4 TECHNICAL SPECIFICATIONS OF ARDUINO UNO
Operating Voltage 5V
SRAM 2 KB
EEPROM 1 KB
                                            32
                                        CHAPTER 4
                                    HARDWARE DESIGN
4.1 INTRODUCTION
This chapter discusses about the Hardware Design and the operation of each and every
part of the schematic diagram. A schematic diagram is a representation of the elements
of a system using abstract, graphic symbols rather than realistic pictures.
               The heart of our project is Arduino Uno and here "Uno" means one in Italian
       and is named to mark the release of Arduino 1.0 board. It is based on the ATmega328
       (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
       outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack,
       an ICSP header, and a reset button. These pins act as the input-output pins of Arduino
       Uno. These are bidirectional and used for multipurpose. And coming to the power
       supply, it contains everything needed to support the microcontroller; simply connect it
       to a computer with a USB cable or power it with an AC-to-DC adapter or
                                                33
    battery to get started. The board can operate on an external supply of 6 to 20 volts. If
    supplied with less than 7V, however, the 5V pin may supply less than five volts and the
    board may be unstable. If using more than 12V, the voltage regulator may overheat and
    damage the board. The recommended range is 7 to 12 volts.
             The Atmega328 has 32 KB of flash memory for storing code (of which 0, 5 KB
    is used for the boot loader); it has also 2 KB of SRAM and 1 KB of EEPROM (which
    can be read and written with the EEPROM library). Each of the 14 digital pins on the
    Uno can be used as an input or output, using pinMode(), digitalWrite(), and
    digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a
    maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-
    50 KΩ.
             We are using a Wi-Fi module ESP8266 to send the data over internet.ESP8266
    is a complete Wi-Fi system on chip that incorporates a 32-bit processor, some RAM and
    depending on the vendor between 512KB and 4MB of flash memory. Depending on the
    specific module variant (ESP-1 to ESP-12 at the time of this thesis) between 0 and 7
    General Purpose Input/output (GPIO) pins are available, in addition to Rx and TX pins
    of the UART, making the module very suitable for IoT applications. It consists of LCD
    display which displays the bin number that is being scanned. The 16×2 Character LCD
    uses 8 data bus lines (D0/DB0 – D7/DB7) and 3 control signals (E: Enable, RS: Register
    Select, R/W: Read/Write).
The ESP8266 Module works on 3.3V Power Supply and anything greater than
that, like 5V for example, will kill the SoC. So, the VCC Pin and CH_PD Pin of
ESP8266 ESP-01 Module are connected to a 3.3V Supply. The ESP8266 Wi-Fi
Module has two modes of operation: Programming Mode and Normal Mode.
       In Programming Mode, you can upload the program or firmware to the ESP8266
Module and in Normal Mode, the uploaded program or firmware will run normally. In
order to enable the Programming Mode, the GPIO0 pin must be connected to GND. In
the circuit diagram, I‟ve connected a SPDT switch to the GPIO0 pin. Toggling the lever
of SPDT will switch the ESP8266 between Programming mode (GPIO0 is connected to
GND) and normal mode (GPIO0 acts as a GPIO Pin). Also, the RST (Reset) will play
an important role in enabling Programming Mode. The RST pin is an active LOW pin
and hence, it is connected to GND through a Push Button. So, whenever the button is
pressed, the ESP8266 Module will reset. The RX and TX pins of the ESP8266 Module
are connected to RX
                                       35
     and TX Pins on the Arduino board. Since the ESP8266 SoC cannot tolerate 5V, the
     RX Pin of Arduino is connected through a level converter consisting of a 1KΩ and a
     2.2KΩ Resistor.
           In this instruction we are going to tell the board where we connected the
   pins. The pins which are connected need to be represented in order as “RS, En,
   D4, D5, D6, and D7”. These pins are to be represented correctly. Since we have
   connected RS to PIN0 and so on as show in the circuit diagram, we represent the
   pin number to board as “LiquidCrystal lcd(0, 1, 8, 9, 10, 11);”. The data which
   needs to be displayed in LCD should be written as “cd.print ("hello, world!");”
   With this command the LCD displays „hello, world!‟
   Real Time Systems:
   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
                                               37
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.
Application Areas:
Consumer appliances:
Office automation:
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
                                             38
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.
Medical electronics:
Computer networking:
Telecommunications:
                                            39
Wireless technologies:
Security:
                                             40
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:
    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:
                                              41
        is overwhelmed today with cheap automatic devices and various “smart”
        appliences.
    •   Prior knowledge is hardly needed for programming. It is sufficient to have a
        PC (software in use is not demanding at all and is easy to learn) and a simple
        device (called the programmer) used for “loading” raedy-to-use programs into
        the microcontroller.
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.
                                               42
                                          CHAPTER 5
                                      SOFTWARE DESIGN
5.1 INTRODUCTION
This chapter discusses about the software design. It briefly describe about the flowchart
and its explanation. Next the software tools that are being used in the project like Arduino
IDE, ThingSpeak server, MIT App Inventor. A brief discussion on the embedded c
language. Why it is preferred when compared to others. Commands and functions that
are being used in the project.
                                                43
The flowchart illustrates the working of an Automated Solar Street Light System for Highway
Applications, based on both LDR (Light Dependent Resistor) and ultrasonic sensors. The system
begins its operation when a button is pressed, i.e., when the IS BUTTON == HIGH condition is
met.
From this point, the system can proceed through one of two primary paths. In the first path (left
side), the system uses an LDR sensor to detect ambient light. It switches on the LED light, reads
the LDR value, and again switches on the LED (redundantly). After reading the LDR value
again, it sends an SMS alert and displays the information on an LCD screen.
In the second path (right side), the system reads the value from an ultrasonic sensor to detect the
presence of any obstacle, such as a vehicle. If an obstacle is detected, the LED is switched on,
and the system checks the time duration. If the time exceeds a set threshold, an SMS is sent and
information is displayed on the LCD. If the time is below the threshold, the system continues to
monitor the obstacle.
If no obstacle is detected in this path, the system still checks the time. If the time exceeds one
unit (possibly one second or minute), the LED is switched off. If not, the system continues
checking.
Overall, the flowchart presents a semi-automated street lighting system that operates based on
light intensity and object detection, along with real-time feedback via SMS and LCD display.
However, some redundancy and inefficiencies are evident in the logic flow.
arrays and strings, structures and union, bit operations, macros, etc .
                                         45
        processors/controllers. Assembly is also used but mainly to implement those portions
        of the code where very high timing accuracy, code size efficiency, etc. are prime
        requirements. As assembly language programs are specific to a processor, assembly
        language didn‟t offer portability across systems. To overcome this disadvantage,
        several high level languages, including C, came up.
                                                 46
KEY COMMANDS
Key Commands is nothing but representing a character or a word with a short cut. And here in
this project there are few commands for LCD and IoT Module. They are shown below.
                                                   47
5.5.2 ESP8266 COMMANDS
      AT+CWJAP = “<your-     Connect to your Wi-Fi. Provide your SSID name and
       ssid>”,”<your-pw>”   password inside the double quotes...
                                      48
                            CHAPTER 6
                        IMPLEMENTATION
6.1 INTRODUCTION
       This chapter discusses about the dumping process of both hardware and
software. There will be a brief discussion about the implementation and the steps
involved in it and their output screens.
      Arduino IDE
       - Editor, Compiler, Debugger, Converter
      ThingSpeak Server
       -   Profile in account, Display of waveforms, Talkback profile
      MIT App Inventor
       In the project as WI-FI plays an important role, because this is the source through
which the information is carried to the mobile application.
                                           49
                              Fig.6.1: Arduino IDE Window 1
4. As you click the Include Library and add the respective library it will on the top of
the sketch with #include sign. Suppose, I Include the EEPROM library, it will appear
on the text editor as #include <EEPROM.h>. Most of the libraries are preinstalled and
come with the Arduino software. However, you can also download them from the
external sources.
5. In order to upload the sketch, you need to select the relevant board you are using and
the ports for that operating system. As you click the Tools on the Menu, it will open
port window. Just go to the “Board” section and select the board you aim to
                                        50
work on. Similarly, COM1, COM2, COM4, COM5, COM7 or higher are reserved for
the serial and USB board. You can look for the USB serial device in the ports section
of the Windows Device Manager. Following figure shows the COM4 that I have used
for my project, indicating the Arduino Uno with COM4 port at the right bottom corner
of the screen.
6. After correct selection of both Board and Serial Port, you can go to the Sketch section
and press verify/compile. The sketch is written in the text editor and is then saved with
the file extension .ino.
52
                                        52
                        Fig.6.6: Different Apps in ThingSpeak server
                                       53
                               Fig.6.8: Getting Started
2. Log in to App Inventor with a Gmail (or Google) user name and password.
3. Start new project.
4. The Design Window is where you lay out the look and feel of your app, and specify
what functionalities it should have. You choose things for the user interface things like
Buttons, Images, and Text boxes, and functionalities like Sensors, and GPS.
                                        54
                                  Fig.6.10: Design Window
5. Click and hold on the word "Button" in the palette. Drag your mouse over to the
Viewer. Drop the button and a new button will appear on the Viewer.
                                       55
7. Get the MIT AI2 Companion from the Play Store and install it on your phone.
8. Start the AI Companion on your device. Get the Connection Code from App Inventor
and scan it into your Companion app. See your app on the connected device.
9. Add different events to the button to make it function as switch etc. and program the
event to the added component.
                                      56
11. Add different events to the button to make it function as switch etc. and program the
event to the added component.
                                     57
                                          CHAPTER 7
                                            RESULTS
7.1 INTRODUCTION
The IoT-based highway street light control system was successfully implemented and tested to
demonstrate intelligent, automated lighting control using sensors and microcontroller logic. The system
responded effectively to changes in environmental light and the presence of vehicles, enabling smart
control of LED street lights. Upon activation, the system continuously monitored ambient light using the
LDR sensor and detected obstacles or vehicles using the ultrasonic sensor. During low-light conditions
(e.g., at night or cloudy weather), the LDR sensor triggered the LED lights to turn ON automatically.
The lights remained OFF during the daytime, ensuring energy conservation. Simultaneously, the
ultrasonic sensor detected vehicle presence on the highway. When a vehicle came within the sensor
range, the street light turned ON and remained active for a specified time. If the vehicle persisted
beyond the threshold, the system successfully sent an SMS alert and displayed real-time status on an
LCD screen. This demonstrated the seamless integration of hardware components and software logic to
achieve responsive, sensor-based street lighting.
Overall, the experiment proved that the proposed IoT-based system can provide a reliable, cost-
effective, and intelligent solution for managing highway street lights, with the potential to be scaled for
broader smart city and sustainable infrastructure initiatives.
                                             58
Fig 7.9: Output 1
   59
60
                                     CHAPTER 8
8.1 CONCLUSION
        The implementation of an IoT-based highway street light control system offers a significant
improvement over conventional street lighting methods by providing intelligent, automated, and energy-
efficient lighting solutions. Through the integration of sensors, microcontrollers, and wireless
communication, this system ensures that street lights operate only when required—based on traffic
movement and ambient light conditions. This not only leads to substantial energy savings but also
enhances road safety and reduces maintenance costs by enabling real-time fault detection and centralized
monitoring. The project demonstrates how smart infrastructure can contribute to sustainability and
operational efficiency in urban and highway environments.
                                            61
                                  REFERENCES
1. Day, L. and McNeil, I. Biographical dictionary of the history of technology, Taylor and Francis,
1996.
2. Moyer, S. “Mr. Trafficlight”. Motor News. Automobile Club of Michigan: pp.14-15, 1947.
3. Angus, P. D. ‘Modeling of Traffic Signal Control and Transit Signal Priority’. Massachusetts Institute
of Technology, 2001.
4. Ashish, J., Manisha, M., Harish, V. and Amrita R. “Traffic Density Measurement based On-road
Traffic Control using Ultrasonic Sensors and GSM Technology”, in proc. AEEE 4th International
Conference on Emerging Trends in Engineering and Technology, Kurushetra, Haryana, India, October
25-27, 2013, pp. 778-786.
5. Hashim, N. M., Jaafar, A. S., Ali, N.A., Salahuddin, L., Mohamad, N. R. and Ibrahim, M. A. “Traffic
Light Control System for Emergency Vehicles Using Radio Frequency”, ISOR Journal of Engineering,
3(7), pp. 43-52, 2013.
7. Kavya, P. W. and Joythi, S. “Traffic Light Control System Using Image Processing”, International
Journal of Innovative Research in Computer and Communication Engineering, 2(5), pp. 288-292, 2014.
8. Mohit, D. S., Prema, Shubhendu, S., Sumedha, S. and Utkarsh, T. “Smart Traffic Control System
Using PLC and SCADA”, International Journal of Innovative Research in Science, Engineering and
Technology, 1(2), pp. 169-172, 2012.
9. Mani, T., Kumar, A. N., Dhanapal, M., Kumar, A. S., Hemalatha, R. and Vinodhini, I. “Density
Based Traffic Light Control System”. International Journal of Advanced Research in Management,
Architecture, Technology and Engineering, 2(9), pp. 334-339, 2016.
10. Microchip (2007). 28/40/44-Pin, High Performance; Enhanced Flash, USB Microcontrollers with
nanoWatt Technology, PIC18F2455/2550/4455/4550 datasheet, Microchip Technology Inc., Arizona,
USA.
                                            62
11. Mehta, V. K. and Rohit, M. Principles of Electronics. S. Chand and Company PVT. LTD., New Delhi,
India, 1980.
12. Malik, T. and Hongchi, S. “Adaptive Traffic Light Control with Wireless Control Networks”, in 4th
IEEE Consumer Communications and Networking Conference, Las Vegas, Nevada, USA, January 11- 13,
2007, pp. 187-191.
13. Khalil, Y., Al-Karaki, J. and Ali, S. “Intelligent Traffic Light Control System Using Wireless Sensors
Networks”, Journal of Information Science, Engineering and Technology, 26, pp. 753-768, 2010.
14. Osigwe, U. C., Oladipo, O. F. and Onibere, E. A. “Design and Simulation of an Intelligent Traffic
Control System”, International Journal of Advances in Engineering and Technology, 1(5), pp. 47-57, 2011.
15. Sharma, E. P., Mishra, A. and Singh, K. “Density Based Intelligent Traffic Control System Using IR
Sensors”, International Journal of Scientific Research, 4(5), pp. 3-4, 2015.
63