IV Report
IV Report
PERINTHALMANNA
Submitted by:
CHAITHANYA A P
19040447
CERTIFICATE
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.
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
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
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.
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
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.
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.
When voltage is applied, the electrons will recombine with the holes and will release
energy in the form of light
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.
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
• 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.
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
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
.
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.
Serial 0(rx), 1(tx) Used to receive and transmit ttl serial data.
Operating voltage 5v
Sram 2 kb
Eeprom 1 kb
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
Void setup()
{
pinmode(a0,input);
pinmode(8,output);
digitalwrite(8,high);
serial.begin(9600);
}
Void loop()
{
Int sensorvalue=analogread(a0);
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
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.
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.
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
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
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.
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.
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
}
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);
}
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
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.
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.
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”.
CONCLUSION