0% found this document useful (0 votes)
234 views32 pages

B5 An IoT Based Smart E-Fuel Stations Using ESP-32

The document describes a proposed smart e-fuel station system using IoT technology. The system would use an ESP-32 microcontroller to automatically deduct payment from a user's RFID card based on the amount of fuel dispensed. It would also measure and upload the fuel level in real-time to a cloud server accessible only to administrators. When fuel gets low, the main station would provide more fuel to that station.

Uploaded by

kalemula sahithi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
234 views32 pages

B5 An IoT Based Smart E-Fuel Stations Using ESP-32

The document describes a proposed smart e-fuel station system using IoT technology. The system would use an ESP-32 microcontroller to automatically deduct payment from a user's RFID card based on the amount of fuel dispensed. It would also measure and upload the fuel level in real-time to a cloud server accessible only to administrators. When fuel gets low, the main station would provide more fuel to that station.

Uploaded by

kalemula sahithi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 32

AN IOT BASED SMART E-FUEL STATIONS USING ESP-32

Abstract:
IoT and Cloud computing is becoming more in demand nowdays due to advancement in its
technology. Most of the fuel stations these days are operated manually which are time consuming
and require more manpower. It is very difficult and costly to provide excellent facility to the
consumers in a fuel station present in a distant area. All these problems can be solved by the use
of the proposed project. This paper presents the design and implementation of a smart e-fuel
station using IoT technology in which the system is capable of deducting the amount of petrol
dispensed from a user-based card using RFID technology and measure the level of fuel in the
station and upload it to the cloud server. This cloud server is only accessible to the admin. If the
fuel level is low then the main station will provide the fuel to that station. Everything is getting
automated in today’s world.
CHAPTER 1
INTRODUCTION

Nowadays we have a tremendous growth and development in the fields of communication


and nternet like online banking and brokerage, cash management, tax filing, computerized petrol
pump, medical field [1-2]. In fact, the usage of internet in the computerized petrol pump is a
concern; every data is being inserted with the help of the computers. But as far as the safety of
Fuel pump [3-5] is concerned, we are still in the world, leakage of petrol or any oil leads to a blast
and stealing of petrol may lead to a debacle.

The main objective of the device is to provide the user with an authentication and monitor
the tank valve opening or closing according to the amount requested. IoT (Internet of Things)
technology and cloud services are used in the data server that transmits the information to
multiple servers filed manually or in an automate fashion over the internet [6-9]. The stored data
can then be accessed via a Webbased interface.

In this proposed paper work, the IoT consists of internet linked devices that we use to
operate the processes and services that sustain our way of life. Staff would have to use a cloud
computing service to complete their job, as the server manages the data remotely. Cloud storage
typically requires one data centre connected by a user over the internet. The users in this work
we developed a system to fully automate the petrol bunks with the help of various electronic
devices, components, and circuits. Mainly this project is featured on the microcontroller and
Radio Frequency Identification (RFID)/Wi-Fi card in which microcontroller acts as an active device
while RFID/Wi-Fi card act as a passive device. Automatic petrol pump provides the feature of
instant recharge. The RFID/Wi-Fi card is added to an account which has a specific amount of
money and it is necessary to have a RFID/Wi-Fi card for this service. Only by the help of RFID/Wi-
Fi card, a customer can access this service. It is a type of self-service system. After dispensing, an
exact amount of balance is deducted from the RFID/Wi-Fi card with a receipt date and time. It
gives the accurate information about selling and control over any adulteration.
Literature survey:

Based on the objective framed for the work carried out an extensive literature review is carried out
and the significant finings made were presented in this section .S. V. Sagar et.al [1] IoT-based fuel
station retail automation and alert system, the research explores outlet automation. The system
provides outlet dealer with hourly updates about stocks and sales. The big challenges the outlet
face is that customers receive only less fuel for the amount they pay.

At times when interacting with the users, the staffs also get diverted and refill their tank without
resetting the dispenser’s nozzle. Punit Gupta et.al [2] the study attempts to formulate and execute a
smart petrol pump where the fuel quantity is quantified at the station and the value is sent to a
central server. When the quantity becomes low, fuel is delivered to the outlet. Matharu et.al [3]
outlined the basic layered IoT architecture and its constituent element

In addition, this work provided for a secure IoT architecture build. This study concluded by
mentioning the potential IoT technology applications in fields ranging from smart transportation to
smart home to e-health care and green agriculture development.

The study Jadhav et.al [4] utilizes a device that can be installed in a vehicle tank so that clients do
not get cheated about the amount of fuel. The ultrasonic range finder is mounted on the fuel tank
surface which is programmed to send eight pulses over a 10-microsecond period. The time taken to
receive these pulses is evaluated by the finder of the ultrasonic range.

The distance from the ultrasonic range finder to the fuel level is evaluated. Microcontroller [10-12]
is interfaced with LCD display to show the current value of the fuel when the device is switched
on. In this manuscript we have discussed about the various significant studies carried out that has
been referred to with respect to our work. Various ideas were obtained from each work that
contributed to a simplified model of the proposal.
CHAPTER 2
EXISTING AND PROPOSED SYSTEM

Existing system:
In previous we have seen in fuel station to fill the fuel we need human help needed for filling the
fuel and there is no proper protection in fuel stations like fire sensor, smoke sensor etc. this lead to
damage and also fire accidents.

Proposed system:
The system proposed describes the creation and management of a smart fuel. An interactive,
digital system is designed to improve user interface.

It uses a data procurement system based on the microcontroller that uses AC to bring control
data from analog to digital format. Tough the in-vehicle information systems are spread
throughout a practical vehicle’s body, a communication module is adopted which supports the
incorporation of a controlled fuel dispensing system for vehicles through an ESP32
microcontroller-controlled device.

In this work the Automatic vehicle identification (AVI) system is adopted and further the customer
will scan his RFID/Wi-Fi card with all the details installed in it.
Chapter 3
HARDWARE CONSTRAINTS

ESP32

ESP32 is a low-cost, low-power Microcontroller with an integrated Wi-Fi and Bluetooth. It is the
successor to the ESP8266 which is also a low-cost Wi-Fi microchip albeit with limited vastly
limited functionality.

It is an integrated antenna and RF balun, power amplifier, low-noise amplifiers, filters, and power
management module. The entire solution takes up the least amount of printed circuit board area.
This board is used with 2.4 GHz dual-mode Wi-Fi and Bluetooth chips by TSMC 40nm low power
technology, power and RF properties best, which is safe, reliable, and scale-able to a variety of
applications.
ESP32 Spec List

ESP WROOM32, Dual-Core 32-bit LX6 microprocessor

 ROM: 448 KB, SRAM: 520 KB, Support up to: 16MB flash

 Built-in CP21XX USB-to-UART(serial) Bridge

 Wi-Fi: 802.11b/g/n/e/i

 Bluetooth: v4.2 BR/EDR and BLE

 2 × 8-bit DACs
o [D26][D25]

 9 × touch sensors Note: Touch sensor 1 is [D0]. However, it’s not available as a pin in this
particular ESP32 development board (version with 30 GPIOs). GPIO 0 is available on the
version with 36 pins.

o [D13][D12][D14][D24][D33][32]
o [D15][D2][D4]

 Internal Temperature Sensor

ESP32 Board Guide


The ESP32 supports three types of I/O modes with each GPIO Pin: Digital, Analog and Internal
Sensors

Analog: Used to send/receive analog data using the following functions:

# examples based on Arduino IDE


analogRead();
analogWrite();

Digital: Used to send/receive digital data using the following functions:

# examples based on Arduino IDE


digitalRead();
digitalWrite();

Internal Sensors: This mode allows us to fetch internal sensor data from the ESP32 itself. The
three sensors available are as follows:

 Internal Temperature Sensor


 Hall Effect Sensor
 Touch Sensor

These sensors can be accessed by the following functions:

# examples based on Arduino IDE


temprature_sens_read()
hallRead()
touchRead()

ESP32 DevKitC Pinout Configuration

Pin Category Pin Name Details


Power Micro-USB, 3.3V, 5V, GND Micro-USB: ESP32 can be powered through
USB port

5V: Regulated 5V can be supplied to this pin


which is we be again regulated to 3.3V by on
board regulator, to power the board.

3.3V: Regulated 3.3V can be supplied to this pin


to power the board.

GND: Ground pins.

Enable En The pin and the button resets the microcontroller.

Analog Pins ADC1_0 to ADC1_5 and Used to measure analog voltage in the range of
ADC2_0 to ADC2_9 0-3.3V.

12-bit 18 Channel ADC

DAC pins DAC1 and DAC2 Used for Digital to analog Conversion

Input/Output GPIO0 to GPIO39 Totally 39 GPIO pins, can be used as input or


Pins output pins. 0V (low) and 3.3V (high). But pins
34 to 39 can be used as input only

Capacitive T0 to T9 These 10 pins can be used as touch pins normally


Touch pins used for capacitive pads

RTC GPIO RTCIO0 to RTCIO17 These 18 GPIO pins can be used to wake up the
pins ESP32 from deep sleep mode.

Serial Rx, Tx Used to receive and transmit TTL serial data.


External All GPIO Any GPIO can be used to trigger an interrupt.
Interrupts

PWM All GPIO 16 independent channel is available for PWM


any GPIO can be made to work as PWM through
the software

VSPI GPIO23 (MOSI), Used for SPI-1 communication.


GPIO19(MISO),
GPIO18(CLK) and GPIO5 (CS)

HSPI GPIO13 (MOSI), Used for SPI-2 communication.


GPIO12(MISO),
GPIO14(CLK) and GPIO15
(CS)

IIC GPIO21(SDA), GPIO22(SCL) Used for I2C communication.

AREF AREF To provide a reference voltage for input voltage.

ESP32 Technical Specifications

Microprocessor TensilicaXtensa LX6

Maximum Operating Frequency 240MHz

Operating Voltage 3.3V

Analog Input Pins 12-bit, 18 Channel

DAC Pins 8-bit, 2 Channel


Digital I/O Pins 39 (of which 34 is normal GPIO pin)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

SRAM 520 KB

Communication SPI(4), I2C(2), I2S(2), CAN, UART(3)

Wi-Fi 802.11 b/g/n

Bluetooth V4.2 – Supports BLE and Classic Bluetooth

Input/output

There are totally 39 digital Pins on the ESP32 out of which 34 can be used as GPIO and the
remaining are input only pins. The device supports 18-channels for 12-bit ADC and 2-channel for
8-bit DAC. It also has 16 channels for PWM signal generation and 10 GPIO pins supports
capacitive touch features. The ESP32 has multiplexing feature, this enables the programmer to
configure any GPIO pin for PWM or other serial communication through program. The ESP32
supports 3 SPI Interface, 3 UART interface, 2 I2C interface, 2 I2S interface and also supports CAN
protocol.

 3 UART interface: The ESP32 supports 3 UART interface for TTL communication. This would
require 3 sets of Rx and Tx pins. All the 6 pins are software configurable and hence any GPIO
pin can be programmed to be used for UART.
 External Interrupt: Again since the ESP32 supports multiplexing any GPIO pin can be
programmed to be used as an interrupt pin.
 GPIO23 (MOSI), GPIO19(MISO), GPIO18(CLK) and GPIO5 (CS): These pins are used for
SPI communication. ESP32 supports two SPI, this is the first set.
 GPIO13 (MOSI), GPIO12(MISO), GPIO14(CLK) and GPIO15 (CS): These pins are used
for SPI communication. ESP32 supports two SPI, this is the second set.
 GPIO21(SDA), GPIO22(SCL): Used for IIC communication using Wire library.
 Reset Pin: The reset pin for ESP32 is the Enable (EN) pin. Making this pin LOW, resets the
microcontroller.

Powering the ESP32

There are total three ways by which you can power your ESP32 board-

Micro USB Jack: Connect the mini USB jack to a phone charger or computer through a cable and
it will draw power required for the board to function

5V Pin: The 5V pin can be supplied with a Regulated 5V, this voltage will again be regulated to
3.3V through the on-board voltage regulator. Remember ESP32 operated with 3.3V only.

3.3V Pin: If you have a regulated 3.3V supply, then you can directly provide this to the 3.3V pin of
the ESP32.

Applications

 Prototyping of IoT devices


 Low power battery operated applications
 Network projects
 Easy to use for beginner level DIYers and makers.
 Projects requiring Multiple I/O interfaces with Wi-Fi and Bluetooth functionalities.

EM 18 Reader:

 Radio frequency Identification i.e. RFID is a wireless identification

technology that uses radio waves to identify the presence of RFID tags.
 Just like Bar code reader, RFID technology is used for identification of people,

object etc. presence.

 In barcode technology, we need to optically scan the barcode by keeping it in

front of reader, whereas in RFID technology we just need to bring RFID tags in

range of readers. Also, barcodes can get damaged or unreadable, which is not

in the case for most of the RFID.

 RFID is used in many applications like attendance system in which every person

will have their separate RFID tag which will help identify person and their

attendance.

 RFID is used in many companies to provide access to their authorized

employees.

 It is also helpful to keep track of goods and in automated toll collection system

on highway by embedding Tag (having unique ID) on them.

4x4 keypad:

 When we want to interface one key to the microcontroller then it needs one
GPIO pin. But when we want to interface many keys like 9, 12 or 16 etc., then it
may acquire all GPIO pins of microcontroller.
 To save some GPIO pins of microcontroller, we can use matrix keypad. Matrix
keypad is nothing but keys arrange in row and column.
 E.g. if we want to interface 16 keys to the microcontroller then we require 16
GPIO pins but if we use matrix 4x4 keypad then we require only 8 GPIO pins of
microcontroller.

4x4 Keypad Matrix Structure

4x4 Keypad Pinout

Keyboards are organized in a matrix of rows and columns. When a key is pressed, a
row and a column make a contact Otherwise; there is no connection between rows
and columns.
Liquid level sensor:
The liquid level sensor has a very simple schematic which makes it up but despite

which is rather very interesting to learn, let’s learn further. The liquid level sensor is

a widely used sensor. you can see this sensor in the water level detector and many

other places. water level sensors can be used in our daily life usable things.

Fire sensor:
A sensor which is most sensitive to a normal light is known as a flame sensor. That’s why
this sensor module is used in flame alarms. This sensor detects flame otherwise
wavelength within the range of 760 nm – 1100 nm from the light source. This sensor can
be easily damaged to high temperature. So this sensor can be placed at a certain
distance from the flame. The flame detection can be done from a 100cm distance and the
detection angle will be 600. The output of this sensor is an analog signal or digital signal.
These sensors are used in fire fighting robots like as a flame alarm.
Smoke sensor:

A smoke detector is a device that senses smoke, typically as an indicator of fire. Smoke
detectors are usually housed in plastic enclosures, typically shaped like a disk about 150
millimetres (6 in) in diameter and 25 millimetres (1 in) thick, but shape and size vary.
Smoke can be detected either optically (photoelectric) or by physical process (ionization).
Detectors may use one or both sensing methods. Sensitive alarms can be used to detect
and deter smoking in banned areas. Smoke detectors in large commercial and industrial
buildings are usually connected to a central fire alarm system.

Buzzer:

A buzzer or beeper is an audio signaling device,[1] which may


be mechanical, electromechanical, or piezoelectric (piezo for short). Typical uses of
buzzers and beepers include alarm devices, timers, train and confirmation of user input
such as a mouse click or keystroke.

Pump for fuel:

A pump is a device that moves fluids (liquids or gases), or sometimes slurries,[1] by mechanical action,
typically converted from electrical energy into hydraulic energy.
Mechanical pumps serve in a wide range of applications such as pumping water from wells, aquarium
filtering, pond filtering and aeration, in the car industry for water-cooling and fuel injection, in the energy
industry for pumping oil and natural gas or for operating cooling towers and other components
of heating, ventilation and air conditioning systems. In the medical industry, pumps are used for
biochemical processes in developing and manufacturing medicine, and as artificial replacements for
body parts, in particular the artificial heart and penile prosthesis.

CHAPTER 4
SOFTWARE CONSTRAINTS

INTRODUCTION TO ARDUINOIDE

Arduino is a prototype platform (open-source) based on an easy-to-use hardware and


software. It consists of a circuit board, which can be programmed (referred to as a
microcontroller) and a ready-made software called Arduino IDE (Integrated Development
Environment), which is used to write and upload the computer code to the physicalboard.

KEY FEATURES OF ARDUINOIDE

Arduino boards are able to read analog or digital input signals from different sensors and
turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and
many other actions.
You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).

Unlike most previous programmable circuit boards, Arduino does not need an extra piece
of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USBcable.

Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn
to program.

Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.
After learning about the main parts of the Arduino UNO board, we are ready to learn how
to set up the Arduino IDE. Once we learn this, we will be ready to upload our program onthe
Arduino board.

ARDUINO DATATYPES

Data types in C refers to an extensive system used for declaring variables or functions of
different types. The type of a variable determines how much space it occupies in the storage
and how the bit pattern stored isinterpreted.
The following table provides all the data types that you will use During Arduino
programming.
Void

The void keyword is used only in function declarations. It indicates that the function is
expected to return no information to the function from which it was called.

Example:

Void Loop ( )

{
// rest of the code

Boolean

A Boolean holds one of two values, true or false. Each Boolean variable occupies one
byte of memory.

Example:

Boolean state= false ; // declaration of variable with type boolean and initialize it
withfalse.

Boolean state = true ; // declaration of variable with type boolean and initialize it
withfalse.

Char

A data type that takes up one byte of memory that stores a character value. Character
literals are written in single quotes like this: 'A' and for multiple characters, strings use double
quotes: "ABC".

However, characters are stored as numbers. You can see the specific encoding in the
ASCII chart. This means that it is possible to do arithmetic operations on characters, in
whichthe ASCII value of the character is used. For example, 'A' + 1 has the value 66, since
theASCII value of the capital letter A is65.

Example:

Char chr_a = ‘a’ ;//declaration of variable with type char and initialize it with
character a.
Char chr_c = 97 ;//declaration of variable with type char and initialize it with
character 97
Unsigned char

Unsigned char is an unsigned data type that occupies one byte of memory. The
unsigned char data type encodes numbers from 0 to 255.

Example:

Unsigned Char chr_y = 121 ; // declaration of variable with type Unsigned char
and initialize it with character y

Byte
A byte stores an 8-bit unsigned number, from 0 to 255.
Example:
byte m = 25 ;//declaration of variable with type byte and initialize it with 25

int

Integers are the primary data-type for number storage. int stores a 16-bit (2-byte) value.
This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of
(2^15) - 1).

The int size varies from board to board. On the Arduino Due, for example, an intstores a
32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647 (minimum value
of -2^31 and a maximum value of (2^31) - 1).

Example:

int counter = 32 ;// declaration of variable with type int and initialize it with 32.

Unsigned int
Unsigned int’s (unsigned integers) are the same as int in the way that they store a 2
byte value. Instead of storing negative numbers, however, they only store positive values,
yielding a useful range of 0 to 65,535 (2^16) - 1). The Due stores a 4 byte (32-bit) value,
ranging from 0 to 4,294,967,295 (2^32 -1).

Example:

Unsigned int counter= 60 ; // declaration of variable with type unsigned int and
initialize it with 60.
Word

On the Uno and other ATMEGA based boards, a word stores a 16-bit unsigned
number. On the Due and Zero, it stores a 32-bit unsigned number.

Example

word w = 1000 ;//declaration of variable with type word and initialize itwith 1000.

Long Long variables are extended size variables for number storage, and store 32 bits
(4 bytes), from 2,147,483,648 to 2,147,483,647.

Example:

Long velocity= 102346 ;//declaration of variable with type Long and initialize it
with 102346
Unsigned long

Unsigned long variables are extended size variables for number storage and store 32
bits (4 bytes). Unlike standard longs, unsigned longs will not store negative numbers, making
their range from 0 to 4,294,967,295 (2^32 - 1).
Example:

Unsigned Long velocity = 101006 ;// declaration of variable with type Unsigned Long
and initialize it with 101006.

Short

A short is a 16-bit data-type. On all Arduinos (ATMega and ARM based), a short
stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -
2^15 and a maximum value of (2^15) -1).

Example:

short val= 13 ;//declaration of variable with type short and initialize it with 13
Float

Data type for floating-point number is a number that has a decimal point. Floating-point
numbers are often used to approximate the analog and continuous values because they have
greater resolution than integers.

Floating-point numbers can be as large as 3.4028235E+38 and as low as 3.4028235E+38.


They are stored as 32 bits (4 bytes) of information.

Example:

float num = 1.352;//declaration of variable with type float and initialize it with

1.352.

Double

On the Uno and other ATMEGA based boards, Double precision floating-point
number occupies four bytes. That is, the double implementation is exactly the same as the
float, with no gain in precision. On the Arduino Due, doubles have 8-byte (64 bit) precision
Example:

double num = 45.352 ;// declaration of variable with type double and initialize it with
45.352.

STEPS TO UPLOAD THE PROGRAM IN ARDUINOBOARD

In this section, we will learn in easy steps, how to set up the Arduino IDE on our
computer and prepare the board to receive the program via USB cable.

Step 1: First you must have your Arduino board (you can choose your favorite board) anda
USB cable.
In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega2560, or
Diecimila, you will need a standard USB cable (A plug to B plug), the kind youwould connect
to a USB printer as shown in the following image.

Fig 4.1 USB Cable

Step 2: Download Arduino IDE Software.

You can get different versions of Arduino IDE from the Download page on the
Arduino Official website. You must select your software, which is compatible with your
operating system (Windows, IOS, or Linux). After your file download is complete, unzip the
file.

Step 3: Power up your board.

The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power
from either, the USB connection to the computer or an external power supply. If you are using
an Arduino Diecimila, you have to make sure that the board is configured
todrawpowerfromtheUSBconnection.Thepowersourceisselectedwithajumper,a

small piece of plastic that fits onto two of the three pins between the USB and power
jacks. Check that it is on the two pins closest to the USB port. Connect the Arduino board to
your computer using the USB cable. The green power LED (labeled PWR) should glow.

Step 4: Launch Arduino IDE.

After your Arduino IDE software is downloaded, you need to unzip the folder. Inside
the folder, you can find the application icon with an infinity label (application.exe).
Doubleclick the icon to start theIDE.
Step 5: Open your first project.

Once the software starts, you have two options: Create


a new project.

Open an existing project example.

To create a new project, select File -->New.To open


To open an existing project example, select File -> Example -> Basics -> Blink.

Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.

Step 6: Select your Arduino board.

To avoid any error while uploading your program to the board, you must select the
correct Arduino board name, which matches with the board connected to your computer.

Go to Tools -> Board and select your board


Here, we have selected Arduino Uno board according to our tutorial, but you must
select the name matching the board that you are using

Step 7: Select your serial port.

Select the serial device of the Arduino board. Go to Tools ->Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial
ports). To find out, you can disconnect your Arduino board and re-open the menu, the entry
that disappears should be of the Arduino board. Reconnect the board and select that serialport.
Step 8: Upload the program to your board.

Before explaining how we can upload our program to the board, we mustdemonstrate
the function of each symbol appearing in the Arduino IDE toolbar.
A- Used to check if there is any compilation error.
B- Used to upload a program to the Arduino board.
C- Shortcut used to create a new sketch.

D- Used to directly open one of the example sketch.


E- Used to save your sketch.
F- Serial monitor used to receive serial data from the board and send the serial
data to theboard.

Now, simply click the "Upload" button in the environment. Wait a few seconds; you will see
the RX and TX LEDs on the board, flashing. If the upload is successful, the message "Done
uploading" will appear in the status bar.

Note: If you have an Arduino Mini, NG, or other board, you need to press the reset button
physically on the board, immediately before clicking the upload button on the
ArduinoSoftware.
ARDUINO PROGRAMMINGSTRUCTURE

In this chapter, we will study in depth, the Arduino program structure and we will
learn more new terminologies used in the Arduino world. The Arduino software is open-
source. The source code for the Java environment is released under the GPL and the C/C++
microcontroller libraries are under the LGPL.

Sketch: The first new terminology is the Arduino program called “sketch”.
Structure
Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software
program, step by step, and how we can write the program without any syntax or
compilation error.
Let us start with the Structure. Software structure consist of two main functions:
Setup( ) function
Loop( ) function
Void setup ( )

PURPOSE:

The setup() function is called when a sketch starts. Use it to initialize the variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduinoboard.

INPUT
OUTPUT
RETURN
Void Loop ( )
{

PURPOSE:

After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops secutively, allowing your
program to change and respond. Use it to actively control the Arduinoboard.
INPUT
OUTPUT
RETURN

You might also like