SWATHI FINAL DOCUMENT (2) (1)
SWATHI FINAL DOCUMENT (2) (1)
SWATHI FINAL DOCUMENT (2) (1)
CHAPTER-1
INTRODUCTION
1.1 Introduction to Embedded Systems:
Embedded Systems are electronic systems that incorporate microprocessors or
microcontrollers within their implementations. The main purpose of using microprocessors or
microcontrollers is to perform the given task in a short span of time which improves the speed
and performance of the system. Having a microprocessor in the device means that removing
the bugs, making modifications, or adding new features are only matters of rewriting the
software that controls the device. Embedded Systems that include a microprocessor or
microcontroller to perform a specific dedicated application.
Embedded Systems are ubiquitous. Every week millions of tiny computer chips come pouring
out of factories finding their way into our everyday products. Embedded Systems are self-
contained programs that are embedded within a piece of hardware. Whereas a regular computer
has many different applications and software that can be applied to various tasks, Embedded
Systems are usually set to a specific task that cannot be altered without physically manipulating
the circuitry. Another way to think of an Embedded System is as a computer system created
with optimal efficiency, allowing it to complete specific functions as quickly as possible.
Embedded Systems technologies are usually expensive in the case of industrial applications.
Embedded Systems designers usually have a significant grasp of hardware technologies. They
used specific programming languages and software to develop Embedded Systems and
manipulate the equipment small businesses may wish to hire a consultant to determine what
sort of Embedded Systems will add value to your organization. An Embedded System is a
system that is going todo a predefined specified task is the Embedded System and is even
defined as combination of both software and hardware.
A general-purpose definition of Embedded Systems is that they are devices used to control,
monitor or assist the operation of equipment, machinery or plant. "Embedded" reflects the fact
that they are an integral part of the system. Having a microprocessor in the device means that
removing the bugs, making modifications, or adding new features are only matters of rewriting
the software that controls the device. Embedded Systems that include a microprocessor or
microcontroller to perform a specific dedicated application.
Some of these computers are however very simple systems as compared with a personal
computer. The very simplest Embedded Systems can perform only a single function or set of
functions to meet a single predetermined purpose. In more complex systems an application
program that enables the Embedded System to be used for a particular purpose in a specific
application determines the functioning of the Embedded System. The ability to have programs
means that the same Embedded System can be used for a variety of different purposes. In some
cases, a microprocessor may be designed in such a way that application software for a particular
purpose can be added to the basic software in a second process, after which it is not possible to
make further changes. The application software on such processors is sometimes referred to as
firmware. Specialized development tools and environments are used to design, program, and
debug embedded systems. These tools include integrated development environments (IDEs),
compilers, debuggers, and hardware emulators tailored to the specific microcontroller or
microprocessor architecture. The simplest devices consist of a single microprocessor (often
called a ―chip‖), which may itself be packaged with other chips in a hybrid system or
Application Specific Integrated Circuit (ASIC). Its input comes from a detector or sensor and
its output goes to a switch or activator which (for example) may start or stop the operation of
a machine or, by operating a valve, may control the flow of fuel to an engine.Software deals
with the languages like ALP, Embedded C, etc., and Hardware deals with Processors,
Peripherals, and Memory. Their ability to perform specialized tasks efficiently, reliably, and
often in real- time makes them indispensable in today's interconnected world.
Memory: It is used to store data or code
Peripherals: These are the external devices connected.
Processor: It is an IC which is used to perform some tasks.
Embedded Systems designers usually have a significant grasp of hardware technologies. They
used specific programming languages and software to develop Embedded Systems and
manipulate the equipment small businesses may wish to hire a consultant to determine what
sort of Embedded Systems will add value to your organization. An Embedded System is a
system that is going todo a predefined specified task is the Embedded System and is even
defined as combination of both software and hardware. . The application software on such
processors is sometimes referred to as firmware.
Transport
Domestic service
Communications
CHAPTER 2
OVERVIEW OF THE PROJECT
3. Software Configuration:
4. Install the necessary libraries and dependencies for interfacing with sensors and
actuators on the NodeMCU.
5. Set up the NodeMCU to establish Wi-Fi connectivity for data transmission and
communication with external devices.
6. Driver Identification:
7. Implement code to monitor touch sensors attached to the steering wheel to detect driver
presence and grip.
8. Develop logic to verify driver identity based on touch sensor inputs before enabling
vehicle operation.
9. Alcohol Detection: Interface the alcohol sensor with the NodeMCU and implement
code to read alcohol levels from the sensor.
10. Set threshold levels for detecting alcohol presence and integrate logic to prevent
vehicle operation if the threshold is exceeded.
11. Crash Detection:Configure limit switches as crash sensors and connect them to the
NodeMCU.
12. Develop code to monitor limit switch inputs and trigger emergency braking or evasive
maneuvers in the event of a collision.
13. Object Detection with YOLO Algorithm:
14. Set up a laptop with a webcam and install the necessary software libraries for image
processing and object detection.
15. Integrate the YOLO algorithm into the system to analyze real-time video footage
Alert System:
1. Implement an alert system to notify the driver in case of detected obstacles, driver
impairment, or collision.
2. Develop code to trigger audible and visual alerts using buzzers, LEDs, or display
screens integrated into the vehicle dashboard.
3. User Interface:
4. Design and develop a user-friendly interface for the driver to interact with the system.
5. Implement features for configuring system settings, monitoring sensor data, and
receiving alerts in real-time.
CHAPTER 3
LITERATURE REVIEW
3.1 Existing System 1:
Title : Implementation of Wireless black box using MEMS accelerometer and GPS tracking
for accidental monitoring of vehicle.
Author: A. Gunadal, A. Koujalagi, S. Karavade, and S. Konnuri.
Conference: Proceedings of 2012 IEEE-EMBS International Conference on Biomedical and
Health Informatics.
Objective:
In this work, wireless black box using MEMS accelerometer and GPS tracking system is
developed for accidental monitoring. The system consists of cooperative components of an
accelerometer, microcontroller unit, GPS device and GSM module. In the event of accident,
this wireless device will send mobile phone short massage indicating the position of vehicle by
GPS system to family member, emergency medical service (EMS) and nearest hospital. The
threshold algorithm and speed of motorcycle are used to determine fall or accident in real-time.
The system is compact and easy to install under rider seat. The system has been tested in real
world applications using bicycles. The test results show that it can detect linear fall, non-linear
fall and normal ride with high accuracy.
Fig. 3.1 Block diagram of Wireless black box using MEMS accelerometer and GPS tracking
for accidental monitoring of vehicle.
Result:
The Wireless Black Box using MEMS accelerometer and GPS tracking for accidental
monitoring of vehicles project successfully implemented a comprehensive solution to prevent
accidents caused by driver negligence, impairment, or external hazards. The system employed
real-time object detection, driver authentication, alcohol detection, and crash prevention
measures to ensure the safety of the driver and the surrounding environment. The wireless black
box technology and MEMS accelerometer-GPS tracking capabilities enabled accurate
monitoring and analysis of vehicle data, while the user-friendly interface provided drivers with
real-time alerts and feedback. Rigorous testing and calibration were conducted to ensure the
reliability and accuracy of the system, and real-world trials demonstrated the effectiveness of
the system in preventing accidents and enhancing road safety. Overall, the Accident Prevention
and Alert System represents a significant advancement in road safety technology, offering a
comprehensive solution to mitigate the risks associated with road travel and contributing to
safer roads and reduced accident rates.
Disadvantages:
Wireless Black Box using MEMS accelerometer and GPS tracking for accidental
monitoring of vehicles include:
Potential for false alarms or incorrect data interpretation
Privacy concerns around data collection and storage
Risk of over-reliance on the system by drivers.
Fig 3.2 Block diagram of Motorcycle Detection and Tracking System with Occlusion
Segmentation.
Result:
The Motorcycle Detection and Tracking System with Occlusion Segmentation was
able to reliably detect and track motorcycles in a video stream using deep learning and
computer vision techniques. The system was able to maintain accurate tracking even in
situations with occlusions and complex backgrounds. The use of occlusion segmentation and
centroid tracking helped to improve the robustness of the motorcycle tracking, resulting in a
more reliable and accurate system.
Disadvantages:
Motorcycle Detection and Tracking System with Occlusion Segmentation what is the
disadvantages in four lines
The Motorcycle Detection and Tracking System with Occlusion Segmentation has some
disadvantages, which include:
1. Limited accuracy: The system relies on the accuracy of the GPS tracking and MEMS
accelerometer. Inaccurate readings from these sensors can lead to incorrect data and
inaccurate alerts.
2. Battery life: The system requires a battery to power the MEMS accelerometer and GPS
tracking. The battery life may be limited, requiring frequent recharging or replacement.
3. Cost: The system requires the purchase of components such as the MEMS
accelerometer, GPS tracking device, and battery. This may be a barrier to entry for some
users.
4. False positives: The system may generate false alerts if it misinterprets the data from
the MEMS accelerometer or GPS tracking device. This could lead to unnecessary
distress for the driver.
5. Privacy concerns: The system collects and stores data about the driver's location and
behavior. This may raise privacy concerns for some users.
Fig 3.3 Block diagram of Hybrid Deep Learning Signature based Correlation Filter for Vehicle
Tracking in Presence of Clutters and Occlusion
It utilizes a kernel and particle-based filter with an aggregation signature that is constructed
with a deep learning model in the frequency domain to estimate the target vehicle's position.
The proposed method also includes a fuzzy adaptive background modeling and subtraction
algorithm
Result:
The Hybrid Deep Learning Signature based Correlation Filter for Vehicle Tracking in Presence
of Clutters and Occlusion provides a tracking accuracy improvement of 3% compared to
existing tracking methods. It utilizes a kernel and particle-based filter with an aggregation
signature that is constructed with a deep learning model in the frequency domain to estimate
the target vehicle's position. The proposed method also includes a fuzzy adaptive background
modeling and subtraction algorithm to remove background clutters affecting the tracking
performance. This results in improved tracking accuracy in challenging environments.
Disadvantages:
The method may have a high computational cost due to the use of both kernel and particle-
based filter.The effectiveness of the method may be affected by the quality of the deep learning
model used in the frequency domain.The performance of the proposed method may be affected
by the complexity of the scene and the number of clutters and occlusions.The implementation
of the fuzzy adaptive background modeling and subtraction algorithm may require a high level
of expertise in this field.
1. Limited Functionality: The system is designed specifically for accident detection and
notification, which limits its functionality in comparison to more advanced systems that offer
additional safety features in modern vehicles.
2. Dependence on Sensor Accuracy: The accuracy of the system depends on the proper
functioning of various sensors, such as accelerometers, GPS, and alcohol sensors. Failure in
these sensors can lead to inaccurate or unreported accidents.
3. Limited Compatibility: The system may not be compatible with other systems in use or newer
vehicle models. This can lead to increased cost for consumers and potential limitations on the
system's usability.
4. Maintenance: Regular maintenance of the sensors and system components can be required to
ensure system performance and prevent false alerts.
Privacy Concerns: Real-time data sharing of the vehicle's location and other details can lead to
privacy concerns.
5. High Cost: The system might be expensive to install and maintain, especially for users who
cannot take advantage of the subsidy and other support schemes.
Fig 3.4 Block diagram of Automatic Vehicle Accident Detection and Messaging System
Using GSM and GPS Module
Result:
This project presents vehicle accident detection and alert system with SMS to the user defined
mobile numbers. The GPS tracking and GSM alert based algorithm is designed and
implemented with ATmega 8A MCU in embedded system domain. The proposed Vehicle
accident detection system can track geographical information automatically and sends an alert
SMS regarding accident. Experimental work has been carried out carefully. The result shows
that higher sensitivity and accuracy is indeed achieved using this project. EEPROM is
interfaced to store the mobile numbers permanently. This made the project more user-friendly
and reliable. The proposed method is verified to be highly beneficial for the automotive industry
Disadvantages:
The automatic vehicle accident detection and messaging system has the following
disadvantages:
1. Limited Functionality: The system is designed specifically for accident detection and
notification, which limits its functionality in comparison to more advanced systems that offer
additional safety features in modern vehicles.
2. Dependence on Sensor Accuracy: The accuracy of the system depends on the proper
functioning of various sensors, such as accelerometers, GPS, and alcohol sensors. Failure in
these sensors can lead to inaccurate or unreported accidents.
3. Limited Compatibility: The system may not be compatible with other systems in use or newer
vehicle models. This can lead to increased cost for consumers and potential limitations on the
system's usability.
4. Maintenance: Regular maintenance of the sensors and system components can be required to
CHAPTER 4
PROPOSED SYSTEM
4.1 Introduction:
Accidents on roads are a significant concern globally, leading to loss of lives and
property. To address this issue, we propose an Accident Prevention and Alert System designed
to enhance safety measures in vehicles. The system utilizes NodeMCU, DC motors with L298
motor driver, limit switches as crash sensors, touch sensors for driver identification bydetecting
if the driver is holding the steering wheel, and alcohol sensors. It incorporates advanced
computer vision techniques, specifically the YOLO (You Only Look Once) algorithm, to detect
objects in front of the vehicle using a laptop webcam.The system ensures vehicle operation
only when specific conditions are met, including verifying if the driver is holding the steering
wheel through touch sensors and ensuring sobriety through alcohol sensors. Upon verification,
the vehicle starts, and real-time monitoring using the YOLO algorithm identifies potential
obstacles in the vehicle's path. In the event of an obstacle detection, the system promptly alerts
the driver, preventing potential accidents.By integrating hardware components, machine
learning algorithms, and real-time object detection, the proposed system offers a comprehensive
solution to enhance road safety and prevent accidents. This innovative approach empowers
drivers with proactive measures to mitigate risks, ensuring safer road travel and reducing the
occurrence of accidents.
4.2 Working Principle:
Our proposed Accident Prevention and Alert System is a comprehensive solution designed to
address the shortcomings of existing methods by integrating advanced technologies for real-
time monitoring, proactive intervention, and comprehensive accident prevention measures. The
system consists of the following components:
NodeMCU and DC Motors with L298 Motor Driver: The NodeMCU serves as the central
control unit, interfacing with various sensors and actuators. DC motors with L298 motor drivers
are utilized for vehicle control, enabling responsive maneuvering based on real-time inputs.
Limit Switches as Crash Sensors: Limit switches are strategically placed to detect collisions
Touch Sensors for Driver Identification: Touch sensors are installed on the steering wheel to
detect the presence and grip of the driver. This ensures that only authorized individuals are
CHAPTER 5
HARDWARE IMPLEMENTATION
5.1 NodeMCU ESP8266:
GPIO GPIO1 to NodeMCU has 16 general purpose input-output pins on its board
Pins GPIO16
SPI Pins SD1, CMD, NodeMCU has four pins available for SPI communication.
SD0, CLK
UART TXD0, NodeMCU has two UART interfaces, UART0 (RXD0 & TXD0)
Pins RXD0, and UART1 (RXD1 & TXD1). UART1 is used to upload the
TXD2, firmware/program.
RXD2
I2C NodeMCU has I2C functionality support but due to the internal
Pins functionality of these pins, you have to find which pin is I2C.
Table .5.1 Table of NodeMCU Development Board Pinout Configuration
Fig. 5.6 Motor Mounting Clamp and Position Encoder Kit for Centre Shaft Economy
Centre Shaft Economy Series DC Motor is high quality low cost DC geared motor. It has steel
gears and pinions to ensure longer life and better wear and tear properties. The gears are fixed
on hardened steel spindles polished to a mirror finish. The output shaft rotates in a plastic
bushing. The whole assembly is covered with a plastic ring. Gearbox is sealed and lubricated
with lithium grease and require no maintenance. The motor is screwed to the gear box from
inside.Although motor gives 60 RPM at 12V but motor runs smoothly from 4V to 12V and
gives wide range of RPM, and torque. Tables below gives fairly good idea of the motor‘s
performance in terms of RPM and no load current as a function of voltage and stall torque, stall
current as a function of voltage. and pinions to ensure longer life and better wear and tear
properties. The gears are fixed on hardened steel spindles polished to a mirror finish. The output
shaft rotates in a plastic bushing. The whole assembly is covered with a plastic ring. Gearbox
is sealed and lubricated with lithium grease and require no maintenance. The motor is screwed
Although motor gives 60 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide
range of RPM, and torque. steel spindles polished to a mirror finish. The output shaft rotates in
a plastic bushing. The whole assembly is covered with a plastic ring. Gearbox is sealed and
lubricated with lithium grease and require no maintenance. current as a function of voltage and
stall torque, stall current as a function of voltage. and pinions to ensure longer life and better
wear and tear properties. The gears are fixed on hardened steel spindles polished
This L298N Motor Driver Module is a high power motor driver module for driving DC and
Stepper Motors. This module consists of an L298 motor driver IC and a 78M05 5V regulator.
L298N Module can control up to 4 DC motors, or 2 DC motors with directional and speed
control.
IN1 & IN2 Motor A input pins. Used to control the spinning direction of Motor A
IN3 & IN4 Motor B input pins. Used to control the spinning direction of Motor B
Fig.5.7 Buzzer
is a simple buzzer which when powered will make a Continuous Beeeeeeppp.... sound, the
other type is called a readymade buzzer which will look bulkier than this and will produce a
Beep. Beep. Beep. Sound due to the internal oscillating circuit present inside it. But, the one
shown here is most widely used because it can be customised with help of other circuits to fit
easily in our application.This buzzer can be used by simply powering it using a DC power
supply ranging from 4V to 9V. A simple 9V battery can also be used, but it is recommended to
use a regulated +5V or +6V DC supply. The buzzer is normally associated with a switching
circuit to turn ON or turn OFF the buzzer at required time and require interval.
CHAPTER-6
SOFTWARE DESCRIPTION
6.1 ARDUINO IDE:
The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a
text editor for writing code, a message area, a text console, a toolbar with buttons for common
functions and a series of menus. It connects to the Arduino and Genuino hardware to upload
programs and communicate with them.
Writing Sketches
Programs written using Arduino Software (IDE) are called sketches. These sketches are written
in the text editor and are saved with the file extension .ino. The editor has features for
cutting/pasting and for searching/replacing text. The message area gives feedback while saving
and exporting and also displays errors. The console displays text output by the Arduino
Software (IDE), including complete error messages and other information. The bottom
righthand corner of the window displays the configured board and serial port. The toolbar
buttons allow you to verify and upload programs, create, open, and save sketches, and open the
serial monitor.
6.1.1 File:
1. New [Text Wrapping Break]Creates a new instance of the editor, with the bare
minimum structure of a sketch already in place.
2. Open [Text Wrapping Break]Allows to load a sketch file browsing through the
computer drives and folders.
3. Open Recent [Text Wrapping Break]Provides a short list of the most recent sketches,
ready to be opened.
4. Sketchbook [Text Wrapping Break]Shows the current sketches within the sketchbook
folder structure; clicking on any name opens the corresponding sketch in a new editor
instance.
5. Examples [Text Wrapping Break]Any example provided by the Arduino Software
(IDE) or library shows up in this menu item. All the examples are structured in a tree
that allows easy access by topic or library.
Save [Text Wrapping Break]Saves the sketch with the current name. If the file hasn't
been named before, a name will be provided in a "Save as.." window.
Save as... [Text Wrapping Break]Allows to save the current sketch with a different
name.
Page Setup [Text Wrapping Break]It shows the Page Setup window for printing.
Print [Text Wrapping Break]Sends the current sketch to the printer according to the
settings defined in Page Setup.
Preferences [Text Wrapping Break]Opens the Preferences window where some settings
of the IDE may be customized, as the language of the IDE interface.
Quit [Text Wrapping Break]Closes all IDE windows. The same sketches open when
Quit was chosen will be automatically reopened the next time you start the IDE.
6.1.2 Edit:
1. Undo/Redo [Text Wrapping Break]Goes back of one or more steps you did while editing;
when you go back, you may go forward with Redo.
2. Cut [Text Wrapping Break]Removes the selected text from the editor and places it into the
clipboard.
3. Copy [Text Wrapping Break]Duplicates the selected text in the editor and places it into the
clipboard.
4. Copy for Forum [Text Wrapping Break]Copies the code of your sketch to the clipboard in
a form suitable for posting to the forum, complete with syntax coloring.
5. Copy as HTML [Text Wrapping Break]Copies the code of your sketch to the clipboard as
HTML, suitable for embedding in web pages.
6. Paste [Text Wrapping Break]Puts the contents of the clipboard at the cursor position, in the
editor.
7. Select All [Text Wrapping Break]Selects and highlights the whole content of the editor.
8. Comment/Uncomment [Text Wrapping Break]Puts or removes the // comment marker at
the beginning of each selected line.
9. Increase/Decrease Indent [Text Wrapping Break]Adds or subtracts a space at the beginning
of each selected line, moving the text one space on the right or eliminating a space at the
beginning.
10. Find [Text Wrapping Break]Opens the Find and Replace window where you can specify
text to search inside the current sketch according to several options.
11. Find Next [Text Wrapping Break]Highlights the next occurrence - if any - of the string
specified as the search item in the Find window, relative to the cursor position.
12. Find Previous [Text Wrapping Break]Highlights the previous occurrence - if any - of the
string specified as the search item in the Find window relative to the cursor position.
6.1.3 Sketch:
1. Verify/Compile [Text Wrapping Break]Checks your sketch for errors compiling it; it
will report memory usage for code and variables in the console area.
2. Upload [Text Wrapping Break]Compiles and loads the binary file onto the configured
board through the configured Port.
3. Upload Using Programmer [Text Wrapping Break]This will overwrite the bootloader
on the board; you will need to use Tools > Burn Bootloader to restore it and be able to
Upload to USB serial port again. However, it allows you to use the full capacity of the
Flash memory for your sketch. Please note that this command will NOT burn the fuses.
To do so a Tools -> Burn Bootloader command must be executed.
4. Export Compiled Binary [Text Wrapping Break]Saves a .hex file that may be kept as
archive or sent to the board using other tools.
5. Show Sketch Folder [Text Wrapping Break]Opens the current sketch folder.
6. Include Library [Text Wrapping Break]Adds a library to your sketch by inserting
#include statements at the start of your code. For more details, see libraries below.
Additionally, from this menu item you can access the Library Manager and import new
libraries from .zip files.
7. Add File... [Text Wrapping Break]Adds a source file to the sketch (it will be copied
from its current location). The new file appears in a new tab in the sketch window. Files
can be removed from the sketch using the tab menu accessible clicking on the small
triangle icon below the serial monitor one on the right side o the toolbar.
6.1.4 Tools:
1. Auto Format [Text Wrapping Break]This formats your code nicely: i.e. indents it so
that opening and closing curly braces line up, and that the statements inside curly braces
are indented more.
2. Archive Sketch [Text Wrapping Break]Archives a copy of the current sketch in .zip
format. The archive is placed in the same directory as the sketch.
3. Fix Encoding & Reload [Text Wrapping Break]Fixes possible discrepancies between
the editor char map encoding and other operating systems char maps.
4. Serial Monitor [Text Wrapping Break]Opens the serial monitor window and initiates
the exchange of data with any connected board on the currently selected Port. This
usually resets the board, if the board supports Reset over serial port opening.
5. Board [Text Wrapping Break]Select the board that you're using. See below for
descriptions of the various boards.
6. Port [Text Wrapping Break]This menu contains all the serial devices (real or virtual)
on your machine. It should automatically refresh every time you open the top-level tools
menu.
7. Programmer [Text Wrapping Break]For selecting a harware programmer when
programming a board or chip and not using the onboard USB-serial connection.
Normally you won't need this, but if you're burning a bootloader to a new
microcontroller, you will use this.
8. Burn Bootloader [Text Wrapping Break]The items in this menu allow you to burn
a bootloader onto the microcontroller on an Arduino board. This is not required for
normal use of an Arduino or Genuino board but is useful if you purchase a new
ATmega microcontroller (which normally come without a bootloader). Ensure that
you've selected the correct board from the Boards menu before burning the bootloader
on the target board. This command also set the right fuses. Opens the serial monitor
window and initiates the exchange of data with any connected board on the currently
selected Port. This usually resets the board, if the board supports Reset over serial port
opening
6.1.5 Help:
Here you find easy access to a number of documents that come with the Arduino Software
(IDE). You have access to Getting Started, Reference, this guide to the IDE and other
documents locally, without an internet connection. The documents are a local copy of the online
ones and may link back to our online website.
Find in Reference [Text Wrapping Break]This is the only interactive function of the help
6.2 Arduino IDE: Initial Setup
This is the Arduino IDE once it‘s been opened. It opens into a blank sketch where you can start
programming immediately. First, we should configure the board and port settings to allow us
to upload code. Connect your Arduino board to the PC via the USB cable.
there is a recognized Arduino Board, it will also give it‘s name. Select the Arduino board that
you have connected to the PC. If the setup was successful, in the bottom right of the Arduino
IDE, you should see the board type and COM number of the board you plan to program. Note:
the Arduino Uno occupies the next available COM port; it will not always be COM3.
6.2.2 Testing Your Settings:
Uploading Blink One common procedure to test whether the board you are using is properly
set up is to upload the ―Blink‖ sketch. This sketch is included with all Arduino IDE releases
and can be accessed by the File pull-down menu and going to Examples, 01.Basics, and then
select Blink . Standard Arduino Boards include a surface-mounted LED labeled ―L‖ or ―LED‖
next to the ―RX‖ and ―TX‖ LEDs, that is connected to digital pin 13. This sketch will blink the
LED at a regular interval, and is an easy way to confirm if your board is set up properly and
you were successful in uploading code. Open the ―Blink‖ sketch and press the ―Upload‖ button
in the upper-left corner to upload ―Blink‖ to the board.
6.3 PROTEUS:
Generally we are listening the words PCB’s, PCB layout, PCB designing, ect. But
what is PCB? Why we are using this PCB? We want to know about all these things as a
electronic engineer. PCB means Printed Circuit Board. This is a circuit board with printed
copper layout connections. These PCB‘s are two types. One is dotted PCB and another one is
layout PCB. The two examples are shown in below.
What is the main difference between the dotted PCB and layout PCB? In dotted PCB board
only dots are available. According to our requirement we can place or insert the components in
those holes and attach the components with wires and soldering lid. In this dotted PCB we can
make the circuit as out wish but it is very hard to design. There are so many difficulties arethere.
Those are connecting the proper pins, avoiding shot connections and etc. Coming to thelayout
PCB this is simple to design. First we select the our circuit and by using different PCB designing
software‘s, design the layout of the circuit and by itching process preparing the copper layout
of our circuit and solder the components in the correct places. It is simple to design, take less
time to design, no shortages, looking nice and perfect.
Up to now we have discussed about types of PCB‘s and difference between the types. Now we
can discuss about PCB designing software. There are so many PCB designing softwares
available. Some are Express PCB, eagle PCB, PCB Elegance, free PCB, open circuit design,
zenith PCB andProteus etc. Apart from remaining Proteus is different. Proteus is designsuit and
PCB layout designing software. In Proteus we can design any circuit and simulate the circuit
and make PCB layout for that circuit.
6.3.1 Introduction to Proteus:
Proteus professional is a software combination of ISIS schematic capture program and ARES
PCB layout program. This is a powerful and integrated development environment. Tools in this
suit are very easy to use and these tools are very useful in education and professional PCB
designing. As professional PCB designing software with integrated space based auto router, it
provides features such as fully featured schematic capture, highly configurable design rules,
interactive SPICE circuit simulator.
extensive support for power planes, industry standard CADCAM & ODB++ output and
integrated 3D viewer.
Up to know we have discussed about the basics and software description. Now we are entering
into the designing section. Run the ISIS professional program by clicking the icon on the
desktop, then this splash screen will appear.
Next, a work space with interface buttons for designing circuit will appear as shown in figure
below. Note that there is a blue rectangular line in the workspace; make sure that whole circuit
is designed inside the rectangular space.
Next step is selecting the components to our required circuit. Let us take one example is
designing of 38 kHz frequency generator by using 555 timer IC. The circuit diagram is shown
in below image.
In the above circuit the required components are 555 timer IC, 470? and 22K? resisters, 10K?
variable resister, 0.001µf capacitor and one IR LED. So select the components from library. In
menu bar library > pick device/ symbol. Then one window will open that shown in below.
completion of designing save with some mane and debug it. This is virtual simulation means
without making circuit we can see the result in virtually through this software and we can
design the PCB layout to our required circuit with this software.
6.4 ThingSpeak IoT Platform:
ThingSpeak is IoT platform for user to gather real-time data; for instance, climate information,
location data and other device data. In different channels in ThingSpeak, you can summarize
information and visualize data online in charts and analyze useful information.ThingSpeak can
integrate IoT:bit (micro:bit) and other software/ hardware platforms. Through IoT:bit, you can
upload sensors data to ThingSpeak (e.g. temperature, humidity, light intensity, noise, motion,
raindrop, distance and other device information).
6.5 Thingspeak Configuration:
Goal:
we need to create the thingspeak channel and get the key
Step 1
Go to https://thingspeak.com/, register an account and login to the platform
Step 2
Choose Channels -> My Channels -> New Channel
Step 3
Input Channel name, Field1 , then click ―Save Channel‖
Channel name: smart-house
Field 1: Temperature
Step 4
You will see a chat for data field1
Step 5
Open your web browser, go to https://thingspeak.com , select your channel > ―API Keys‖
,copy the API key as follows:
complex task. Further, use of the platform required familiarity with Java syntax and semantics,
and the ability to debug Java compilation errors (e.g., misspelled variables or misplaced
semicolons) for success. These challenges presented barriers to entry for individuals not versed
in computer science, App Inventor‘s target demographic. We briefly highlight and discuss
design goals for the App Inventor project, specifically, the use of components to abstract some
of the complexity of platform behavior, and the use of blocks to eliminate complexity of the
underlying programming language. These goals can be further explained as aligning the visual
language to the mental models of young developers and enabling exploration through fast,
iterative design.
CHAPTER 7
In the growing world where computers are being used to program everything, Artificial
Intelligence and Machine Learning is in the current trend. With the ongoing evolution of the
Machine Learning, we can develop unimaginable things, one of which is the enhancing human
safety through innovative accident prevention and alert system. Our document deals with the
object detection by the automated cars in order to prevent accidents that becomes one of the main
concerns in today’s world.. Deep learning is used to do Image processing. A lot of images are
captured in order to allow the device to learn and detect the lanes in an efficient manner .From this
figure we can understand that how object is detected Succesfully.
Fig.7.2. Result of latitude and longitude, Detection of alcohol ,Touch Sensor in Sterring,
IR sensor for Seat belt Detection ,Crash detector.
Enhancing human safety system through innovative accident prevention and alert technologies.
The authors present the findings of their Accident Prevention and Alert System, which utilizes an
Arduino-based vehicle accident alert system. This system incorporates GPS, GSM, and MEMS
accelerometer technologies to detect potential accidents and send alerts to theThingSpeak channel.
Current car accident detection and alert systems primarily send SMS messages to specified mobile
numbers. These systems typically utilize microcontrollers like the ATmega 8A MCU for GPS
tracking and GSM alert-based methods. They can automatically track geographic data and send
SMS alerts in the event of an accident. An accelerometer detects sudden tilting of the vehicle,
triggering the GSM module to transmit an alert message and the accident location. While such
systems are valuable for informing emergency services about accidents, they have limitations. They
focus mainly on post-accident detection and lack additional safety features in modern vehicle
systems. Moreover, their accuracy depends on the proper functioning of various sensors, which can
lead to inaccuracies or unreported accidents if sensors fail. Compatibility problems with more recent
car types and the routine maintenance requirement might also be challenging.
The hardware implementation of our system includes components such as a NodeMCU ESP8266,
an MQ3 sensor for alcohol detection, a touch sensor for driver identification, a DC series motor for
vehicle control, an L298N motor driver, and an active-passive buzzer for audible alerts. These
components work together to ensure accurate and reliable detection of potential hazards and driver
impairment, enabling proactive intervention to prevent accidents.
the development and implementation of our Accident Prevention and Alert System represent a
significant advancement in road safety technology. By integrating innovative hardware components
and advanced software algorithms, our system offers a comprehensive solution to prevent accidents
caused by driver negligence, impairment, or external hazards. Through real-time monitoring,
proactive intervention, and user-friendly interfaces, our system empowers drivers with the tools and
support needed to navigate safely on the road. As we continue to hone and improve our system in
response to user input and technical developments, it will play a critical role in boosting road safety
and saving lives.
Our proposed system's object detection system, GPS tracking system, and other components have
been successfully implemented and tested. Real-world trials have demonstrated the system's
effectiveness in preventing accidents and enhancing road safety.
CONCLUSION
In conclusion, the development and implementation of the Accident Prevention and Alert
System represent a significant advancement in road safety technology. By integrating
innovative hardware components such as NodeMCU, sensors, and actuators with advanced
software algorithms like the YOLO (You Only Look Once) object detection algorithm, we have
created a comprehensive solution to prevent accidents caused by driver negligence,
impairment, or external hazards.Through driver authentication, alcohol detection, crash
sensors, and real-time object detection, our system ensures that only authorized and sober
individuals operate the vehicle and takes proactive measures to avoid collisions. The integration
of a user-friendly interface provides drivers with real-time alerts and feedback, empowering
them to make informed decisions and navigate safely on the road.Throughout the
implementation process, rigorous testing and calibration were conducted to ensure the
reliability, accuracy, and effectiveness of the system. Real-world trials were performed to
evaluate performance and usability, leading to refinements and optimizations to enhance
overall road safety.In conclusion, the Accident Prevention and Alert System represents a
significant step forward in road safety technology, offering a comprehensive solution to
mitigate the risks associated with road travel. By preventing accidents before they occur and
empowering drivers with proactive measures and real-time alerts, our system contributes to
safer roads, reduced accident rates, and ultimately saves lives. As we continue to refine and
improve the system based on feedback and advancements in technology, we are confident that
it will play a crucial role in enhancing road safety and improving the overall driving experience
for all road users.
FUTURE SCOPE
Some possible directions for further development include:
1. Integration with additional sensors: Expanding the system to include additional sensors
such as temperature, humidity, and light sensors can provide even more context and
information to the driver.
2. Vehicle-to-vehicle (V2V) communication: Implementing V2V communication can
enable vehicles to share real-time information about their positions, speeds, and
intentions, potentially preventing collisions and reducing congestion.
3. Advanced machine learning algorithms: Incorporating more advanced machine
learning algorithms, such as deep learning, can improve the accuracy and reliability of
the obstacle detection and driver identification components.
4. Real-time traffic information: Integrating real-time traffic information can help drivers
anticipate and avoid congested areas, reducing travel times and increasing safety.
5. Integration with smart city infrastructure: Connecting the Accident Prevention and
Alert System with smart city infrastructure, such as traffic lights and traffic
management systems, can optimize traffic flow and reduce the likelihood of accidents.
6. Mobile app integration: Developing a mobile app that interfaces with the Accident
Prevention and Alert System can provide drivers with additional features and
functionality, such as personalized alerts, remotely controlling the vehicle, and
accessing driving analytics and performance metrics.
APPENDIX
APPENDIX 1:
}
}
void setup()
{
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
Serial.begin(9600);
pinMode(m11,OUTPUT);
pinMode(m12,OUTPUT);
pinMode(m21,OUTPUT);
pinMode(m22,OUTPUT);
pinMode(ts,INPUT);
pinMode(irs,INPUT);
pinMode(cs,INPUT);
pinMode(buz,OUTPUT);
delay(1000);
}
void loop()
{
// Network //
if (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(1000);
WiFi.begin(strs[4], strs[5]);
for(int kk=0;kk<10;kk++)
{
digitalWrite(led,0);
delay(300);
digitalWrite(led,1);
delay(300);
}
if(WiFi.status() == WL_CONNECTED)
Serial.println("ok");
}
// - Channel 1 -//
const char* string2 = strs[2].c_str();
const char* string3 = strs[3].c_str();
int temp = ThingSpeak.readLongField(atol(string2), FieldNumber1, string3);
statusCode = ThingSpeak.getLastReadStatus();
if (statusCode == 200)
{
if(temp !=prv)
{
prv=temp;
Serial.print(temp);
digitalWrite(buz,1);
delay(1000);
digitalWrite(buz,0);
}
}
delay(100);
int aval=analogRead(als)/100;
int tval=digitalRead(ts);
int irval=1-digitalRead(irs);
int cval=1-digitalRead(cs);
Serial.println("A:"+String(aval) +" T:"+String(tval)+ " I:"+String(irval) + " C:"+String(cval));
if(aval>32 || tval==0 || irval==0 || cval==1)
{
digitalWrite(buz,1);
delay(1000);
digitalWrite(buz,0);
digitalWrite(m11,0);
digitalWrite(m12,0);
digitalWrite(m21,0);
digitalWrite(m22,0); }
else{
digitalWrite(m11,1);
digitalWrite(m12,0);
digitalWrite(m21,1);
digitalWrite(m22,0);}
delay(1000);
cnt=cnt+1;
if(cnt==15)
{
cnt=0;
read_gps();
ThingSpeak.setField(1, String(aval));
ThingSpeak.setField(2, String(tval));
ThingSpeak.setField(3, String(irval));
ThingSpeak.setField(4, String(cval));
ThingSpeak.setField(5, String(flat,4));
ThingSpeak.setField(6, String(flon,4));
const char* string0 = strs[0].c_str();
const char* string1 = strs[1].c_str();
int x = ThingSpeak.writeFields(atol(string0), string1);
if(x == 200){
delay(10);
APPENDIX 2:
Machine learning code:
import cv2
import numpy as np
import time
# Load Yolo
net = cv2.dnn.readNet("weights/yolov3-tiny.weights", "cfg/yolov3-tiny.cfg")
classes = []
with open("coco.names", "r") as f:
classes = [line.strip() for line in f.readlines()]
layer_names = net.getLayerNames()
output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers()]
colors = np.random.uniform(0, 255, size=(len(classes), 3))
# Loading image
cap = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_PLAIN
starting_time = time.time()
frame_id = 0
while True:
_, frame = cap.read()
frame_id += 1
height, width, channels = frame.shape
# Detecting objects
blob = cv2.dnn.blobFromImage(frame, 0.00392, (416, 416), (0, 0, 0), True, crop=False)
net.setInput(blob)
outs = net.forward(output_layers)
2)
elapsed_time = time.time() - starting_time
fps = frame_id / elapsed_time
cv2.putText(frame, "FPS: " + str(round(fps, 2)), (10, 50), font, 2, (0, 0, 0), 3)
cv2.imshow("Image", frame)
cap = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_PLAIN
starting_time = time.time()
frame_id = 0
while True:
_, frame = cap.read()
frame_id += 1
height, width, channels = frame.shape
# Detecting objects
blob = cv2.dnn.blobFromImage(frame, 0.00392, (416, 416), (0, 0, 0), True, crop=False)
net.setInput(blob)
outs = net.forward(output_layers)
# Showing informations on the screen
x, y, w, h = boxes[i]
label = str(classes[class_ids[i]])
confidence = confidences[i]
color = colors[class_ids[i]]
cv2.rectangle(frame, (x, y), (x + w, y + h), color, 2)
cv2.putText(frame, label + " " + str(round(confidence, 2)), (x, y + 30), font, 2, color,
key = cv2.waitKey(1)
if key == 27:
break
cap.release()
cv2.destroyAllWindows()
REFERENCES
1. A. Gunadal, A. Koujalagi, S. Karavade, and S. Konnuri, ―Wireless black box using
MEMS accelerometer and GPS tracking for accidental monitoring of vehicle,‖ project
reference No. : 37S0430 college branch guide : s.g.balekundri institute of
technology,belgaum, 2015.
2. Chung-ChengChiu, Min-YuKu, Hung-Tsung, Chen Nat, "Motorcycle Detection and
Tracking System with Occlusion Segmentation," Image Analysis for Multimedia
Interactive Services. Santorini, vol. 2, pp. 32- 32, June 2007.
3. G. Gurjar, N. Chandurkar, R. Nagpure, S. Ganorkar, and J. Shelke, (March 2017)
'Wireless Black Box using MEMS Accelerometer and GPS Tracking for Accidental
Monitoring of Vehicles', IJESC, vol 7(No 3).
4. A. Musa, E. Alozie, S.A. Suleiman, J.A. Ojo, and A.L. Imoize, "A Review of Time-
Based Solar Photovoltaic Tracking Systems," Information (Switzerland), vol. 14, no. 4,
pp. 211, 2023. [Online]. Available: http://www.mdpi.com/journal/information/. doi:
10.3390/info14040211.
5. N. Purushotham and J. Madan Kumar, ―Wireless black box using MEMS
accelerometer and GPS tracking for accidental monitoring of vehicles,‖ International
Journal of Scientific Engineering and Technology Research Volume.03, IssueNo.03,
March-2014, Pages:0403-0408.
6. B. S. Shobha and R. Deepu, ―Hybrid Deep Learning Signature based Correlation
Filter for Vehicle Tracking in Presence of Clutters and Occlusion‖ International Journal
of Advanced Computer Science and Applications(IJACSA), 13(10), 2022, pp. 961-969.
DOI:10.14569/IJACSA.2022.01310114.
7. A. Kassem, R. Jabr, G. Salamouni, and Z. K. Maalouf, ―Vehicle black box system,‖
2008 IEEE Int. Syst. Conf. Proceedings, SysCon 2008, no. May 2008, pp. 463–468,
2008, doi: 10.1109/SYSTEMS.2008.4519050.
8. S. Sethuraman and S. Santhanalakshmi, "Implementing Vehicle Black Box System by
IoT based approach," 2020 4th International Conference on Trends in Electronics and
Informatics (ICOEI)(48184), Tirunelveli, India, 2020, pp. 390-395, doi:
10.1109/ICOEI48184.2020.9142906.
9. M. Palanisamy, D. Azhagesan, B. Varadharaian and S. Kumar, "Design of Electronic
Control Unit with Black Box for Ground Vehicles," 2021 4th Biennial International
Conference on Nascent Technologies in Engineering (ICNTE), NaviMumbai, India,
2021, pp. 1-6, doi: 10.1109/ICNTE51185.2021.9487579.
10. N. Watthanawisuth, T. Lomas and A. Tuantranont, "Wireless black box using MEMS
accelerometer and GPS tracking for accidental monitoring of vehicles," Proceedings of
2012 IEEE-EMBS International Conference on Biomedical and Health Informatics,
Hong Kong, China, 2012, pp. 847-850, doi: 10.1109/BHI.2012.6211718.
11. M. R. Wahid, E. Joelianto and N. A. Azis, "System Identification of Switched
Reluctance Motor (SRM) Using Black Box Method for Electric Vehicle Speed Control
System," 2019 6th International Conference on Electric Vehicular Technology
(ICEVT), Bali, Indonesia, 2019, pp. 208-212, doi:
10.1109/ICEVT48285.2019.8994020.
12. P. Yellamma, N. S. N. S. P. Chandra, P. Sukhesh, P. Shrunith and S. S. Teja, "Arduino
Based Vehicle Accident Alert System Using GPS, GSM and MEMS Accelerometer,"
2021 5th International Conference on Computing Methodologies and Communication
(ICCMC), Erode, India, 2021, pp. 486-491, doi: 10.1109/ICCMC51019.2021.9418317.
13. R. C. Pandia, (2016). Black Box: A Project Report Submitted in Partial Fulfillment of
the Requirements for the Award of Degree of Bachelor of Technology in Electronics
and Telecommunication. Orissa Engineering College.
14. K. N. Kumar, C. Vishnu, R. Mitra and C. K. Mohan, "Black-box Adversarial Attacks
in Autonomous Vehicle Technology," 2020 IEEE Applied Imagery Pattern Recognition
Workshop (AIPR), Washington DC, DC, USA, 2020, pp. 1-7, doi:
10.1109/AIPR50011.2020.9425267.
15. M. M. Rahman, A. Z. M. T. Kabir, S. Z. Khan, N. Akhtar, A. Al Mamun and S. M. M.
Hossain, "Smart Vehicle Management System for Accident Reduction by Using
Sensors and An IoT Based Black Box," 2021 8th International Conference on Electrical
Engineering, Computer Science and Informatics (EECSI), Semarang,