0% found this document useful (0 votes)
26 views40 pages

IV Report

The document discusses embedded systems and summarizes key components used in embedded systems including microcontrollers, sensors, and input/output devices. It describes common sensors like temperature sensors, light sensors, ultrasonic sensors and push buttons. It also provides an overview of microcontrollers and their role in embedded systems.

Uploaded by

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

IV Report

The document discusses embedded systems and summarizes key components used in embedded systems including microcontrollers, sensors, and input/output devices. It describes common sensors like temperature sensors, light sensors, ultrasonic sensors and push buttons. It also provides an overview of microcontrollers and their role in embedded systems.

Uploaded by

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

GOVERNMENT POLYTECHNIC COLLEGE

PERINTHALMANNA

INDUSTRIAL VISIT REPORT

Submitted by:
CHAITHANYA A P
19040447

DEPT. OF ELECTRONICS ENGINEERING


2021 - 2022
GOVERNMENT POLYTECHNIC COLLEGE
PERINTHALMANNA

DEPARTMENT OF ELECTRONICS ENGINEERING

CERTIFICATE

This is to certify that the industrial visit report submitted by CHAITHANYA A P


(Reg.No. 19040447 ), towards the partial fulfillment of the
requirement of the award of the Diploma in Electronics Engineering from the
Board of Technical Education, Kerala state, during the year 2021-2022.

Staff in Charge: Head of Departmentt:

External Examiner: Internal Examiner:


ACKNOWLEDGEMENT

I would like to take this opportunity to thank all those who have been directly
or indirectly involved in making my IV success.

We are very happy to express our sincere gratitude to our Principal in charge
Sri.Pradeep.M for providing necessary and support for successful completion of the
IV.
We also express our heartfelt thanks to Sri.Prakashan.P, Head of The
Department of Electronics Engineering for valuable help for the IV.

We also express our gratitude to Sri.Jamseer N., IV coordinator of Electronics


Engineering for valuable motivation and help for the IV.

We also express our thanks to all Staff members of Electronics Engineering


Department for their support and co-operation.
We thank all our Friends for their whole hearted support and co-operation.
Above every one, we express our heartiest thanks to the Almighty God.
INDUSTRIAL VISIT 2020-21

ABSTRACT

This report is about the Industrial Training conducted through offline about Embedded
System . It is a three week course which was conducted by Lakshmiinfotek. It was
instructed by Mr.krishna kumar and Mr.Suresh , . It has more opportunities to
Electronic Engineers.
Let`s know more about this.

GPTC PERINTHALMANNA
INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

CONTENTS
1 CHAPTER
INTRODUCTION TO
EMBEDDED SYSTEM………………………………………………………………… 9
1.1 CHARACTERISTICS OF AN EMBEDDED SYSTEM
2 CHAPTER
MICRO CONTROLER AND MICRO PROCESSOR………………………………… 10
3 CHAPTER
INPUT DEVICES/SENSORS ......................................................................................... 17
3.1 SENSORS
3.2 OUTPUT DEVICE
3.3 MODULES
4 CHAPTER
INTRODUCTION TO ARDUINO……………………………………………………. 26
4.1 ARDUINO UNO
4.2 PROGRAMMING IN ARDUINO
4.2.1 MINI PROJECT EXAMPLES

5 CHAPTER
IoT ................................................................................................................................... 29
5.1 WORKING OF IoT
5.2 ARCHITECTURE OF IoT
6 CHAPTER
ESP 8266 (NodeMcu)…………………………………………………………………. 39
6.1 INTRODUCTION TO ESP 8266
6.2 MINI PROJECT EXAMPLES
CONCLUSION ......................................................................................................................... 40

GPTC PERINTHALMANNA Page 7


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

CHAPTER 1
Embedded system
As its name suggests, embedded means something that is attached to another thing. An
embedded system can be thought of as a computer hardware system having software
embedded in it. An embedded system can be an independent system or it can be a part of
a large system. An embedded system is a microcontroller or microprocessor based
system which is designed to
perform a specific task. For example, a fire alarm is an embedded system; it will sense
only smoke.
1.1 Characteristics of an embedded system
Single-functioned − an embedded system usually performs a specialized operation and
does the same repeatedly. For example: a pager always functions as a pager.
Tightly constrained − all computing systems have constraints on design metrics, but
those on an embedded system can be especially tight. Design metrics is a measure of an
implementation's features such as its cost, size, power, and performance. It must be of a
size to fit on a single chip, must perform fast enough to process data in real time and
consume minimum power to extend battery life.
Reactive and real time − many embedded systems must continually react to changes in
the system's environment and must compute certain results in real time without any
delay. Consider an example of a car cruise controller; it continually monitors and reacts

GPTC PERINTHALMANNA Page 8


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

to speed and brake sensors. It must compute acceleration or de- accelerations repeatedly
within a limited time; a delayed computation can result in failure to control of the car.
Examples of embedded systems include:
• Air-condition
• Traffic light system
• Digital Camera
• Digital watches.
• Electronic calculators.
• GPS systems
What is the role of microcontroller in an embedded system…?
Microcontroller is a compact integrated circuit designed to govern a specific operation in
an embedded system. A typical microcontroller includes a processor, memory and
input/output (i/o) peripherals on a single chip. Hence, they can also be referred to as
embedded controllers. They run one specific program and are dedicated to a single task.
They are low power devices with dedicated input devices and small led or lcd display
outputs.

CHAPTER 2
Microcontroller and Microprocessor

Microcontroller has a CPU, in addition with a fixed amount of ram, rom and other
peripherals all embedded on a single chip. Today different manufacturers produce
microcontrollers with a wide
range of features available in different versions. Some manufacturers are Atmel,
microchip, ti, Freescale, Philips, Motorola etc.
Microprocessor is an ic which has only the CPU inside them i.e. Only the processing
powers such as intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc. These microprocessors
don’t have ram, rom, and other peripheral on the chip. A system designer has to add
them externally to make them functional. Application of microprocessor includes
desktop pc’s, laptops, notepads etc.

GPTC PERINTHALMANNA Page 9


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

CHAPTER 3
Input Devices/Sensors
3.1 SENSORS
Push Button
The pushbutton is a component that connects two points in a circuit when you press it.
The example turns on an LED when you press the button.
We connect three wires to the Arduino board. The first goes from one leg of the
pushbutton through a pull-up resistor (here 2.2 KOhms) to the 5 volt supply. The second

GPTC PERINTHALMANNA Page 10


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

goes from the corresponding leg of the pushbutton to ground. The third connects to a
digital i/o pin which reads the button's state.
When the pushbutton is open (unpressed) there is no connection between the two legs of
the pushbutton, so the pin is connected to 5 volts (through the pull-up resistor) and we
read a HIGH. When the button is closed (pressed), it makes a connection between its

two legs, connecting the pin to ground, so that we read a LOW. (The pin is still
connected to 5 volts, but the resistor in between them means that the pin is "closer" to
ground).
Temperature Sensor (LM35)
LM35 is a temperature sensor which can measure temperature in the range of -55°C to
150°C. It is a 3-terminal device that provides analogue voltage proportional to the
temperature. Higher the temperature, higher is the output voltage.

The output analogue voltage can be converted to digital form using ADC so that a
microcontroller can process it.

GPTC PERINTHALMANNA Page 11


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Light dependent resistor (LDR)


An LDR (Light Dependent Resistor) is a component that has a (variable) resistance that
changes with the light intensity that falls upon it. This allows them to be used in light
sensing circuits. A photoresistor is made of a high resistance semiconductor. In the dark,
a photoresistor can have a resistance as high as several megohms (MΩ), while in the
light, a photoresistor can have a resistance as low as a few hundred ohms.

Ultrasonic Sensor (HC-SR04)


The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats
do. It offers excellent non-contact range detection with high accuracy and stable

readings in an easy-to use package. From 2 cm to 400 cm or 1” to 13 feet. It comes


complete with ultrasonic transmitter and receiver module.

GPTC PERINTHALMANNA Page 12


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

PIR Sensor
PIR sensors allow you to sense motion. They are used to detect whether a human has
moved in or out of the sensor’s range. They are commonly found in appliances and

gadgets used at home or for businesses. They are often referred to as PIR, "Passive
Infrared", "Pyroelectric", or "IR motion" sensors.

3.2 Output Devices


LED
A LED is a two-terminal semiconductor light source. This simple P-N junction diode
emits light when it gets activated and usually requires a small voltage for its operation.

When voltage is applied, the electrons will recombine with the holes and will release
energy in the form of light

GPTC PERINTHALMANNA Page 13


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

LCD
LCDs (Liquid Crystal Displays) are used in embedded system applications for
displaying various parameters and status of the system. LCD 16x2 is a 16-pin device
that has 2 rows that can accommodate 16 characters each. LCD 16x2 can be used in 4-
bit mode or 8-bit mode. It is also possible to create custom characters. It has 8 data lines
and 3 control lines that can be used for control purposes.

7 Segment
If you needs to display numbers, consider using a seven-segment display is the best
solution. The seven-segment display has seven LEDs arranged in the shape of number
eight. They are easy to use and cost effective.

GPTC PERINTHALMANNA Page 14


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Relay
Sometimes you want your microcontroller to control AC powered devices like lamps,
fans or other household devices. But because the microcontroller operates at 5 volts, it
cannot directly control these higher voltage devices. That’s where the relay module

comes in. You can use a relay module to control the AC mains and microcontroller to
control the relay
Buzzer
It is a simple device which can generate beeps and tones. Working principle of the
device is piezoelectric effect. The main component of this device is a piezo crystal, A

special material that change shape when a voltage applied to it.


3.3 Modules
GPS
GPS stands for global positioning system and can be used to determine position, time
and speed of you are travelling.

GPTC PERINTHALMANNA Page 15


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

• GSM
Global System for Mobile communication (GSM) is digital cellular system used for
mobile devices. It is an international standard for mobile which is widely used for long
distance communication. There are various GSM modules available in market like
SIM900, SIM700, SIM800, SIM808, SIM5320 etc. SIM900A module allows users to
send/receive data over GPRS, send/receive SMS and make/receive voice calls. The
GSM/GPRS module uses USART communication to communicate with microcontroller
or PC terminal. AT commands are used to configure the module in different modes and
to perform various functions like calling, posting data to a site, etc.

Bluetooth (HC 05)


HC-05 Bluetooth Module is an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup. Its communication is via serial
communication which makes an easy way to interface with controller or PC. HC-05
Bluetooth module provides switching mode between master and slave mode which
means it able to use neither receiving nor transmitting data.

GPTC PERINTHALMANNA Page 16


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Lora
The Lora Module Ra-02 is a wireless transmission module based on SEMTECH
SX1278 wireless transceiver. It adopts advanced Lora spread spectrum technology, with
a communication distance of 10,000 meters. It has a strong anti-jamming ability and has
the function of air-alarm clock-up Consumption. can be covering thousands of people in
the neighbourhood environment, especially suitable for reading counters, smart home,
alarm equipment.

What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button,
or a twitter message - and turn it into an output - activating a motor, turning on an led,
publishing something online. You can tell your board what to do by sending a set of
instructions to the microcontroller on the board. To do so you use the Arduino

GPTC PERINTHALMANNA Page 17


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

programming language (based on wiring), and the Arduino software (ide), based on
processing.

CHAPTER 4
ARDUINO UNO
Arduino uno is a popular microcontroller development board based on 8-bit atmega328p
microcontroller. Along with atmega328p mcu ic, it consists other components such as
crystal oscillator, serial communication, voltage regulator, etc. To support the
microcontroller
.

Arduino uno pinout configuration

GPTC PERINTHALMANNA Page 18


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Pin Pin name Details


category

Power Vin, 3.3v, 5v, gnd Vin: input voltage to arduino when using an external
power source.
5v: regulated power supply used to power
microcontroller and other components on
the board. 3.3v: 3.3v supply generated by
on-board voltage regulator. Maximum
current draw is 50ma.
Gnd: ground pins.
Reset Reset Resets the microcontroller.

Analog pins A0 – a5 Used to provide analog input in the range of


0-5v

Input/output Digital pins 0 - Can be used as input or output pins.


pins 13

Serial 0(rx), 1(tx) Used to receive and transmit ttl serial data.

External 2, 3 To trigger an interrupt.


interrupts

Pwm 3, 5, 6, 9, 11 Provides 8-bit pwm output.

GPTC PERINTHALMANNA Page 19


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Spi (ss), 11 (mosi), Used for spi communication.


12
(miso) and 13
(sck)
Inbuilt led 13 To turn on the inbuilt led.

GPTC PERINTHALMANNA Page 20


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Arduino uno technical specifications

Microcontroller Atmega328p – 8 bit avr family microcontroller

Operating voltage 5v

Recommended input voltage 7-12v

Input voltage limits 6-20v

Analog input pins 6 (a0 – a5)

Digital i/o pins 14 (out of which 6 provide pwm output)

Dc current on i/o pins 40 ma

Dc current on 3.3v pin 50 ma

Flash memory 32 kb (0.5 kb is used for bootloader)

Sram 2 kb

Eeprom 1 kb

Frequency (clock speed) 16 mhz

GPTC PERINTHALMANNA Page 21


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

4.2 How to program Arduino?


After understanding the hardware of the Arduino uno board in the previous article, let’s
now get started with Arduino programming. Arduino programs are written in the
Arduino integrated development environment (ide). Arduino ide is a special software
running on your system that allows you to write sketches (synonym for program in
Arduino language) for different Arduino boards. The Arduino programming language is
based on a very simple hardware programming language called processing, which is
similar to the c language. After the sketch is written in the Arduino ide, it should be
uploaded on the Arduino board for execution. The first step in programming the arduino
board is downloading and installing the arduino ide. The open source arduino ide runs
on windows, mac os x, and linux. Download the arduino software (depending on your
os) from the official website and follow the instructions to install. Now let’s discuss the
basics of arduino programming. The structure of arduino program is pretty simple.
Arduino programs have a minimum of 2 blocks, Preparation & execution
Each block has a set of statements enclosed in curly braces:
Void setup( )
{
Statements-1;
.
.
.
Statement-n;
}
Void loop ( )
{

GPTC PERINTHALMANNA Page 22


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Statement-1;
.
.
.
Statement-n;
}
Here, setup ( ) is the preparation block and loop ( ) is an execution block.
The setup function is the first to execute when the program is executed, and this function
is called only once. The setup function is used to initialize the pin modes and start serial
communication. This function has to be included even if there are no statements to
execute.
Void setup ( )
{
Pinmode (pin-number, output); // set the ‘pin-number’ as output
Pinmode (pin-number, input); // set the ‘pin-number’ as output
}
After the setup ( ) function is executed, the execution block runs next. The execution
block hosts statements like reading inputs, triggering outputs, checking conditions etc..
In the above example loop ( ) function is a part of execution block. As the name
suggests, the loop( ) function executes the set of statements (enclosed in curly braces)
repeatedly.
Void loop ( )
{
Digitalwrite (pin-number,high); // turns on the component connected to
‘pin-number’
Delay (1000); // wait for 1 sec

GPTC PERINTHALMANNA Page 23


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Digitalwrite (pin-number, low); // turns off the component connected to


‘pin-number’
Delay (1000); //wait for 1sec
}
Note: arduino always measures the time duration in millisecond. Therefore, whenever
you
mention the delay, keep it in milli seconds.
4.2.1 MINI PROJECT EXAMPLES
Mini Project 1 : Automatic Fan control

Void setup()
{
pinmode(a0,input);
pinmode(8,output);
digitalwrite(8,high);
serial.begin(9600);
}
Void loop()
{
Int sensorvalue=analogread(a0);

GPTC PERINTHALMANNA Page 24


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Float temp=sensorvalue*4.88/10;
Serial.print("temperature=");
Serial.print(temp);
Serial.println("degree celsius");
If(temp>=30)
Digitalwrite(8,low);
Else
Digitalwrite(8,high);
Delay(1000);
}
Mini Project 2 : Automatic street light system

GPTC PERINTHALMANNA Page 25


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Void setup()
{
Pinmode(a0,input);
Pinmode(8,output);
Serial.begin(9600);
}
Void loop()
{
int a=analogread(a0);
serial.println(a);
if(a<50)
digitalwrite(8,high);
else
digitalwrite(8,low);
delay(100);
}

CHAPTER 5
IoT
5.1 What is IoT?
The internet of things, or iot, refers to the billions of physical devices around the world
that are now connected to the internet, all collecting and sharing data. Connecting up all
these different objects and adding sensors to them adds a level of digital intelligence to
devices, enabling them to communicate real-time data without involving a human being.
The internet of things is making the fabric of the world around us more smarter and
more responsive, merging the digital and physical universes.

GPTC PERINTHALMANNA Page 26


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

A thing in the internet of things can be a person with a heart monitor implant, a farm
animal with a biochip transponder, an automobile that has built-in sensors to alert the
driver when tire pressure is low or any other natural or man-made object that can be
assigned an internet protocol (ip) address and is able to transfer data over a network.
How IoT works ?
An iot ecosystem consists of web-enabled smart devices that use embedded systems,
such as processors, sensors and communication hardware, to collect, send and act on
data they acquire from their environments. Iot devices share the sensor data they collect
by connecting to an iot gateway or other edge device where data is either sent to the
cloud to be analyzed or analyzed locally. Sometimes, these devices communicate with
other related devices and act on the information they get from one another. The devices
do most of the work without human intervention, although people can interact with the
devices -- for instance, to set them up, give them instructions or access the data. Iot can
also make use of artificial intelligence (ai) and machine learning to aid in making data
collecting processes easier and more dynamic.
The basic element of IoT
Connected devices
Devices are the primary physical objects connected to the system. For asset control
systems, sensors are the components of the device connectivity layer. These smart
sensors are continuously collecting data from the environment and transmit the
information to the next layer. Latest techniques in the semiconductor technology are
capable of producing micro smart sensors for various applications.
Central control hardware
A control panel manages the two-way data traffic between different networks and
protocols. Another function of the control panel is to translate different network
protocols and make sure interoperability of the connected devices and sensors.

GPTC PERINTHALMANNA Page 27


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Data cloud
Internet of things creates massive data from devices, applications and users which has to
be managed in an efficient way. Iot cloud offers tools to collect, process, manage and
store huge amount of data in real time. Industries and services can easily access these
data remotely and make critical decisions when necessary. Basically, iot cloud is a
sophisticated high-performance network of servers optimized to perform high-speed
data processing of myriads of devices, traffic management and deliver accurate data
analysis.
User interface
User interfaces are the visible, tangible part of the IoT system which can be accessible
by users. Designers will have to make sure a well-designed user interface for minimum
effort for users and encourage more interactions.
User interface design has higher significance in today’s competitive market; it often
determines the user whether to choose a particular device or appliance. Users will be
interested in buying new devices or smart gadgets if it is very user-friendly and
compatible with common connectivity standards.
5.2 What is IoT architecture?

While every iot system is different, the foundation for each internet of things
architecture as well as its general data process flow is roughly the same. First of all, it

GPTC PERINTHALMANNA Page 28


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

consists of the things, which are objects connected to the internet which by means of
their embedded sensors and actuators are able to sense the environment around them and
gather information that is then passed on to iot gateways. The next stage consists of iot
data acquisition systems and gateways that collect the great mass of unprocessed data,
convert it into digital streams, filter and pre-process it so that it is ready for analysis. The
third layer is represented by edge devices responsible for further processing and
enhanced analysis of data. This layer is also where visualisation and machine learning
technologies may step in. After that, the data is transferred to data centers which can be
either cloud- based or installed locally. This is where the data is stored, managed and
analysed in depth for actionable insights.
These are the four layers of iot architecture described in detail:
Sensors/Actuators
A thing in the context of “Internet of Things”, should be equipped with sensors and
actuators thus giving the ability to emit, accept and process signals.
Data acquisition systems
The data from the sensors starts in analogue form which needs to be aggregated and
converted into digital streams for further processing. Data acquisition systems perform
these data aggregation and conversion functions.
Edge analytics
Once iot data has been digitized and aggregated, it may require further processing before
it enters the data center, this is where edge analytics comes in.
Cloud analytics
Data that needs more in-depth processing gets forwarded to physical data centers or
cloud- based systems.

CHAPTER 6

GPTC PERINTHALMANNA Page 29


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Esp 8266 (NodeMcu)


6.1 What is an esp8266?
The esp8266 is a system on a chip (soc), manufactured by the chinese company
espressif. It consists of a tensilica l106 32-bit micro controller unit (mcu) and a wi-fi
transceiver. It has 11 gpio pins*(general purpose input/output pins), and an analog input
as well. This means that you can program it like any normal arduino or other
microcontroller. And on top of that, you get wi-fi communication, so you can use it to
connect to your wi-fi network, connect to the internet, host a web server with real web
pages, let your smartphone connect to it, etc ... The possibilities are endless! It's no
wonder that this chip has become the most popular iot device available. There are many
different modules available, standalone modules like the esp-## series by ai thinker, or
complete development boards like the nodemcu devkit or the wemos d1. Different
boards may have different pins broken out, have different wi-fi antennas, or a different
amount of flash memory on board. Esp8266 is just the name of the chip, many
companies have designed their own boards that use this chip, so there are many different
esp8266 boards on the market. If you don't know the difference between all these
different models, you might have a hard time deciding on what board to buy. If you're a
beginner, i would definitely recommend a development board. It's easier to get started if
you don't have to worry about all these things.Software The first step is to download and
install the arduino ide, to program the esp8266, you'll need a plugin for the arduino ide,
it can be downloaded from github manually, but it is easier to just add
the url in the arduino ide:
Open the arduino ide.
Go to file > preferences.

GPTC PERINTHALMANNA Page 30


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Paste the url http://arduino.esp8266.com/stable/package_esp8266com_index.json into


the Additional board manager urls field.
(you can add multiple urls, separating them with commas.)
Go to tools > board > board manager and search for 'esp8266'. Select the newest version,
and click install
Hardware

While the esp8266 is often used as a ‘dumb’ serial-to-wifi bridge, it’s a very powerful
microcontroller on its own. In this chapter, we’ll look at the non-wi-fi specific functions
of the esp8266.
Digital i/o: just like a normal arduino, the esp8266 has digital input/output pins (i/o or
gpio, general purpose input/output pins). As the name implies, they can be used as
digital inputs to read a digital voltage, oras digital outputs to output either 0v (sink
current) or 3.3v (source current) Voltage and current restrictions:
The esp8266 is a 3.3v microcontroller, so its i/o operates at 3.3v as well. The pins are not
5v tolerant, applying more than 3.6v on any pin will kill the chip.the maximum current
that can be drawn from a single gpio pin is 12ma.

GPTC PERINTHALMANNA Page 31


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Usable pins:
The esp8266 has 17 gpio pins (0-16), however, you can only use 11 of them, because 6
pins (gpio 6 -11) are used to connect the flash memory chip. This is the small 8-legged
chip right next to the esp8266. If you try to use one of these pins, you might crash your
program. Gpio 1 and 3 are used as tx and rx of the hardware serial port (uart), so in most
cases, you can’t use them as normal i/o while sending/receiving serial data
Analog input:
The esp8266 has a single analog input, with an input range of 0 - 1.0v. If you supply
3.3v, for example, you will damage the chip. Some boards like the nodemcu have an on-
board resistive voltage divider, to get an easier 0 - 3.3v range. You could also just use a
trimpot as a voltage divider. The adc (analog to digital converter) has a resolution of 10
bits.
Communication:
Serial
The esp8266 has two hardware uarts (serial ports):

Uart0 on pins 1 and 3 (tx0 and rx0 resp.), and uart1 on pins 2 and 8 (tx1 and rx1 resp.),
however, gpio8 is used to connect the flash chip. This means that uart1 can only transmit
data. Uart0 also has hardware flow control on pins 15 and 13 (rts0 and cts0 resp.). These
two pins can also be used as alternative tx0 and rx0 pins.

I²C
The esp doesn’t have a hardware twi (two wire interface), but it is implemented in
software. This means that you can use pretty much any two digital pins. By default, the
i²c library uses pin 4 as sda and pin 5 as scl. (the data sheet specifies gpio2 as sda and
gpio14 as scl.) The maximum speed is approximately 450khz.

GPTC PERINTHALMANNA Page 32


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

SPI
The esp8266 has one spi connection available to the user, referred to as hspi. It uses
gpio14 as clk, 12 as miso, 13 as mosi and 15 as slave select (ss). It can be used in both
slave and master mode (in software).

Wi-fi

Using the esp8266 as a simple microcontroller is great, but the reason why most people
use it, is its wi-fi capabilities. In this chapter, we'll dive into the wonderful world of
network protocols, like wi-fi, tcp,udp, http, dns ... All these acronyms might intimidate
you, but i'll try my best to explain them step-by step and in an easy way.
6.2 MINI PROJECT EXAMPLES

GPTC PERINTHALMANNA Page 33


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Mini Project : Ultrasonic sensor interface

GPTC PERINTHALMANNA Page 34


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

#define trig D1 #define echo


D2
void setup()
{
pinMode(trig,OUTPUT); pinMode(echo,INPUT);
Serial.begin(9600);

}
void loop() {
digitalWrite(trig, LOW); delayMicroseconds(2);
digitalWrite(trig, HIGH); delayMicroseconds(10);
digitalWrite(trig, LOW); long duration =
pulseIn(echo, HIGH); int distance = duration *
0.034 / 2;
Serial.print("Distance=");
Serial.print(distance); Serial.println("CM");
delay(1000);
}

GPTC PERINTHALMANNA Page 35


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Main Project : IoT based home automation

#include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> char


auth[] = ""; // Replace your Auth code char ssid[] = ""; // Replace your
network credentials char pass[] = ""; void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
} void loop()
{
Blynk.run();
}

Blynk App :

Blynk application can be found from the following links –

GPTC PERINTHALMANNA Page 36


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Android Blynk App

IOS Blynk App

After downloading the app, create an account and log in. (If possible than log in with
your real mail id for better connectivity later.)

You’ll also need to install the Blynk Arduino Library, which helps generate the firmware
running on your ESP8266. Download the latest release
from https://github.com/blynkkk/blynk-library/releases , and follow along with the
directions there to install the required libraries

GPTC PERINTHALMANNA Page 37


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Create a Blynk Project :

Click the “Create New Project” in the app to create a new Blynk app. Give it any name.

Blynk works with hundreds of hardware models and connection types. Select the
Hardware type.

After this, select connection type. In this project we have select WiFi connectivity.

The Auth Token is very important – you’ll need to stick it into your ESP8266’s
firmware. For now, copy it down or use the “E-mail” button to send it to yourself.

Add Widgets To The Project :

GPTC PERINTHALMANNA Page 38


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

Then you’ll be presented with a blank new project. To open the widget box, click in the
project window to open.
We are selecting a button to control Led connected with NodeMCU.

Click on Button.

Give name to Button say Bulb.

Under OUTPUT tab- Click pin and select the pin to which Relay is connected to
NodeMCU, here it is digital pin 2, hence select digital and under pin D2. And Click
continue.
Under MODE tab- Select whether you want this button as “push button” or “Switch”.

You have successfully created a GUI for Arduino.

GPTC PERINTHALMANNA Page 39


INDUSTRIAL VISIT 2020-21 DEPT. OF ELECTRONICS ENGINEERING

CONCLUSION

Studied about embedded system and its working. And Uno


and its program. Studied IoT and its working and architecture. We learned IoT
through the main project and observed the output.

GPTC PERINTHALMANNA Page 40

You might also like