Major Project b10
Major Project b10
Major Project b10
Submitted for partial fulfilment of the requirements for the award of the degree of
BACHELOR OF TECHNOLOGY
In
Dr.M.Tirupathi
Associate Professor
March - 2024
St. MARTIN'S ENGINEERING COLLEGE
UGC Autonomous
NBA& NAAC A+ Accredited
Dhulapally, Secunderabad - 500
100
Certificate
Date:
Place:
St. MARTIN'S ENGINEERING COLLEGE
UGC Autonomous
NBA& NAAC A+ Accredited
Dhulapally, Secunderabad - 500
100
www.smec.ac.in
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
DECLARATION
First and foremost, we would like to express our deep sense of gratitude and
indebtedness to our College Management for their kind support and permission to use
the facilities available in the Institute.
We would like to express our sincere gratitude and indebtedness to our project supervisor
Dr.M.Thirupathi assistant Professor, electronics and communication engineering, St. Martins
Engineering College, Dhulapally, for his support and guidance throughout our project.
K.MAHENDAR 20K81A0492
V. NAVEEN 20K81A04B8
Y.CHAITHANYA 20K81A04B9
i
ABSTRACT
The abstract describes a Smart Helmet for Drowsy Detection System incorporating
advanced technologies such as GPS, GSM, ESP CAM, and a Vibration Sensor. This
innovative helmet aims to enhance road safety by detecting and preventing instances of
drowsiness in the wearer. The GPS technology enables real-time location tracking, while
GSM facilitates instant communication capabilities. The integration of ESP CAM provides
visual data for analysis. Additionally, a Vibration Sensor is employed for accurate
drowsiness detection. When drowsiness is detected, the system triggers an alert, ensuring
timely intervention to prevent potential accidents. This Smart Helmet represents a
comprehensive solution for promoting road safety through the fusion of cutting-edge
technologies.
ii
LIST OF FIGURES
6.10.2 Microcontrollers 57
6.10.3 Architecture 58
Operation of a DC Motor
Diagram of DC shunt motor
Diagram of DC series motor
Diagram of DC series motor graph representation
Diagram of DC compound motor
ESP32-CAM
ESP32-CAM Pinout
iii
LIST OF TABLES
iv
CONTENTS
ACKNOWLEDGEMENT i
ABSTRACT ii
LIST OF iii
FIGURES LIST iv
OF TABLES
CHAPTER 1 INTRODUCTION 1
1.1 GPS Technology
1.2 GSM Communication
1.3 ESP CAM for Visual Data
1.4 Vibration Sensor for Drowsiness Detection
Introduction:
In recent years, the increasing prevalence of road accidents has underscored the urgent need for innovative
solutions to enhance road safety. Among the various contributing factors to accidents, driver drowsiness
stands out as a significant concern. Fatigue-related incidents can lead to delayed reaction times and
impaired decision-making, posing a serious threat to both drivers and others on the road. In response to
this critical issue, the development of a Smart Helmet for Drowsy Detection System has emerged as a
promising solution, integrating cutting-edge technologies to mitigate the risks associated with drowsy
driving.
Road safety has been a global concern, with millions of lives lost and injuries sustained each year due to
traffic accidents. The World Health Organization (WHO) reports that road traffic injuries are a leading
cause of death for individuals aged 15 to 29 years. Among the various factors contributing to accidents,
driver fatigue and drowsiness have gained significant attention for their adverse effects on driving
performance. The National Highway Traffic Safety Administration (NHTSA) estimates that drowsy
driving results in thousands of crashes annually in the United States alone.
Traditional approaches to address drowsy driving have included awareness campaigns, regulations on
driving hours for commercial drivers, and periodic breaks during long journeys. However, the limitations
of these strategies have prompted the exploration of technological interventions to actively detect and
prevent drowsiness in real-time. The integration of emerging technologies, such as GPS, GSM, ESP CAM,
and Vibration Sensors, into a Smart Helmet presents a multifaceted solution to tackle this pervasive issue.
The primary objective of this project is to design, develop, and implement a Smart Helmet for Drowsy
Detection System that leverages state-of-the-art technologies. The helmet aims to go beyond traditional
methods by providing a proactive approach to mitigate the risks associated with driver drowsiness. The
incorporation of GPS enables real-time location tracking, while GSM ensures instant communication
capabilities. The integration of ESP CAM introduces visual data for comprehensive analysis, and a
Vibration Sensor serves as a reliable mechanism for detecting signs of drowsiness.
The significance of this project lies in its potential to significantly reduce road accidents caused by drowsy
driving. By creating a wearable device that actively monitors the driver's state and triggers alerts in the
presence of drowsiness, the Smart Helmet seeks to enhance overall road safety. The use of advanced
technologies ensures a comprehensive and real-time approach, offering a level of sophistication not
achievable with conventional methods.
1. GPS Technology:
The incorporation of GPS technology in the Smart Helmet serves as a foundational element for the project.
GPS allows for precise real-time location tracking of the wearer. This feature not only contributes to
overall safety by enabling tracking and monitoring but also facilitates additional functionalities, such as
route optimization and emergency location sharing in the event of an accident.
2. GSM Communication:
The integration of GSM communication in the Smart Helmet enables seamless connectivity. Through
GSM, the helmet can transmit data, receive commands, and send alerts to predefined contacts. In situations
where the system detects signs of drowsiness, the GSM module plays a crucial role in notifying relevant
parties, such as emergency services or designated contacts of the wearer.
The innovative integration of GPS, GSM, ESP CAM, and Vibration Sensor technologies in the Smart
Helmet for Drowsy Detection System represents a significant leap forward in addressing the challenges
posed by drowsy driving. The combination of these advanced components creates a comprehensive and
proactive solution, moving beyond reactive approaches to actively prevent potential accidents.
Unlike traditional methods that rely on reactive measures after drowsiness has already set in, the Smart
Helmet takes a proactive approach. By continuously monitoring the wearer's condition through the
Vibration Sensor and utilizing real-time data from GPS and GSM modules, the system can detect early
signs of drowsiness. This allows for timely intervention, preventing accidents before they occur.
The inclusion of GSM technology ensures real-time communication capabilities for the Smart Helmet. In
the event of detected drowsiness, the system can instantly send alerts to predefined contacts, enabling
prompt assistance. This real-time communication feature is crucial for enhancing the effectiveness of the
helmet as a preventive safety measure.
The ESP CAM module introduces a visual element to the drowsy detection system, offering an additional
layer of data for analysis. The captured images or video footage can be used to corroborate signs of
drowsiness detected by the Vibration Sensor. This comprehensive data analysis contributes to the accuracy
of the system in identifying and responding to drowsiness.
The Smart Helmet is designed to be wearable and user-friendly, ensuring widespread acceptance and
adoption. The integration of advanced technologies does not compromise the comfort or usability of the
helmet. The aim is to create a device that seamlessly integrates into the routine of drivers, providing an
unobtrusive yet effective solution for drowsiness detection.
CHAPTER 2
LITERATURE SURVEY
The system automatically detects motorcycle riders and determines that they are wearing safety helmets or
not. The system extracts moving objects and classifies them as a motorcycle or other moving objects based
on features extracted from their region properties using K-Nearest Neighbour (KNN) classifier. The heads
of the riders on the recognized motorcycle are then counted and segmented based on projection profiling.
The system classifies the head as wearing a helmet or not using KNN based on features derived from 4
sections of segmented head region. Experiment results show an average correct detection rate for near
lane, far lane, and both lanes as 84%, 68%, and 74%, respectively [3]. The helmet is the main safety
equipment of motorcyclists, but many drivers do not use it. If an motorcyclist is without helmet an
accident can be fatal. This paper aims to explain and illustrate an automatic method for motorcycles
detection and classification on public roads and a system for automatic detection of motorcyclists without
helmet. For this, a hybrid descriptor for features extraction is proposed based in Local Binary Pattern,
Histograms of Oriented Gradients and the Hough Transform descriptors. Traffic images captured by
cameras were used [4]. It is known that head gesture and brain activity can reflect some human behaviours
related to a risk of accident when using machine-tools. The research presented in this paper aims at
reducing the risk of injury and thus increase worker safety. Instead of using camera, this paper presents a
Smart Safety Helmet (SSH) in order to track the head gestures and the brain activity of the worker to
recognize anomalous behavior. Information extracted from SSH is used for computing risk of an accident
(a safety level) for preventing and reducing injuries or accidents. The SSH system is an inexpensive, non-
intrusive, non- invasive, and non-vision-based system, which consists of an Inertial Measurement Unit
(IMU) and dry EEG electrodes. A heptic device, such as vibrotactile motor, is integrated to the helmet in
order to alert the operator when computed risk level (fatigue, high stress or error) reaches a threshold.
Once the risk level of accident breaks the threshold, a signal will be sent wirelessly to stop the relevant
machine tool or process[5]. A smart helmet is a special idea which makes motorcycle driving safer than
before. This is implemented using GSM and GPS technology. The working of this smart helmet is very
simple, vibration sensors are placed in different places of helmet where the probability of hitting is more
which are connected to microcontroller board. So when the rider crashes and the helmet hit the ground,
these sensors sense and gives to the microcontroller board, then controller extract GPS data using the GPS
module that is interfaced to it. When the data exceeds minimum stress limit then GSM module
automatically sends message to ambulance or family members[6]. This project is specially developed as to
improve the safety of the motorcycle’s rider. Motorcyclist will be alarmed when the speed limit is
exceeded. A Force Sensing Resistor (FSR) and BLDC Fan are used for detection of the rider’s head and
detection of motorcycle’s speed respectively. A 315 MHz Radio Frequency Module as wireless link which
able to communicate between transmitter circuit and receiver circuit. PIC16F84a is a microcontroller to
control the entire component in the system. Only when the rider buckled the helmet then only the
motorcycle’s engine will start. A LED will flash if the motor speed exceeds 100 km/hour[7]. Intelligent
Safety Helmet for Motorcyclist is a project undertaken to increase the rate of road safety among
motorcyclists. The idea is obtained after knowing that the increasing number of fatal road accidents over
the years is cause for concern among motorcyclists. Through the study identified, it is caused the helmets
used is not in safety features such as not wearing a helmet string and not use the appropriate size.
Therefore, this project is designed to introduce security systems for the motorcyclist to wear the helmet
properly. With the use of RF transmitter and RF receiver circuit, the motorcycle can move if there is
emission signal from the helmet, in accordance with the project title Intelligent Safety Helmet for
Motorcyclist. Security system applied in this project meet the characteristics of a perfect rider and the
application should be highlighted. The project is expected to improve safety and reduce accidents,
especially fatal to the motorcyclist[8].
CHAPTER 3
EXISTING SYSTEM
In the current state of helmet technology, there is a notable absence of systems designed to detect the
drowsiness of the rider. In traditional helmets, the onus is entirely on the rider to recognize signs of
drowsiness and take proactive measures, such as pulling over to rest. This inherent reliance on the rider's
self-awareness introduces a potential safety gap.
Under the existing paradigm, riders must personally acknowledge their drowsy state, and failure to do so
could have severe consequences, possibly resulting in accidents. The lack of a built-in mechanism for
detecting drowsiness means that riders may unknowingly jeopardize their safety and the safety of others
on the road. The reliance on self-identification poses a considerable risk, especially in situations where
fatigue or drowsiness may impair the rider's judgment or reaction time without their awareness.
Consequently, the need for a technological intervention that can autonomously and proactively detect
drowsiness becomes increasingly evident.
The absence of a drowsiness detection system in conventional helmets underscores the critical need for
innovation in helmet design and safety technology. By introducing a Smart Helmet equipped with
advanced features like a Vibration Sensor, GPS, GSM, and ESP CAM, the proposed solution aims to
bridge this gap and significantly enhance rider safety by addressing the limitations of the current helmet
systems. This shift from passive reliance on rider awareness to an active, technology-driven approach
represents a crucial step towards preventing accidents caused by drowsy riding.
CHAPTER 4
PROPOSED SYSTEMS
The provided diagram illustrates the block components of the Smart Helmet Drowsiness Detection
System. This intricate system encompasses crucial elements such as a regulated power supply, vibration
sensor, GPS module, GSM modem, ESP Cam, drowsy detection sensor, LCD display, buzzer, and a DC
motor. Central to the control and coordination of this multifaceted system is the Raspberry Pi Pico
microcontroller.
The ESP Cam, in conjunction with the drowsy detection sensor, plays a pivotal role in identifying signs of
drowsiness in the rider. Simultaneously, the vibration sensor is employed to detect subtle movements or
irregularities. In the event of an accident or if the system detects the rider's drowsiness, a series of
synchronized actions are triggered.
A distinctive feature of this system is the integration of safety mechanisms. Upon detection of an accident
or drowsiness, the buzzer activates, conveying an audible alert to the rider. Additionally, relevant
information is displayed on the LCD screen. Furthermore, a proactive safety measure involves sending an
SMS alert to a pre-registered contact, providing real-time location information.
In the unfortunate event of a collision, the system incorporates an engine cut-off mechanism. This
immediate response adds an extra layer of safety by preventing further movement of the bike post-
accident. The comprehensive design of the Smart Helmet Drowsiness Detection System ensures a swift
and synchronized reaction to potential threats, amalgamating advanced technologies for an enhanced level
of rider safety and accident prevention.
Fig5.6: Robot
In critical industries where human presence is avoided there we can use robots which are
programmed to do a specific operation.
5.4.5 Computer networking:
Embedded systems are used as bridges routers etc..
That was a prerequisite for production of microprocessors, and the first computers were made by
adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the
volume of the package resulted in creation of integrated circuits. These integrated circuits contained both
processor and peripherals. That is how the first chip containing a microcomputer, or what would later be
known as a microcontroller came about.
The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was
developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash
memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used
by other microcontrollers at the time.
This mode has a limited frequency range and it cannot be used to drive other clock buffers. For
resonators, the maximum frequency is 8 MHz with CKOPT unprogrammed and 16 MHz with CKOPT
programmed. C1 and C2 should always be equal for both crystals and resonators. The optimal value of the
capacitors depends on the crystal or resonator in use, the amount of stray capacitance, and the
electromagnetic noise of the environment. For ceramic resonators, the capacitor values given by the
manufacturer should be used. The Oscillator can operate in three different modes, each optimized for a
specific frequency range. The operating mode is selected by the fuses CKSEL3..1
6.4 Architecture:
Memory: It has 8 Kb of Flash program memory (10,000 Write/Erase cycles durability), 512 Bytes of
EEPROM (100,000 Write/Erase Cycles). 1Kbyte Internal SRAM
I/O Ports: 23 I/ line can be obtained from three ports; namely Port B, Port C and Port D.
Interrupts: Two External Interrupt source, located at port D. 19 different interrupt vectors supporting 19
events generated by internal peripherals.
Timer/Counter: Three Internal Timers are available, two 8 bit, one 16 bit, offering various operating
modes and supporting internal or external clocking.
SPI (Serial Peripheral interface): ATmega8 holds three communication devices integrated. One of
them is Serial Peripheral Interface. Four pins are assigned to Atmega8 to implement this scheme of
communication.
USART: One of the most powerful communication solutions is USART and ATmega8 supports both
synchronous and asynchronous data transfer schemes. It has three pins assigned for that. In many projects,
this module is extensively used for PC-Micro controller communication.
TWI (Two Wire Interface): Another communication device that is present in ATmega8 is Two Wire
Interface. It allows designers to set up a commutation between two devices using just two wires along with
a common ground connection, As the TWI output is made by means of open collector outputs, thus
external pull up resistors are required to make the circuit.
Analog Comparator: A comparator module is integrated in the IC that provides comparison facility
between two voltages connected to the two inputs of the Analog comparator via External pins attached to
the micro controller.
Analog to Digital Converter: Inbuilt analog to digital converter can convert an analog input signal into
digital data of 10bit resolution. For most of the low end application, this much resolution is enough.
Device architecture
Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the need for external
memory in most applications. Some devices have a parallel external bus option to allow adding additional
data memory or memory-mapped devices. Almost all devices (except the smallest TinyAVR chips) have
serial interfaces, which can be used to connect larger serial EEPROMs or flash chips.
Program memory
Program instructions are stored in non-volatile flash memory. Although the MCUs are 8-bit, each
instruction takes one or two 16-bit words.
The size of the program memory is usually indicated in the naming of the device itself (e.g., the
ATmega64x line has 64 kB of flash while the ATmega32x line has 32 kB).
There is no provision for off-chip program memory; all code executed by the AVR core must reside in the
on-chip flash. However, this limitation does not apply to the AT94 FPSLIC AVR/FPGA chips.
Internal data memory
The data address space consists of the register file, I/O registers, and SRAM.
Internal registers
The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.
In most variants of the AVR architecture, the working registers are mapped in as the first 32
memory addresses (000016–001F16) followed by the 64 I/O registers (002016–005F16).
Actual SRAM starts after these register sections (address 0060 16). (Note that the I/O register space
may be larger on some more extensive devices, in which case the memory mapped I/O registers will
occupy a portion of the SRAM address space.)
Even though there are separate addressing schemes and optimized opcodes for register file and I/O register
access, all can still be addressed and manipulated as if they were in SRAM.
In the XMEGA variant, the working register file is not mapped into the data address space; as such,
it is not possible to treat any of the XMEGA's working registers as though they were SRAM. Instead, the
I/O registers are mapped into the data address space starting at the very beginning of the address space.
Additionally, the amount of data address space dedicated to I/O registers has grown substantially to 4096
bytes (000016–0FFF16). As with previous generations, however, the fast I/O manipulation instructions can
only reach the first 64 I/O register locations (the first 32 locations for bitwise instructions). Following the
I/O registers, the XMEGA series sets aside a 4096 byte range of the data address space which can be used
optionally for mapping the internal EEPROM to the data address space (1000 16–1FFF16). The actual
SRAM is located after these ranges, starting at 200016.
EEPROM
Almost all AVR microcontrollers have internal EEPROM for semi-permanent data storage. Like
flash memory, EEPROM can maintain its contents when electrical power is removed.
In most variants of the AVR architecture, this internal EEPROM memory is not mapped into the
MCU's addressable memory space. It can only be accessed the same way an external peripheral device is,
using special pointer registers and read/write instructions which makes EEPROM access much slower than
other internal RAM.
However, some devices in the SecureAVR (AT90SC) family use a special EEPROM mapping to
the data or program memory depending on the configuration. The XMEGA family also allows the
EEPROM to be mapped into the data address space.
Since the number of writes to EEPROM is not unlimited — Atmel specifies 100,000 write cycles in their
datasheets — a well designed EEPROM write routine should compare the contents of an EEPROM
address with desired contents and only perform an actual write if the contents need to be changed.
Note that erase and write can be performed separately in many cases, byte-by-byte, which may also
help prolong life when bits only need to be set to all 1s (erase) or selectively cleared to 0s (write).
Program execution
Atmel's AVRs have a two stage, single level pipeline design. This means the next machine
instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles,
making AVRs relatively fast among eight-bit microcontrollers.
The AVR processors were designed with the efficient execution of compiled C code in mind and have
several built-in pointers for the task.
MCU speed
The AVR line can normally support clock speeds from 0 to 20 MHz, with some devices reaching
32 MHz. Lower powered operation usually requires a reduced clock speed. All recent (Tiny, Mega, and
Xmega, but not 90S) AVRs feature an on-chip oscillator, removing the need for external clocks or
resonator circuitry. Some AVRs also have a system clock prescaler that can divide down the system clock
by up to 1024. This prescaler can be reconfigured by software during run-time, allowing the clock speed to
be optimized.
Since all operations (excluding literals) on registers R0 - R31 are single cycle, the AVR can
achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS. Loads and stores
to/from memory take two cycles, branching takes two cycles. Branches in the latest "3-byte PC" parts such
as ATmega2560 are one cycle slower than on previous devices
Features:
• High-performance, Low-power Atmel®AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions – Most Single-clock Cycle Execution
– 32 × 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16MIPS Throughput at 16MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 8Kbytes of In-System Self-programmable Flash program memory
– 512Bytes EEPROM
– 1Kbyte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
– Real Time Counter with Separate Oscillator
– Three PWM Channels
– 8-channel ADC in TQFP and QFN/MLF package
Eight Channels 10-bit Accuracy
– 6-channel ADC in PDIP package
Six Channels 10-bit Accuracy
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF
• Operating Voltages
– 2.7V - 5.5V (ATmega8L)
– 4.5V - 5.5V (ATmega8)
• Speed Grades
– 0 - 8MHz (ATmega8L)
– 0 - 16MHz (ATmega8)
• Power Consumption at 4Mhz, 3V, 25oC
– Active: 3.6mA
– Idle Mode: 1.0mA
– Power-down Mode: 0.5µA
Brown-out Detector:
If the Brown-out Detector is not needed in the application, this module should be turned off. If the
Brown-out Detector is enabled by the BODEN Fuse, it will be enabled in all sleep modes, and hence,
always consume power. In the deeper sleep modes, this will contribute significantly to the total current
consumption. Refer to “Brown-out Detection” on page 38 for details on how to configure the Brown-out
Detector.
Internal Voltage Reference the Internal Voltage Reference will be enabled when needed by the
Brown-out Detector, the Analog Comparator or the ADC. If these modules are disabled as described in the
sections above, the internal voltage reference will be disabled and it will not be consuming power. When
turned on again, the user must allow the reference to start up before the output is used. If the reference is
kept on in sleep mode, the output can be used immediately. Refer to “Internal Voltage Reference” on page
40 for details on the start-up time. Watchdog Timer If the Watchdog Timer is not needed in the
application, this module should be turned off.
If the Watchdog Timer is enabled, it will be enabled in all sleep modes, and hence, always
consume power. In the deeper sleep modes, this will contribute significantly to the total current
consumption. Refer to “Watchdog Timer” on page 41 for details on how to configure the Watchdog
Timer. Port Pins When entering a sleep mode, all port pins should be configured to use minimum power.
The most important thing is then to ensure that no pins drive resistive loads. In sleep modes where
the both the I/O clock (clkI/O) and the ADC clock (clkADC) are stopped, the input buffers of the device
will be disabled. This ensures that no power is consumed by the input logic when not needed. In some
cases, the input logic is needed for detecting wake-up conditions, and it will then be enabled. Refer to the
section “Digital Input Enable and Sleep Modes” on page 53 for details on which pins are enabled. If the
input buffer is enabled and the input signal is left floating or have an analog signal level close to VCC/2,
the input buffer will use excessive power.
Power-on Reset:
A Power-on Reset (POR) pulse is generated by an On-chip detection circuit. The detection level is
defined in Table 15. The POR is activated whenever VCC is below the detection level. The POR circuit
can be used to trigger the Start-up Reset, as well as to detect a failure in supply voltage.
A Power-on Reset (POR) circuit ensures that the device is reset from Power-on. Reaching the
Power-on Reset threshold voltage invokes the delay counter, which determines how long the device is kept
in RESET after VCC rise. The RESET signal is activated again, without any delay, when VCC decreases
below the detection level.
External Reset:
An External Reset is generated by a low level on the RESET pin. Reset pulses longer than the
minimum pulse width (see Table 15) will generate a reset, even if the clock is not running. Shorter pulses
are not guaranteed to generate a reset. When the applied signal reaches the Reset Threshold Voltage –
VRST on its positive edge, the delay counter starts the MCU after the time-out period tTOUT has expired.
6.5 Pin diagram:
VCC
Digital supply voltage magnitude of the voltage range between 4.5 to 5.5 V for the ATmega8 and 2.7 to
5.5 V for ATmega8L
GND
Ground Zero reference digital voltage supply.
PORTB (PB7.. PB0)
PORTB is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be selected. This port
output buffers have symmetrical characteristics when used as a source or sink. When used as an input, the
pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTB pins will be in the
condition of the tri-state when RESET is active, although the clock is not running.
PORTC (PC5.. PC0)
PORTC is a port I / O two-way (bidirectional) 7-bit with internal pull-up resistor can be selected. This port
output buffers have symmetrical characteristics when used as a source or sink. When used as an input, the
pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTC pins will be in the
condition of the tri-state when RESET is active, although the clock is not running.
PC6/RESET
If RSTDISBL Fuse programmed, PC6 then serves as a pin I / O but with different characteristics. PC0 to
PC5 If Fuse RSTDISBL not programmed, then serves as input Reset PC6. LOW signal on this pin with a
minimum width of 1.5 microseconds will bring the microcontroller into reset condition, although the clock
is not running.
PORTD (PD7.. PD0)
PORTD is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be selected. This port
output buffers have symmetrical characteristics when used as a source or sink. When used as an input, the
pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTD pins will be in the
condition of the tri-state when RESET is active, although the clock is not running.
RESET
Reset input pin. LOW signal on this pin with a minimum width of 1.5 microseconds will bring the
microcontroller into reset condition, although the clock is not running. Signal with a width of less than 1.5
microseconds does not guarantee a Reset condition.
AVCC
AVCC is the supply voltage pin for the ADC, PC3 .. PC0, and ADC7..ADC6. This pin should be
connected to VCC, even if the ADC is not used. If the ADC is used, AVCC should be connected to VCC
through a low-pass filter to reduce noise.
Aref
Analog Reference pin for the ADC.
ADC7 .. ADC6
ADC analog input there is only on ATmega8 with TQFP and QFP packages / MLF.
PORTS
Term "port" refers to a group of pins on a microcontroller which can be accessed simultaneously, or on
which we can set the desired combination of zeros and ones, or read from them an existing status.
Physically, port is a register inside a microcontroller which is connected by wires to the pins of a
microcontroller. Ports represent physical connection of Central Processing Unit with an outside world.
Microcontroller uses them
The Atmega8 has 23 I/O ports which are organized into 3 groups:
Port B (PB0 to PB7)
Port C (PC0 to PC6)
Port D (PD0 to PD7)
We will use mainly 3 registers known as DDRX, PORTX & PINX. We have total four PORTs on my
ATmega16. They are PORTA, PORTB, PORTC and PORTD. They are multifunctional pins. Each of
the pins in each port (total 32) can be treated as input or output pin.
Applications
AVR microcontroller perfectly fits many uses, from automotive industries and controlling home
appliances to industrial instruments, remote sensors, electrical door locks and safety devices. It is also
ideal for smart cards as well as for battery supplied devices because of its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage of
various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.). Low cost,
low consumption, easy handling and flexibility make ATmega8 applicable even in areas where
microcontrollers had not previously been considered (example: timer functions, interface replacement in
larger systems, coprocessor applications, etc.).
In System Programmability of this chip (along with using only two pins in data transfer) makes
possible the flexibility of a product, after assembling and testing have been completed. This capability can
be used to create assembly-line production, to store calibration data available only after final testing, or it
can be used to improve programs on finished products.
6.6 Regulated Power Supply:
A regulated power supply converts unregulated AC (Alternating Current) to a constant DC (Direct
Current). A regulated power supply is used to ensure that the output remains constant even if the input
changes. A regulated DC power supply is also known as a linear power supply; it is an embedded circuit
and consists of various blocks. The regulated power supply will accept an AC input and give a constant
DC output. The figure below shows the block diagram of a typical regulated DC power supply.
Fig 6.11 Circuit diagram of Regulated Power Supply with Led connection
The components mainly used in above figure are
230V AC MAINS
TRANSFORMER
BRIDGE RECTIFIER(DIODES)
CAPACITOR
VOLTAGE REGULATOR(IC 7805)
RESISTOR
LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as follows:
Transformation: The process of transforming energy from one device to another is called transformation.
For transforming energy we use transformers.
Step down transformer:
Incase of step down transformer, Primary winding induces more flux than the secondary
winding, and secondary winding is having less number of turns because of that it accepts less number of
flux, and releases less amount of voltage.
Capacitor Filtration:
The process of converting a pulsating direct current to a pure direct current using filters is
called as filtration. Electronic filters are electronic circuits, which perform signal-processing functions,
specifically to remove unwanted frequency components from the signal, to enhance wanted
ones.The Capacitor or sometimes referred to as a Condenser is a passive device, and one which stores
energy in the form of an electrostatic field which produces a potential (static voltage) across its plates. In
its basic form a capacitor consists of two parallel conductive plates that are not connected but are
electrically separated either by air or by an insulating material called the Dielectric. When a voltage is
applied to these plates, a current flows charging up the plates with electrons giving one plate a positive
charge and the other plate an equal and opposite negative charge this flow of electrons to the plates is
known as the Charging Current and continues to flow until the voltage across the plates (and hence the
capacitor) is equal to the applied voltage Vcc. At this point the capacitor is said to be fully charged and
this is illustrated below. The construction of capacitor and an electrolytic capacitor are shown in figures
3.3.9 and 3.3.10 respectively.
Voltage Regulation:
The process of converting a varying voltage to a constant regulated voltage is called as
regulation. For the process of regulation we use voltage regulators.
Voltage Regulator:
A voltage regulator (also called a ‘regulator’) with only three terminals appears to be a
simple device, but it is in fact a very complex integrated circuit. It converts a varying input voltage into a
constant ‘regulated’ output voltage. Voltage Regulators are available in a variety of outputs like 5V, 6V,
9V, 12V and 15V. The LM78XX series of voltage regulators are designed for positive input. For
applications requiring negative input, the LM79XX series is used. Using a pair of ‘voltage-divider’
resistors can increase the output voltage of a regulator circuit.
It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V
regulator to make a 5V power supply. Voltage regulators are very robust. These can withstand over-
current draw due to short circuits and also over-heating. In both cases, the regulator will cut off before any
damage occurs. The only way to destroy a regulator is to apply reverse voltage to its input. Reverse
polarity destroys the regulator almost instantly. Fig: 3.3.11 shows voltage regulator.
6.8 Buzzer
Basically, the sound source of a piezoelectric sound component is a piezoelectric diaphragm. A
piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides and a
metal plate (brass or stainless steel, etc.). A piezoelectric ceramic plate is attached to a metal plate with
adhesives. Applying D.C. voltage between electrodes of a piezoelectric diaphragm causes mechanical
distortion due to the piezoelectric effect. For a misshaped piezoelectric element, the distortion of the
piezoelectric element expands in a radial direction. And the piezoelectric diaphragm bends toward the
direction. The metal plate bonded to the piezoelectric element does not expand. Conversely, when the
piezoelectric element shrinks, the piezoelectric diaphragm bends in the direction Thus, when AC voltage is
applied across electrodes, the bending is repeated, producing sound waves in the air. To interface a buzzer
the standard transistor interfacing circuit is used. Note that if a different power supply is used for the
buzzer, the 0V rails of each power supply must be connected to provide a common reference.
If a battery is used as the power supply, it is worth remembering that piezo sounders
draw much less current than buzzers. Buzzers also just have one ‘tone’, whereas a
piezo sounder is able to create sounds of many different tones. To switch on buzzer -high 1 To switch off
buzzer -low 1
Pin description:
Circuit Description:
Above is the quite simple schematic. The LCD panel's Enable and Register Select is connected to
the Control Port. The Control Port is an open collector / open drain output. While most Parallel Ports have
internal pull-up resistors, there is a few which don't. Therefore by incorporating the two 10K external pull
up resistors, the circuit is more portable for a wider range of computers, some of which may have no
internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard wire the R/W
line of the LCD panel, into write mode. This will cause no bus conflicts on the data lines. As a result we
cannot read back the LCD's internal Busy Flag which tells us if the LCD has accepted and finished
processing the last instruction. This problem is overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As with all
the examples, I've left the power supply out. We can use a bench power supply set to 5v or use an onboard
+5 regulator. Remember a few de-coupling capacitors, especially if we have trouble with the circuit
working properly.
SETB RW
Handling the EN control line:
As we mentioned above, the EN line is used to tell the LCD that we are ready for it to execute an
instruction that we've prepared on the data bus and on the other control lines. Note that the EN line must
be raised/ lowered before/after each instruction sent to the LCD regardless of whether that instruction is
read or write text or instruction. In short, we must always manipulate EN when communicating with the
LCD. EN is the LCD's way of knowing that we are talking to it. If we don't raise/lower EN, the LCD
doesn't know we're talking to it on the other lines.
Thus, before we interact in any way with the LCD we will always bring the EN line low with the
following instruction:
CLR EN
And once we've finished setting up our instruction with the other control lines and data bus lines,
we'll always bring this line high:
SETB EN
The line must be left high for the amount of time required by the LCD as specified in its datasheet.
This is normally on the order of about 250 nanoseconds, but checks the datasheet. In the case of a typical
microcontroller running at 12 MHz, an instruction requires 1.08 microseconds to execute so the EN line
can be brought low the very next instruction. However, faster microcontrollers (such as the DS89C420
which executes an instruction in 90 nanoseconds given an 11.0592 MHz crystal) will require a number of
NOPs to create a delay while EN is held high. The number of NOPs that must be inserted depends on the
microcontroller we are using and the crystal we have selected.
The instruction is executed by the LCD at the moment the EN line is brought low with a final CLR
EN instruction.
The "Get LCD Status" command will return to us two tidbits of information; the information that is
useful to us right now is found in DB7. In summary, when we issue the "Get LCD Status" command the
LCD will immediately raise DB7 if it's still busy executing a command or lower DB7 to indicate that the
LCD is no longer occupied. Thus our program can query the LCD until DB7 goes low, indicating the LCD
is no longer busy. At that point we are free to continue and send the next command.
6.11 GSM
Global System for Mobile Communication (GSM)
Definition:
GSM, which stands for Global System for Mobile communications, reigns (important) as the
world’s most widely used cell phone technology. Cell phones use a cell phone service carrier’s GSM
network by searching for cell phone towers in the nearby area. Global system for mobile communication
(GSM) is a globally accepted standard for digital cellular communication.
GSM is the name of a standardization group established in 1982 to create a common
European mobile telephone standard that would formulate specifications for a pan-European mobile
cellular radio system operating at 900 MHz. It is estimated that many countries outside of Europe will join
the GSM partnership.
MODEM SPECIFICATIONS:
The SIM300 is a complete Tri-band GSM solution in a compact plug-in module.
Featuring an industry-standard interface, the SIM300 delivers GSM/GPRS900/1800/1900Mhz
performance for voice, SMS, data and Fax in a small form factor and with low power consumption.
The leading features of SIM300 make it deal fir virtually unlimited application, such as WLL applications
(Fixed Cellular Terminal), M2M application, handheld devices and much more.
1. Tri-band GSM/GPRS module with a size of 40x33x2.85
2. Customized MMI and keypad/LCD support
3. An embedded powerful TCP/IP protocol stack
4. Based upon mature and field proven platform, backed up by our support service, from definition to design
and production.
General Features:
Tri-band GSM/GPRS900/1800/1900Mhz
GPRS multi-slot class 10
GPRS mobile station class –B
Complaint to GSM phase 2/2+
i. -class 4(2W @900MHz)
ii. -class 1(1W @/18001900MHz)
Dimensions: 40x33x2.85 mm
Weight: 8gm
7. Control via AT commands
(GSM 07.07, 07.05 and SIMCOM enhanced AT commands)
SIM application tool kit
supply voltage range 3.5…….4.5 v
Low power consumption
Normal operation temperature: -20 ’C to +55 ‘C
Restricted operation temperature : -20 ’C to -25 ‘C and +55 ’C to +70 ‘C
storage temperature: -40 ‘C to +80 ‘C
The Global Positioning System (GPS) is a burgeoning technology, which provides unequalled
accuracy and flexibility of positioning for navigation, surveying and GIS data capture. The GPS
NAVSTAR (Navigation Satellite timing and Ranging Global Positioning System) is a satellite-based
navigation, timing and positioning system. The GPS provides continuous three-dimensional positioning 24
hrs a day throughout the world. The technology seems to be beneficiary to the GPS user community in
terms of obtaining accurate data up to about100 meters for navigation, meter-level for mapping, and down
to millimeter level for geodetic positioning. The GPS technology has tremendous amount of applications
in GIS data collection, surveying, and mapping.
The Global Positioning System (GPS) is a U.S. space-based radio navigation system that
provides reliable positioning, navigation, and timing services to civilian users on a continuous worldwide
basis -- freely available to all. For anyone with a GPS receiver, the system will provide location and time.
GPS provides accurate location and time information for an unlimited number of people in all weather,
day and night, anywhere in the world.
The Global Positioning System (GPS) is a satellite-based navigation system made up of a
network of 24 satellites placed into orbit by the U.S. Department of Defense. GPS was originally intended
for military applications, but in the 1980s, the government made the system available for civilian use. GPS
works in any weather conditions, anywhere in the world, 24 hours a day. There are no subscription fees or
setup charges to use GPS.
The GPS is made up of three parts: satellites orbiting the Earth; control and monitoring stations on Earth;
and the GPS receivers owned by users. GPS satellites broadcast signals from space that are picked up and
identified by GPS receivers. Each GPS receiver then provides three-dimensional location (latitude,
longitude, and altitude) plus the time.
Individuals may purchase GPS handsets that are readily available through commercial retailers.
Equipped with these GPS receivers, users can accurately locate where they are and easily navigate to
where they want to go, whether walking, driving, flying, or boating. GPS has become a mainstay of
transportation systems worldwide, providing navigation for aviation, ground, and maritime operations.
Disaster relief and emergency services depend upon GPS for location and timing capabilities in their life-
saving missions. Everyday activities such as banking, mobile phone operations, and even the control of
power grids, are facilitated by the accurate timing provided by GPS. Farmers, surveyors, geologists and
countless others perform their work more efficiently, safely, economically, and accurately using the free
and open GPS signals.
Geo positioning -- Basic Concepts:
By positioning we understand the determination of stationary or moving objects. These can be determined
as follows:
1. In relation to a well-defined coordinate system, usually by three coordinate values and
2. In relation to other point, taking one point as the origin of a local coordinate system.
The first mode of positioning is known as point positioning, the second as relative positioning. If the
object to be positioned is stationary, we term it as static positioning. When the object is moving, we call it
kinematics positioning. Usually, the static positioning is used in surveying and the kinematics position in
navigation.
This is a complete GPS module that is based on the NEO-6M. This unit uses the latest technology to give
the best possible positioning information and includes a larger built-in 25 x 25mm active GPS antenna
with a UART TTL socket. A battery is also included so that you can obtain a GPS lock faster. This is an
updated GPS module that can be used with ardupilot mega v2. This GPS module gives the best possible
position information, allowing for better performance with your Ardupilot or other Multirotor control
platform.
The NEO-6M GPS engine on this board is a quite good one, with the high precision binary output. It has
also high sensitivity for indoor applications. NEO-6M GPS Module has a battery for power backup and
EEPROM for storing configuration settings. The antenna is connected to the module through a ufl cable
which allows for flexibility in mounting the GPS such that the antenna will always see the sky for best
performance. This makes it powerful to use with cars and other mobile applications.
The GPS module has serial TTL output, it has four pins: TX, RX, VCC, and GND. You can download the
u-center software for configuring the GPS and changing the settings and much more.
The mercury displacement switch uses a 'plunger' that dips into a pool of mercury, raising the level
in the container to contact at least one electrode. This design is used in relays in industrial applications that
need to switch high current loads frequently. These relays use electromagnetic coils to pull steel sleeves
inside hermetically sealed containers.
Description:
Mercury switches have one or more sets of electrical contacts in a sealed glass envelope that contains a
small quantity of mercury. The envelope may also contain air, an inert gas, or a vacuum. Gravity
constantly pulls the drop of mercury to the lowest point in the envelope. When the switch is tilted in the
appropriate direction, the mercury touches a set of contacts, thus completing an electrical circuit. Tilting
the switch in the opposite direction moves the mercury away from that set of contacts, breaking that
circuit.[1] The switch may contain multiple sets of contacts, closing different sets at different angles,
allowing, for example, single-pole, double-throw (SPDT) operation.
Advantages
A dc motor uses electrical energy to produce mechanical energy, very typically through the
interaction of magnetic fields and current-carrying conductors. The reverse process, producing electrical
energy from mechanical energy, is accomplished by an alternator, generator or dynamo. Many types of
electric motors can be run as generators, and vice versa. The input of a DC motor is current/voltage and its
output is torque (speed).
The DC motor has two basic parts: the rotating part that is called the armature and the stationary
part that includes coils of wire called the field coils. The stationary part is also called the stator. Figure
shows a picture of a typical DC motor, Figure shows a picture of a DC armature, and Fig shows a picture
of a typical stator. From the picture you can see the armature is made of coils of wire wrapped around the
core, and the core has an extended shaft that rotates on bearings. You should also notice that the ends of
each coil of wire on the armature are terminated at one end of the armature. The termination points are
called the commutator, and this is where the brushes make electrical contact to bring electrical current
from the stationary part to the rotating part of the machine.
Operation:
The DC motor you will find in modem industrial applications operates very similarly to the simple
DC motor described earlier in this chapter. Figure 12-9 shows an electrical diagram of a simple DC
motor. Notice that the DC voltage is applied directly to the field winding and the brushes. The armature
and the field are both shown as a coil of wire. In later diagrams, a field resistor will be added in series
with the field to control the motor speed.
When voltage is applied to the motor, current begins to flow through the field coil from the
negative terminal to the positive terminal. This sets up a strong magnetic field in the field winding.
Current also begins to flow through the brushes into a commutator segment and then through an armature
coil. The current continues to flow through the coil back to the brush that is attached to other end of the
coil and returns to the DC power source. The current flowing in the armature coil sets up a strong
magnetic field in the armature.
The magnetic field in the armature and field coil causes the armature to begin to rotate. This
occurs by the unlike magnetic poles attracting each other and the like magnetic poles repelling each other.
As the armature begins to rotate, the commutator segments will also begin to move under the brushes. As
an individual commutator segment moves under the brush connected to positive voltage, it will become
positive, and when it moves under a brush connected to negative voltage it will become negative. In this
way, the commutator segments continually change polarity from positive to negative. Since the
commutator segments are connected to the ends of the wires that make up the field winding in the
armature, it causes the magnetic field in the armature to change polarity continually from North Pole to
South Pole. The commutator segments and brushes are aligned in such a way that the switch in polarity of
the armature coincides with the location of the armature's magnetic field and the field winding's magnetic
field. The switching action is timed so that the armature will not lock up magnetically with the field.
Instead the magnetic fields tend to build on each other and provide additional torque to keep the motor
shaft rotating.
When the voltage is de-energized to the motor, the magnetic fields in the armature and the field
winding will quickly diminish and the armature shaft's speed will begin to drop to zero. If voltage is
applied to the motor again, the magnetic fields will strengthen and the armature will begin to rotate again.
Types of DC motors:
1. DC Shunt Motor,
2. DC Series Motor,
The rotational energy that you get from any motor is usually the battle between two magnetic fields
chasing each other. The DC motor has magnetic poles and an armature, to which DC electricity is fed, The
Magnetic Poles are electromagnets, and when they are energized, they produce a strong magnetic field
around them, and the armature which is given power with a commutator, constantly repels the poles, and
therefore rotates.
In a 2 pole DC Motor, the armature will have two separate sets of windings, connected to a
commutator at the end of the shaft that are in constant touch with carbon brushes. The brushes are static,
and the commutator rotate and as the portions of the commutator touching the respective positive or
negative polarity brush will energize the respective part of the armature with the respective polarity. It is
usually arranged in such a way that the armature and the poles are always repelling.
The general idea of a DC Motor is, the stronger the Field Current, the stronger the magnetic field,
and faster the rotation of the armature. When the armature revolves between the poles, the magnetic field
of the poles induce power in the armature conductors, and some electricity is generated in the armature,
which is called back emf, and it acts as a resistance for the armature. Generally an armature has resistance
of less than 1 Ohm, and powering it with heavy voltages of Direct Current could result in immediate short
circuits. This back emf helps us there.
When an armature is loaded on a DC Shunt Motor, the speed naturally reduces, and therefore the
back emf reduces, which allows more armatures current to flow. This results in more armature field, and
therefore it results in torque.
When a DC Shunt Motor is overloaded, if the armature becomes too slow, the reduction of the
back emf could cause the motor to burn due to heavy current flow thru the armature.
The poles and armature are excited separately, and parallel, therefore it is called a Shunt Motor.
A DC Series Motor has its field coil in series with the armature. Therefore any amount of power
drawn by the armature will be passed thru the field. As a result you cannot start a Series DC Motor without
any load attached to it. It will either run uncontrollably in full speed, or it will stop.
Fig 3.9.6: Diagram of DC series motor graph representation
When the load is increased then its efficiency increases with respect to the load applied. So these
are on Electric Trains and elevators.
3. DC Compound Motor:
A compound of Series and Shunt excitation for the fields is done in a Compound DC Motor. This
gives the best of both series and shunt motors. Better torque as in a series motor, while the possibility to
start the motor with no load.
Above is the diagram of a long shunt motor, while in a short shunt, the shunt coil will be connected
after the serial coil.
A Compound motor can be run as a shunt motor without connecting the serial coil at all but not
vice versa.
ESP32-CAMERA
ESP32-CAM is the latest small size camera module released by Essence. The module can work
independently as the smallest system, with a size of only 27*40.5*4.5mm, and a deep sleep current as low
as 6mA.
ESP32-CAM can be widely used in various IoT applications, suitable for home smart devices, industrial
wireless control, wireless monitoring, QR wireless identification, wireless positioning system signals and
other IoT applications. It is an ideal solution for IoT applications .
ESP32-CAM adopts DIP package and can be used directly by plugging in the bottom plate, realizing the
rapid production of products, providing customers with high-reliability connection methods, which is
convenient for application in various IoT hardware terminal occasions.
The ESP32-CAM is a very small camera module with the ESP32-S chip that costs approximately Besides
the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that
can be useful to store images taken with the camera or to store files to serve to clients.
Features
ESP32-CAM Pinout
Product Features
Support TF card
Application scenarios
Wireless monitoring
Smart agriculture
QR wireless recognition
i
CHAPTER 7
SOFTWARE DESCRIPTION
The Arduino Software (IDE) makes it easy to write code and upload it to the board offline. We
recommend it for users with poor or no internet connection. This software can be used with any Arduino
board. here are currently two versions of the Arduino IDE, one is the IDE 2.0.0.
Selecting a board
7. Now, let's make sure that your board is found by the computer, by selecting the port. This is simply
done by navigating to Tools > Port, where you select your board from the list.
Opening an example
9. To upload it to your board, simply click on the arrow in the top left corner. This process takes a few
seconds, and it is important to not disconnect the board during this process. If the upload is successful, the
message "Done uploading" will appear in the bottom output area.
10. Once the upload is complete, you should then see on your board the yellow LED with an L next to it
start blinking. You can adjust the speed of blinking by changing the delay number in the parenthesis to
100, and upload the Blink sketch again. Now the LED should blink much faster.
The editor contains the four main areas:
1. A toolbar with buttons for common functions and a series of menus. The toolbar buttons allow you to
verify and upload programs, create, open, and save sketches, choose your board and port and open the
serial monitor.
2. The Sidebar for regularly used tools. It gives you quick access to board managers, libraries, debugging
your board as well as a search and replacement tool.
3. The text editor for writing your code.
4. Console controls gives control over the output on the console.
5. The text console displays text output by the Arduino Software (IDE), including complete error
messages and other information.
The bottom right-hand corner of the window displays the configured board and serial port.
#include <LiquidCrystal.h>
#include <stdio.h>
#include <SoftwareSerial.h>
#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "soc/soc.h" // disable brownout problems
#include "soc/rtc_cntl_reg.h" // disable brownout problems
#include "esp_http_server.h"
#elif defined(CAMERA_MODEL_AI_THINKER)
#include <LiquidCrystal.h>
#include <stdio.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(A4, A5);
char gpsval[50];
int i=0,k=0,lop=0;
int gps_status=0;
float latitude=0;
float logitude=0;
String Speed="";
String gpsString="";
char *test="$GPRMC";
int sti=0;
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
char eyes='c';
int eye_flag=0;
int cntlmk=0;
void setup()
{
Serial.begin(9600);//serialEvent();
mySerial.begin(9600);
pinMode(eye, INPUT);
pinMode(vib, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);pinMode(shifter, OUTPUT);
pinMode(relay, OUTPUT);
pinMode(cam_pin, INPUT);
digitalWrite(relay, LOW);
digitalWrite(buzzer, HIGH);
digitalWrite(relay, LOW);
digitalWrite(shifter, LOW);
lcd.begin(16, 2);lcd.cursor();
lcd.print("Helmet Drowsiness");
lcd.setCursor(0,1);
lcd.print("Detection System");
delay(2000);
digitalWrite(shifter, HIGH);
lcd.clear();lcd.print("Getting GPS");
//get_gps();
//gps_convert();
delay(15000);
digitalWrite(shifter, LOW);
lcd.clear();
lcd.setCursor(0,0);
for(ii=0;ii<=6;ii++) lcd.write(finallat[ii]);
lcd.setCursor(0,1);
for(ii=0;ii<=7;ii++) lcd.write(finallong[ii]);
delay(1500);
gsminit();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("E:"); //2-3-4-5-6,0
lcd.setCursor(8,0);
lcd.print("H:"); //10-11,0
lcd.setCursor(0,1);
lcd.print("V:"); //2-3-4-5-6,1
}
void loop()
{
if(digitalRead(eye) == HIGH)
{
lcd.setCursor(2,0);lcd.print("Open ");
eyes='o';
}
if(digitalRead(eye) == LOW)
{
eye_flag=0;
//lcd.setCursor(12,0);lcd.print("Open ");
lcd.setCursor(2,0);lcd.print(" ");
do{
delay(100);
eye_flag++;
lcd.setCursor(2,0);convertk(eye_flag);
if(eye_flag >= 40)
{
goto lpk;
}
}while(digitalRead(eye) == LOW);
lpk:
if(eye_flag >= 35)
{
eyes='c';
lcd.setCursor(2,0);lcd.print("Close");
digitalWrite(relay, LOW);
digitalWrite(buzzer, LOW);
delay(2000);
}
else{eyes='c';}
eye_flag=0;
}
if(eyes == 'c')
{eyes='x';
digitalWrite(relay,LOW);beep();
delay(5000); delay(4000);delay(5000);
Serial.write("AT+CMGS=\"");
Serial.write(pastnumber);
Serial.write("\"\r\n"); delay(3000);
Serial.write("Eye Close ");
Serial.write("https://www.google.co.in/search?client=opera&q=");
for(ii=0;ii<=6;ii++){Serial.write(finallat[ii]);}
Serial.write("%2C");
for(ii=0;ii<=7;ii++){Serial.write(finallong[ii]);}
Serial.write(0x1A);
delay(5000); delay(4000);
}
if(digitalRead(cam_pin) == LOW)
{
lcd.setCursor(10,0);lcd.print("Wear");
hels='w';
}
if(digitalRead(cam_pin) == HIGH)
{
lcd.setCursor(10,0);lcd.print("N.W ");
ctg++;
if(ctg >= 10)
{ctg=0;
hels='n';
beep();
}
}
if(digitalRead(vib) == LOW)
{
lcd.setCursor(2,1);lcd.print("ON ");
digitalWrite(relay,LOW);beep();
delay(5000); delay(4000);delay(5000);
Serial.write("AT+CMGS=\"");
Serial.write(pastnumber);
Serial.write("\"\r\n"); delay(3000);
Serial.write("Vib ON Accident ");
Serial.write("https://www.google.co.in/search?client=opera&q=");
for(ii=0;ii<=6;ii++){Serial.write(finallat[ii]);}
Serial.write("%2C");
for(ii=0;ii<=7;ii++){Serial.write(finallong[ii]);}
Serial.write(0x1A);
delay(4000); delay(4000); delay(5000);
}
if(digitalRead(vib) == HIGH)
{
lcd.setCursor(2,1);lcd.print("OFF");
}
delay(1000);
void okcheck()
{
unsigned char rcr;
do{
rcr = Serial.read();
}while(rcr != 'K');
}
void send_link()
{
Serial.write("AT+CMGS=\"");
Serial.write(pastnumber);
Serial.write("\"\r\n"); delay(2500);
Serial.write("https://www.google.co.in/search?client=opera&q=");
for(ii=0;ii<=6;ii++){Serial.write(finallat[ii]);}
Serial.write("%2C");
for(ii=0;ii<=7;ii++){Serial.write(finallong[ii]);}
Serial.write(0x1A);delay(4000);delay(4000);
}
void beep()
{
digitalWrite(buzzer,LOW);delay(2000);digitalWrite(buzzer,HIGH);
}
void serialEvent()
{
while(Serial.available())
{
char inChar = (char)Serial.read();
if(inChar == '*')
{
// gchr = Serial.read();
gchr = 's';
}
i
CHAPTER 10
CONCLUSION
In conclusion, the Smart Helmet for Drowsy Detection System presents a pioneering and
comprehensive solution aimed at significantly improving road safety. By incorporating advanced
technologies such as GPS, GSM, ESP CAM, and a Vibration Sensor, this innovative helmet
addresses a critical aspect of road accidents – drowsy driving. The inclusion of GPS allows for
precise real-time location tracking, providing an additional layer of safety and facilitating
emergency responses.
The GSM integration ensures instant communication capabilities, enabling the helmet to transmit
alerts promptly to predefined contacts. This real-time communication feature is crucial for timely
intervention and assistance when drowsiness is detected. The ESP CAM module introduces visual
data, offering valuable insights for in-depth analysis of the wearer's condition. The fusion of these
technologies creates a robust system capable of proactively identifying and preventing instances of
drowsiness.
A standout feature of the Smart Helmet is the utilization of a Vibration Sensor for accurate
drowsiness detection. This sensor, strategically placed within the helmet, monitors subtle
movements and vibrations associated with fatigue, contributing to the system's precision. Upon
detecting signs of drowsiness, the system triggers an immediate alert, ensuring timely intervention
to avert potential accidents.
In essence, this Smart Helmet represents more than just a wearable device; it embodies a
commitment to advancing road safety through the seamless integration of cutting-edge
technologies. By addressing the significant issue of drowsy driving, this comprehensive solution
strives to make a tangible impact on reducing accidents and promoting safer road experiences. The
fusion of GPS, GSM, ESP CAM, and the Vibration Sensor positions this Smart Helmet at the
forefront of innovative safety measures, paving the way for enhanced protection and well-being of
road users.
REFERENCES
[1] http://timesofindia.indiatimes.com/toireporter/author- Dipak-K–Dash–479213512.cms
[2] http://timesofindia.indiatimes.com/toireporter/author- Dipak-K–Dash–10519.cms
[3] Rattapoom Waranusast, Nannaphat Bundon, Vasan Timtong and Chainaron Tangnoi,“Machine
Vision Techniques for Motorcycle Safety Helmet Detection,” 2013,28th International Conference
on Image and Vision Computing New Zealand.
[4] Romuere Silva, Kelson Aires, Thiago Santos, Kalyf Abdala, Rodrigo Veras “Atomatic detection
of motorcyclists without Helmet,”Departamento de Computaco Universidade Federal do Piaui
Teresina, Brazil. [5] Ping Li, Ramy Meziane, Martin J,Hassan Ezzaidi,Philippe Cardou, “A Smart
Safety Helmet using IMU and EEG sensors for worker fatigue detection,” REPARTI Center, Laval
University Quebec,Canada.
[6] Manjesh N, Prof. Sudarshan Raj,”Smart Helmet Using GSM &GPS Technology for Accident
Detection and Reporting System,” International Journal of Electrical and Electronics Research
ISSN 2348-6988 (online) Vol. 2, Issue 4.
[7] Mohd Khairul Afiq Mohd Rasli, Nina Korlina Madzhi, Juliana Johari ,“Smart Helmet Sensors
for Accident Prevention,” 2013 International Conference on Electrical Electronics and System
Engineering.
[8] Faezah Binti Hashim, “Intelligent Safety Helmet For Motorcyclist,” Faculty of Electronic and
Computer Engineering Universiti Teknikal Malaysia Melaka,2011.