Advanced Fingerprint and Passcode Based
Advanced Fingerprint and Passcode Based
MANIVASAN.C (REG.NO:821921106018)
NANDHA KUMAR.N (REG.NO:821921106022)
PAVALESH.K (REG.NO:821921106023)
ROHAN KUMAR.D (REG.NO.: 821921106025)
THANJAVUR
This is to certify that this Project Report is the Bonafide work of C.MANIVASAN (Register No.
821921106018), N.NANDHA KUMAR(Register No.821921106022) and K.PAVALESH
(Register No. 821921106023), D.ROHAN KUMAR (Register No. 821921106025) who carried
out the project entitled “ADVANCED FINGERPRINT AND PASCODE BASED ANTI-
THEFT VEHICLE SYSTEM” under our supervision from October 2024 to April 2025.
SIGNATURE SIGNATURE
Our sincere thanks to our Honorable Chairman Rev. Fr. Dr. J. E. ARUL
RAJ for the opportunity and facilities given to us to carry out this project work.
We like to express our sincere gratitude to our internal project guide Mr.
Vehicle theft remains a pressing issue worldwide, prompting the need for
smarter and more reliable security solutions. Traditional key-based systems are
increasingly vulnerable and inconvenient. This project proposes an advanced
fingerprint and passcode-based anti-theft vehicle system that incorporates dual-
layer authentication for enhanced security. The system combines biometric
fingerprint recognition with passcode verification to prevent unauthorized
access. A fingerprint sensor is used to authenticate registered users, while a
keypad allows for secure passcode input. Only after successful dual
authentication does the microcontroller activate the vehicle‟s ignition system.
The integration of biometric and digital verification reduces the chances of
security breaches. In the event of unauthorized attempts, the system triggers an
engine lock mechanism. Additionally, real-time alerts are sent to notify the
owner of any suspicious activity. This system ensures robust protection against
vehicle theft while offering user-friendly operation. It eliminates the need for
traditional keys, reducing loss or duplication risks. The use of biometric
authentication adds a personalized security layer. The design is cost-effective
and can be integrated into various types of vehicles. It promotes smart
automotive security and peace of mind for vehicle owners. Overall, the system
presents a practical and efficient solution for modern vehicle security
challenges.
i
LIST OF CONTENTS
ABSTRACT i
1 INTRODUCTION 1
2 LITERATURE SURVEY 5
3 SYSTEM IMPLEMENTATION 8
3.2 DISADVANATGES 9
4 SYSTEM SPECIFICATION 14
4.1.3 BUZZER 19
4.1.4 IR Sensor 26
4.2.2 EMBEDDED C 44
ii
5 CONCLUSION 59
6 REFERENCES 60
iii
LIST OF FIGURES
iv
LIST OF ABBEREVIATION
v
CHAPTER 1
INTRODUCTION
This project introduces a novel anti-theft vehicle system that integrates fingerprint
authentication with a passcode entry system to ensure dual-layer security. The
objective is to design and implement a security framework that allows access only to
authorized users, thereby significantly reducing the risk of vehicle theft. The system
uses a fingerprint sensor to capture and verify the user's biometric data, which is
stored securely in the system database. In addition to fingerprint recognition, a keypad
is used for entering a secure passcode, which must also be verified before the vehicle
ignition system is activated. Both authentication methods are connected to a
microcontroller, which acts as the central processing unit of the system. The
microcontroller processes the input from the fingerprint sensor and keypad, and only
enables the ignition circuit if both inputs are successfully authenticated.
6
To enhance the security features, the system includes a real-time alert mechanism that
notifies the owner in case of unauthorized access attempts. An engine lock mechanism
is also triggered if failed login attempts exceed a certain threshold, preventing the
vehicle from being started. This approach not only improves vehicle safety but also
reduces dependence on physical keys, which are often lost or duplicated. The system
is designed to be cost-effective and easy to integrate into existing vehicles.
Furthermore, it offers scalability for integration with mobile applications and GPS
tracking in future enhancements. Overall, this dual-authentication system provides a
smart, secure, and practical solution to modern vehicle theft challenges, ensuring
peace of mind for vehicle owners while promoting the adoption of intelligent
automotive technologies.
OBJECTIVE
The primary objective of this project is to design and implement a highly secure
and efficient anti-theft vehicle system that leverages fingerprint recognition and
passcode verification to prevent unauthorized vehicle access. As vehicle theft
continues to be a growing issue worldwide, conventional methods such as mechanical
locks and key-based ignition systems no longer provide the necessary level of
security. This system aims to address these limitations by integrating modern
biometric technology with secure passcode input, offering a dual-layer authentication
mechanism. The fingerprint scanner ensures that only pre-authorized users with
unique biometric identities can gain access to the vehicle, while the passcode provides
an additional layer of defense against intruders. This dual authentication process
significantly enhances the robustness of the security system and makes it extremely
difficult for unauthorized individuals to bypass it.
7
A core objective is to utilize a microcontroller to manage and process input data from
both the fingerprint sensor and the keypad, ensuring proper validation before enabling
the ignition system. The microcontroller acts as the decision-making unit and will
only allow the ignition system to activate when both the fingerprint and passcode are
verified successfully. Another goal is to develop a compact, cost-effective solution
that can be easily implemented in all types of vehicles, both old and new. The system
also aims to provide real-time notifications and alert mechanisms in case of
unauthorized access attempts. By integrating an engine lock feature, the system
ensures the vehicle cannot be started until proper authentication is provided, thereby
enhancing the protection level.
This project also strives to eliminate the problems associated with traditional keys,
such as loss, theft, or duplication, and promote keyless vehicle access in a secure
manner. Furthermore, the project aims to create a user-friendly interface so that users
can easily enroll, manage, and update their fingerprint and passcode credentials. It is
also an objective to ensure that the system consumes minimal power, operates
efficiently in real-time, and is resistant to common hacking or spoofing attempts. The
project emphasizes reliability, safety, and scalability, making room for future
enhancements like GPS tracking, GSM module alerts, and mobile app integration.
Ultimately, the goal is to provide a smarter, more secure, and technologically
advanced alternative to traditional vehicle security systems, thereby reducing the rate
of vehicle thefts and increasing user trust in modern automotive security technologies.
8
CHAPTER 2
LITERATURE SURVEY
2.1 LITERATURE SURVEY
TITLE:
Smart Vehicle Security System Using Biometric and GSM Technology
AUTHOR:
A. Kumar, R. Sharma
DESCRIPTION:
This paper proposes a vehicle security system that integrates fingerprint authentication
and GSM modules to prevent vehicle theft. The system includes a biometric scanner
for identity verification, and if unauthorized access is detected, the GSM module
sends alerts to the owner's mobile device. A microcontroller controls the vehicle
ignition system and locks it in case of a failed attempt. The research highlights how
biometric access and GSM-based alerting can provide multi-level protection for
automobiles.
TITLE:
Design and Implementation of Smart Car Security System Using IoT and Biometric
Technology
AUTHOR:
S. Patil, N. Deshmukh
9
DESCRIPTION:
This study focuses on an IoT-integrated biometric security model for vehicles. It uses
a fingerprint sensor and an ESP8266 Wi-Fi module to authenticate users and monitor
security via a mobile app. Unauthorized access attempts are recorded and sent to the
user in real-time. The project effectively demonstrates the usefulness of combining
fingerprint technology with IoT to remotely monitor and manage vehicle access,
contributing significantly to theft prevention.
TITLE:
Development of a Fingerprint-Based Ignition System for Vehicles
AUTHOR:
T. Rajan, B. Maheshwari
DESCRIPTION:
The authors developed a microcontroller-based fingerprint ignition system aimed at
replacing traditional keys. This system ensures that only authorized users can start the
vehicle. A fingerprint sensor is interfaced with an Arduino, and after successful
authentication, the microcontroller enables the ignition circuit. The paper discusses
reliability, fast authentication, and how this method reduces thefts caused by key
duplication and hot-wiring.
10
2.4 LITERATURE SURVEY
TITLE:
Vehicle Theft Detection and Prevention Using Embedded System
AUTHOR:
M. Ahmed, K. Sultana
DESCRIPTION:
This paper introduces an embedded system that prevents vehicle theft through engine
locking and alert mechanisms. It includes a keypad for password input and a GSM
module for notifying the owner during unauthorized access. If incorrect credentials
are entered multiple times, the engine is automatically locked.
TITLE:
Dual Security Vehicle System Using Fingerprint and Passcode Authentication
AUTHOR:
L. Mehta, V. Jaiswal
DESCRIPTION:
This research proposes a dual-authentication mechanism using both fingerprint
verification and a passcode input through a keypad. The microcontroller processes the
input data and controls the ignition accordingly. The system aims to reduce vehicle
theft significantly by making it difficult for unauthorized users to bypass both layers
of security. The paper also explores the feasibility of extending the system with GPS
and GSM modules for further enhancement.
CHAPTER 3
11
SYSTEM IMPLEMENTATION
3.1 EXISTING SYSTEM
3.2 DISADVANATGES
13
Complexity: Integration of multiple components (fingerprint sensor,
keypad, microcontroller, camera) increases the system complexity and cost.
User Convenience: Requiring both fingerprint scanning and passcode entry
may cause delays or inconvenience to authorized users.
In cases where unauthorized access attempts are detected, the system immediately
responds by locking the engine to prevent the vehicle from starting. Simultaneously, it
triggers audible alarms to deter potential thieves and alerts the vehicle owner in real-
time via GSM communication, sending SMS or notifications to inform them about the
unauthorized access attempt. This real-time alerting system enhances security by
14
enabling the owner to take timely action. Additionally, the proposed system integrates
an Infrared (IR) sensor to detect whether the driver is wearing a helmet. The ignition
system will only activate if the helmet is detected, promoting rider safety alongside
theft prevention. This feature not only adds an innovative safety layer but also helps
comply with traffic safety regulations in many regions. The entire system is designed
to be automated, user-friendly, and robust, with components interconnected
seamlessly for efficient operation.
15
3.4 BLOCK DIAGRAM
POWER SUPPLY UNIT
GSM
Fingerprint
ADC
data from
matlab Alert system
Engine
Locking
Mechanism
Servo
ADC
IR Sensor motor
16
3.5 ADVANTAGES
17
CHAPTER 4
SYSTEM SPECIFICATION
Power supplies for electronic devices can be broadly divided into linear and
switching power supplies. The linear supply is a relatively simple design that becomes
increasingly bulky and heavy for high current devices; voltage regulation in a linear
supply can result in low efficiency. A switched-mode supply of the same rating as a
linear supply will be smaller, is usually more efficient, but will be more complex.
18
regulator will also greatly reduce the ripple and noise in the output direct current.
Linear regulators often provide current limiting, protecting the power supply and
attached circuit from over current.
Adjustable linear power supplies are common laboratory and service shop test
equipment, allowing the output voltage to be set over a wide range. For example, a
bench power supply used by circuit designers may be adjustable up to 30 volts and up
to 5 amperes output. Some can be driven by an external signal, for example, for
applications requiring a pulsed output.
TRANSFORMER
19
Transformers convert AC electricity from one voltage to another with little loss
of power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC.
The input coil is called the primary and the output coil is called the secondary.
There is no electrical connection between the two coils; instead they are linked by an
alternating magnetic field created in the soft-iron core of the transformer. The two
lines in the middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the
power in. Note that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the turn‟s ratio, determines
the ratio of the voltages. A step-down transformer has a large number of turns on its
primary (input) coil which is connected to the high voltage mains supply, and a small
number of turns on its secondary (output) coil to give a low output voltage.
in Vs*Is=Vp * Ip
20
FIG 4.1.1.3 TRANSFORMER OUTPUT VOLTAGE
RECTIFIER:
but it only uses the positive (+) parts of the AC wave to produce half-wave
varying DC.
The varying DC output is suitable for lamps, heaters and standard motors. It is not
suitable for electronic circuits unless they include a smoothing capacitor.
BRIDGE RECTIFIER:
A bridge rectifier can be made using four individual diodes, but it is also available in
special packages containing the four diodes required. It is called a full-wave rectifier
because it uses the entire AC wave (both positive and negative sections). 1.4V is used
up in the bridge rectifier because each diode uses 0.7V when conducting and there are
21
always two diodes conducting, as shown in the diagram below. Bridge rectifiers are
rated by the maximum current they can pass and the maximum reverse voltage they
can withstand (this must be at least three times the supply RMS voltage so the rectifier
can withstand the peak voltages). Please see the Diodes page for more details,
including pictures of ridge rectifiers.
22
4.1.2 ARDUINO
23
POWER:
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into
the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the
board. The recommended range is 7 to 12 volts.
24
INPUT & OUTPUT:
Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and
digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a
maximum of 40 mA and
has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition,
some pins have
specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
TThese pins are
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on
a low value, a
rising or falling edge, or a change in value. See the attachInterrupt() function for
details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which,
although provided by the underlying hardware, is not currently included in the
Arduino language.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024
different values). By
25
default they measure from ground to 5 volts, though is it possible to change the upper
end of their range
using the AREF pin and the analog Reference() function. Additionally, some pins have
specialized
functionality:
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analog Reference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
DIMENSION DRAWING:
26
4.1.3 DHT
DHT11 is a low-cost digital sensor for sensing temperature and humidity. This
sensor can be easily interfaced with any micro-controller such as Arduino,
Raspberry Pi etc… to measure humidity and temperature instantaneously.
27
Humidity is the measure of water vapour present in the air. The level of humidity in
air affects various physical, chemical and biological processes. In industrial
applications, humidity can affect the business cost of the products, health and safety
of the employees. So, in semiconductor industries and control system industries
measurement of humidity is very important. Humidity measurement determines the
amount of moisture present in the gas that can be a mixture of water vapour,
nitrogen, argon or pure gas etc… Humidity sensors are of two types based on their
measurement units. They are a relative humidity sensor and Absolute humidity
sensor. DHT11 is a digital temperature and humidity sensor.
28
The temperature range of DHT11 is from 0 to 50 degree Celsius with a 2-degree
accuracy. Humidity range of this sensor is from 20 to 80% with 5% accuracy. The
sampling rate of this sensor is 1Hz .i.e. it gives one reading for every
second. DHT11 is small in size with operating voltage from 3 to 5 volts. The
maximum current used while measuring is 2.5mA.
DHT11 sensor has four pins- VCC, GND, Data Pin and a not connected pin. A pull-
up resistor of 5k to 10k ohms is provided for communication between sensor and
micro-controller.
For measuring temperature this sensor uses a NTC thermistor, The term “NTC”
means “Negative Temperature Coefficient”, which means that the resistance
decreases with increase of the temperature as shown in the graph below. To get
larger resistance value even for the smallest change in temperature, this sensor is
usually made up
of semiconductor
ceramics or
polymers.
29
This IC measures and processes the analog signal with stored calibration
coefficients, does analog to digital conversion and gives out a digital signal with the
temperature and humidity.
Applications
Technical Details
Low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50°C temperature readings ±2°C accuracy
No more than 1 Hz sampling rate (once every second)
Body size 15.5mm x 12mm x 5.5mm
4 pins with 0.1" spacing
30
4.1.3 BUZZER
A buzzer or beeper is a signalling device, The word "buzzer" comes from the
rasping noise that buzzers made when they were electromechanical devices,
operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds
commonly used to indicate that a button has been pressed are a ring or a beep
This novel buzzer circuit uses a relay in series with a small audio
transformer and speaker. When the switch is pressed, the relay will operate via the
transformer primary and closed relay contact. As soon as the relay operates the
normally closed contact will open, removing power from the relay, the contacts
close and the sequence repeats, all very quickly...so fast that the pulse of current
causes fluctuations in the transformer primary, and hence secondary.
31
increasing capacitance lowers the buzzers tone.
32
4.1.4 IR SENSOR
Fig IR sensor
34
When the Tx is forward biased, it begins emitting infra red. Since it‟s not in visible
spectrum, you will not be able to see it through naked eyes but you will be able to
view it through an ordinary cell phone camera.
The resistance R1 in the above circuit can vary. It should not be a very high value
(~ 1Kohm) as then the current flowing through the diode would be very less and
hence the intensity of emitted IR would be lesser. By increasing the current
flowing in the circuit, you can increase the effective distance of your IR sensor.
However, there are drawbacks of reducing the resistance. Firstly, it would increase
the current consumption of your circuit and hence drain the battery (one of the few
„precious‟ resources for any embedded system) faster. Secondly, increasing the
current might destroy the Tx. So, the final choice should be a calculated trade off
between these various factors.
You can also modulate the IR to achieve better distance and immunity.The receiver
diode has a very high resistance, typically of the order of mega Ohms when IR is
not incident upon it. However, when IR is incident upon it, the resistance decreases
35
sharply to the order of a few kilo Ohms or even lesser. This feature forms the basis
of using IR as a sensor. You will need to connect a resistance of the order of a few
mega Ohm in series with the Rx. Then tap the output voltage at the point of
connectivity of these two resistors. A complete Tx-Rx circuit is given below.
36
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 right hand 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.
NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with the
extension .pde. It is possible to open these files with version 1.0, you will be prompted
to save the sketch with the .ino extension on save.
Verify
Checks your code for errors compiling it.
Upload
Compiles your code and uploads it to the configured board.
See uploading below for details.
Note: If you are using an external programmer with your board, you can hold
down the "shift" key on your computer when using this icon. The text will
change to "Upload using Programmer"
New
37
Creates a new sketch.
Open
Presents a menu of all the sketches in your sketchbook. Clicking one will
open it within the current window overwriting its content.
Note: due to a bug in Java, this menu doesn't scroll; if you need to open a
sketch late in the list, use the File | Sketchbookmenu instead.
Save
Saves your sketch.
Serial Monitor
Opens the serial monitor.
FILE
New
Creates a new instance of the editor, with the bare minimum structure of a
sketch already in place.
38
Open
Allows to load a sketch file browsing through the computer drives and folders.
Open Recent
Provides a short list of the most recent sketches, ready to be opened.
Sketchbook
Shows the current sketches within the sketchbook folder structure; clicking on
any name opens the corresponding sketch in a new editor instance.
Examples
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.
Close
Closes the instance of the Arduino Software from which it is clicked.
Save
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...
Allows saving the current sketch with a different name.
Page Setup
It shows the Page Setup window for printing.
Print
Sends the current sketch to the printer according to the settings defined in Page
Setup.
Preferences
Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.
39
Quit
Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.
EDIT
Undo/Redo
Goes back of one or more steps you did while editing; when you go back, you
may go forward with Redo.
Cut
Removes the selected text from the editor and places it into the clipboard.
Copy
Duplicates the selected text in the editor and places it into the clipboard.
Copy for Forum
Copies the code of your sketch to the clipboard in a form suitable for posting to
the forum, complete with syntax coloring.
Copy as HTML
Copies the code of your sketch to the clipboard as HTML, suitable for
embedding in web pages.
Paste
Puts the contents of the clipboard at the cursor position, in the editor.
Select All
Selects and highlights the whole content of the editor.
Comment/Uncomment
Puts or removes the // comment marker at the beginning of each selected line.
40
Increase/Decrease Indent
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.
Find
Opens the Find and Replace window where you can specify text to search
inside the current sketch according to several options.
Find Next
Highlights the next occurrence - if any - of the string specified as the search
item in the Find window, relative to the cursor position.
Find Previous
Highlights the previous occurrence - if any - of the string specified as the search
item in the Find window relative to the cursor position.
SKETCH
Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for code
and variables in the console area.
Upload
Compiles and loads the binary file onto the configured board through the
configured Port.
Upload Using Programmer
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.
41
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.
Export Compiled Binary
Saves a .hex file that may be kept as archive or sent to the board using other
tools.
Show Sketch Folder
Opens the current sketch folder.
Include Library
Adds a library to your sketch by inserting #include statements at the start of
your code. For more details, seelibraries below. Additionally, from this menu
item you can access the Library Manager and import new libraries from .zip
files.
Add File...
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.
TOOLS
Auto Format
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.
Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in the
same directory as the sketch.
42
Fix Encoding & Reload
Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.
Serial Monitor
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.
Board
Select the board that you're using. See below for descriptions of the various
boards.
Port
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.
Programmer
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.
BurnBootloader
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.
43
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
This is the only interactive function of the Help menu: it directly selects the
relevant page in the local copy of the Reference for the function or command
under the cursor.
SKETCHBOOK
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to
store your programs (or sketches). The sketches in your sketchbook can be opened
from the File > Sketchbook menu or from the Open button on the toolbar. The first
time you run the Arduino software, it will automatically create a directory for your
sketchbook. You can view or change the location of the sketchbook location from
with the Preferences dialog.
Beginning with version 1.0, files are saved with a .ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version 1.0
and later, the software will automatically rename the extension to .ino.
44
Allows you to manage sketches with more than one file (each of which appears in its
own tab). These can be normal Arduino code files (no visible extension), C files (.c
extension), C++ files (.cpp), or header files (.h).
UPLOADING
Before uploading your sketch, you need to select the correct items from the Tools >
Board and Tools > Port menus. Theboards are described below. On the Mac, the serial
port is probably something like /dev/tty.usbmodem241 (for an Uno or Mega2560 or
Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board),
or/dev/tty.USA19QW1b1P1.1 (for a serial board connected with a Keyspan USB-to-
Serial adapter). On Windows, it's probably COM1 or COM2 (for a serial board)
or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look for USB
serial device in the ports section of the Windows Device Manager. On Linux, it should
be /dev/ttyACMx ,/dev/ttyUSBx or similar. Once you've selected the correct serial
port and board, press the upload button in the toolbar or select the Upload item from
the File menu. Current Arduino boards will reset automatically and begin the upload.
With older boards (pre-Diecimila) that lack auto-reset, you'll need to press the reset
button on the board just before starting the upload. On most boards, you'll see the RX
and TX LEDs blink as the sketch is uploaded. The Arduino Software (IDE) will
display a message when the upload is complete, or show an error.
When you upload a sketch, you're using the Arduino bootloader, a small program that
has been loaded on to the microcontroller on your board. It allows you to upload code
without using any additional hardware. The bootloader is active for a few seconds
when the board resets; then it starts whichever sketch was most recently uploaded to
45
the microcontroller. The bootloader will blink the on-board (pin 13) LED when it
starts (i.e. when the board resets).
LIBRARIES
Libraries provide extra functionality for use in sketches, e.g. working with hardware
or manipulating data. To use a library in a sketch, select it from the Sketch > Import
Library menu. This will insert one or more #include statements at the top of the sketch
and compile the library with your sketch. Because libraries are uploaded to the board
with your sketch, they increase the amount of space it takes up. If a sketch no longer
needs a library, simply delete its #includestatements from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or through the
Library Manager. Starting with version 1.0.5 of the IDE, you do can import a library
from a zip file and use it in an open sketch. See these instructions for installing a third-
party library.
THIRD-PARTY HARDWARE
Support for third-party hardware can be added to the hardware directory of your
sketchbook directory. Platforms installed there may include board definitions (which
46
appear in the board menu), core libraries, bootloaders, and programmer definitions. To
install, create the hardware directory, then unzip the third-party platform into its own
sub-directory. (Don't use "arduino" as the sub-directory name or you'll override the
built-in Arduino platform.) To uninstall, simply delete its directory.
For details on creating packages for third-party hardware, see the Arduino IDE 1.5 3rd
party Hardware specification.
SERIAL MONITOR
Displays serial data being sent from the Arduino or Genuino board (USB or serial
board). To send data to the board, enter text and click on the "send" button or press
enter. Choose the baud rate from the drop-down that matches the rate passed
to Serial.begin in your sketch. Note that on Windows, Mac or Linux, the Arduino or
Genuino board will reset (rerun your sketch execution to the beginning) when you
connect with the serial monitor.
You can also talk to the board from Processing, Flash, MaxMSP, etc (see
the interfacing page for details).
PREFERENCES
Some preferences can be set in the preferences dialog (found under the Arduino menu
on the Mac, or File on Windows and Linux). The rest can be found in the preferences
file, whose location is shown in the preference dialog.
LANGUAGE SUPPORT
47
FIG:: 4.2.1.1 LANGUAGE SUPPORT
Since version 1.0.1 , the Arduino Software (IDE) has been translated into 30+
different languages. By default, the IDE loads in the language selected by your
operating system. (Note: on Windows and possibly Linux, this is determined by the
locale setting which controls currency and date formats, not by the language the
operating system is displayed in.)
If you would like to change the language manually, start the Arduino Software (IDE)
and open the Preferences window. Next to the Editor Language there is a dropdown
menu of currently supported languages. Select your preferred language from the
menu, and restart the software to use the selected language. If your operating system
language is not supported, the Arduino Software (IDE) will default to English.
You can return the software to its default setting of selecting its language based on
your operating system by selectingSystem Default from the Editor Language drop-
down. This setting will take effect when you restart the Arduino Software (IDE).
Similarly, after changing your operating system's settings, you must restart the
Arduino Software (IDE) to update it to the new default language.
48
BOARDS
The board selection has two effects: it sets the parameters (e.g. CPU speed and baud
rate) used when compiling and uploading sketches; and sets and the file and fuse
settings used by the burn bootloader command. Some of the board definitions differ
only in the latter, so even if you've been uploading successfully with a particular
selection you'll want to check it before burning the bootloader. You can find a
comparison table between the various boards here.
Arduino Software (IDE) includes the built in support for the boards in the following
list, all based on the AVR Core. TheBoards Manager included in the standard
installation allows to add support for the growing number of new boards based on
different cores like Arduino Due, Arduino Zero, Edison, Galileo and so on.
Arduino Yùn
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital
I/O and 7 PWM.
Arduino/Genuino Uno
An ATmega328 running at 16 MHz with auto-reset, 6 Analog In, 14 Digital I/O
and 6 PWM.
Arduino Diecimila or Duemilanove w/
ATmega168 An ATmega168 running at 16 MHz
with auto-reset.
Arduino Nano w/ ATmega328
An ATmega328 running at 16 MHz with auto-reset. Has eight analog inputs.
Arduino/Genuino Mega 2560
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital
49
I/O and 15 PWM.
50
Arduino Mega
An ATmega1280 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital
I/O and 15 PWM.
Arduino Mega ADK
An ATmega2560 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital
I/O and 15 PWM.
Arduino Leonardo
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital
I/O and 7 PWM.
Arduino Micro
An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital
I/O and 7 PWM.
Arduino Esplora
An ATmega32u4 running at 16 MHz with auto-reset.
Arduino Mini w/ ATmega328
An ATmega328 running at 16 MHz with auto-reset, 8 Analog In, 14 Digital I/O
and 6 PWM.
Arduino Ethernet
Equivalent to Arduino UNO with an Ethernet shield: An ATmega328 running at
16 MHz with auto-reset, 6 Analog In, 14 Digital I/O and 6 PWM.
Arduino Fio
An ATmega328 running at 8 MHz with auto-reset. Equivalent to Arduino Pro
or Pro Mini (3.3V, 8 MHz) w/ATmega328, 6 Analog In, 14 Digital I/O and 6
PWM.
Arduino BT w/ ATmega328
ATmega328 running at 16 MHz. The bootloader burned (4 KB) includes codes
51
to initialize the on-board bluetooth module, 6 Analog In, 14 Digital I/O and 6
PWM..
LilyPad Arduino USB
An ATmega32u4 running at 8 MHz with auto-reset, 4 Analog In, 9 Digital I/O
and 4 PWM.
LilyPad Arduino
An ATmega168 or ATmega132 running at 8 MHz with auto-reset, 6 Analog In,
14 Digital I/O and 6 PWM.
Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328
An ATmega328 running at 16 MHz with auto-reset. Equivalent to Arduino
Duemilanove or Nano w/ ATmega328; 6 Analog In, 14 Digital I/O and 6 PWM.
Arduino NG or older w/ ATmega168
An ATmega168 running at 16 MHz without auto-reset. Compilation and upload
is equivalent to Arduino Diecimila or Duemilanove w/ ATmega168, but the
bootloader burned has a slower timeout (and blinks the pin 13 LED three times
on reset); 6 Analog In, 14 Digital I/O and 6 PWM.
Arduino Robot Control
An ATmega328 running at 16 MHz with auto-reset.
Arduino Robot Motor
An ATmega328 running at 16 MHz with auto-reset.
Arduino Gemma
An ATtiny85 running at 8 MHz with auto-reset, 1 Analog In, 3 Digital I/O and 2
PWM.
52
4.2.2 EMBEDDED C
Embedded C is a set of language extensions for the C Programming language by
the C Standards committee to address commonality issues that exist between C
extensions for different embedded systems. Historically, embedded C programming
requires nonstandard extensions to the C language in order to support exotic features
such as fixed-point arithmetic, multiple distinct memory banks, and
basic I/O operations.
In 2008, the C Standards Committee extended the C language to address these issues
by providing a common standard for all implementations to adhere to. It includes a
number of features not available in normal C, such as, fixed-point arithmetic, named
address spaces, and basic I/O hardware addressing.
Embedded C uses most of the syntax and semantics of standard C, e.g., main()
function, variable definition, datatype declaration, conditional statements (if, switch,
case), loops (while, for), functions, arrays and strings, structures and union, bit
operations, macros, etc.
NECESSITY
During infancy years of microprocessor based systems, programs were developed
using assemblers and fused into the EPROMs. There used to be no mechanism to find
what the program was doing. LEDs, switches, etc. were used to check for correct
execution of the program. Some „very fortunate‟ developers had In-circuit Simulators
(ICEs), but they were too costly and were not quite reliable as well. As time
progressed, use of microprocessor-specific assembly-only as the programming
language reduced and embedded systems moved onto C as the embedded
programming language of choice. C is the most widely used programming language
53
for embedded processors/controllers. Assembly is also used but mainly to implement
those portions of the code where very high timing accuracy, code size efficiency, etc.
are prime requirements.
As assembly language programs are specific to a processor, assembly language didn‟t
offer portability across systems. To overcome this disadvantage, several high level
languages, including C, came up. Some other languages like PLM, Modula-2, Pascal,
etc. also came but couldn‟t find wide acceptance. Amongst those, C got wide
acceptance for not only embedded systems, but also for desktop applications. Even
though C might have lost its sheen as mainstream language for general purpose
applications, it still is having a strong-hold in embedded programming. Due to the
wide acceptance of C in the embedded systems, various kinds of support tools like
compilers & cross-compilers, ICE, etc. came up and all this facilitated development of
embedded systems using C. Assembly language seems to be an obvious choice for
programming embedded devices. However, use of assembly language is restricted to
developing efficient codes in terms of size and speed. Also, assembly codes lead to
higher software development costs and code portability is not there. Developing small
codes are not much of a problem, but large programs/projects become increasingly
difficult to manage in assembly language. Finding good assembly programmers has
also become difficult nowadays. Hence high level languages are preferred for
embedded systems programming.
ADVANTAGES
It is small and simpler to learn, understand, program and debug.
Compared to assembly language, C code written is more reliable and scalable,
more portable between different platforms.
54
C compilers are available for almost all embedded devices in use today, and
there is a large pool of experienced C programmers.
Unlike assembly, C has advantage of processor-independence and is not
specific to any particular microprocessor/microcontroller or any system. This
makes it convenient for a user to develop programs that can run on most of the
systems.
As C combines functionality of assembly language and features of high level
languages, C is treated as a „middle-level computer language‟ or „high level
assembly language‟.
It is fairly efficient.
It supports access to I/O and provides ease of management of large embedded
projects.
Java is also used in many embedded systems but Java programs require the Java
Virtual Machine (JVM), which consumes a lot of resources. Hence it is not
used for smaller embedded devices.
Other High-level programming language like Pascal, FORTRAN also provide
some of the advantages.
55
Components used in embedded system and PCs are different;
embedded systems typically uses smaller, less power consuming
components.
Embedded systems are more tied to the hardware.
Two salient features of Embedded Programming are code speed and code size.
Code speed is governed by the processing power, timing constraints, whereas code
size is governed by available program memory and use of programming language.
Goal of embedded system programming is to get maximum features in minimum
space and minimum time.
Assembly language maps mnemonic words with the binary machine codes that the
processor uses to code the instructions. Assembly language seems to be an obvious
choice for programming embedded devices. However, use of assembly language is
restricted to developing efficient codes in terms of size and speed. Also, assembly
codes lead to higher software development costs and code portability is not there.
Developing small codes are not much of a problem, but large programs/projects
become increasingly difficult to manage in assembly language. Finding good
assembly programmers has also become difficult nowadays. Hence high level
languages are preferred for embedded systems programming.
56
Use of C in embedded systems is driven by following advantages
It is small and reasonably simpler to learn, understand, program and
debug.
C Compilers are available for almost all embedded devices in use
today, and there is a large pool of experienced C programmers.
Unlike assembly, C has advantage of processor-independence and is
not specific to any particular microprocessor/ microcontroller or any
system. This makes it convenient for a user to develop programs that
can run on most of the systems.
As C combines functionality of assembly language and features of
high level languages, C is treated as a „middle-level computer
language‟ or „high level assembly language‟
It is fairly efficient
It supports access to I/O and provides ease of management of large
embedded projects.
Many of these advantages are offered by other languages also, but what sets C apart
from others like Pascal, FORTRAN, etc. is the fact that it is a middle level language;
it provides direct hardware control without sacrificing benefits of high level
languages.
Compared to other high level languages, C offers more flexibility because C is
relatively small, structured language; it supports low-level bit-wise data manipulation.
Compared to assembly language, C Code written is more reliable and scalable, more
portable between different platforms (with some changes). Moreover, programs
developed in C are much easier to understand, maintain and debug. Also, as they can
be developed more quickly, codes written in C offers better productivity. C is based
on the philosophy „programmers know what they are doing‟; only the intentions are
57
to be
stated explicitly. It is easier to write good code in C & convert it to an efficient
58
assembly code (using high quality compilers) rather than writing an efficient code in
assembly itself. Benefits of assembly language programming over C are negligible
when we compare the ease with which C programs are developed by programmers.
Objected oriented language, C++ is not apt for developing efficient programs in
resource constrained environments like embedded devices. Virtual functions &
exception handling of C++ are some specific features that are not efficient in terms of
space and speed in embedded systems. Sometimes C++ is used only with very few
features, very much as C.
And, also an object-oriented language, is different than C++. Originally designed by
the U.S. DOD, it didn‟t gain popularity despite being accepted as an international
standard twice (Ada83 and Ada95). However, Ada language has many features that
would simplify embedded software development.
Java is another language used for embedded systems programming. It primarily finds
usage in high-end mobile phones as it offers portability across systems and is also
useful for browsing applications. Java programs require Java Virtual Machine (JVM),
which consume lot of resources. Hence it is not used for smaller embedded devices.
Dynamic C and B# are some proprietary languages which are also being used in
embedded applications.
Efficient embedded C programs must be kept small and efficient; they must be
optimized for code speed and code size. Good understanding of processor architecture
embedded C programming and debugging tools facilitate this.
DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different contexts, they
have more similarities than the differences. Most of the constructs are same; the
difference lies in their applications.
59
C is used for desktop computers, while embedded C is for microcontroller based
applications. Accordingly, C has the luxury to use resources of a desktop PC like
memory, OS, etc. While programming on desktop systems, we need not bother about
memory. However, embedded C has to use with the limited resources (RAM, ROM,
I/Os) on an embedded processor. Thus, program code must fit into the available
program memory. If code exceeds the limit, the system is likely to crash.
Compilers for C (ANSI C) typically generate OS dependant executables. Embedded
C requires compilers to create files to be downloaded to the
microcontrollers/microprocessors where it needs to run. Embedded compilers give
access to all resources which is not provided in compilers for desktop computer
applications.
Embedded systems often have the real-time constraints, which is usually not there
with desktop computer applications.
Embedded systems often do not have a console, which is available in case of desktop
applications.
60
FIG: 4.2.3.1 BLYNK APPLICATION
Blynk was designed for the Internet of Things. It can control hardware remotely, it can
display sensor data, it can store data, visualize it and do many other cool things. There
are three major components in the platform:
Blynk App: – It allows you to create amazing interfaces for your projects using
various widgets which are provided.
Blynk Server: – It is responsible for all the communications between the smartphone
and hardware. You can use the Blynk Cloud or run your private Blynk server locally.
It‟s open-source, could easily handle thousands of devices and can even be launched
on a Raspberry Pi.
Blynk Libraries: – It enables communication, for all the popular hardware platforms,
with the server and process all the incoming and outcoming commands. Now imagine,
every time you press a Button in the Blynk app, the message travels to the Blynk
Cloud, where it magically finds its way to your hardware. It works the same in the
opposite direction and everything happens in a blynk of an eye.
61
CHAPTER 5
CONCLUSION
62
REFERENCES
63
1