Embedded Systems-IoT
Embedded Systems-IoT
INTRODUCTION
An embedded system is a dedicated computer system designed for one or two specific
functions, often within a larger system. Unlike general-purpose computers, embedded
systems are specialized and optimized for particular tasks, which allows them to operate
more efficiently and reliably. These systems are ubiquitous, found in various
applications such as automotive electronics, home appliances, medical devices,
industrial machines, and consumer electronics.
The Internet of Things (IoT) refers to the network of physical objects or "things"
embedded with sensors, software, and other technologies to connect and exchange
data with other devices and systems over the internet. IoT extends the capabilities of
embedded systems by providing connectivity, enabling remote monitoring, and control,
and facilitating data-driven insights.
Connectivity: Devices are connected to the internet, allowing for remote access
and control.
Data Collection: Sensors collect data from the environment, which is then
processed and analyzed.
Automation: Enables automatic control of devices based on predefined
conditions or algorithms.
Scalability: Can handle a vast number of connected devices and data points.
Interoperability: Devices and systems from different manufacturers can work
together.
IoT Devices: Embedded systems with sensors and actuators that interact with the
environment.
Connectivity: Communication protocols and networks (Wi-Fi, Bluetooth, Zigbee,
LoRa, NB-IoT) that connect devices to the internet.
IoT Platforms: Cloud-based platforms that manage device connectivity, data
storage, and processing (e.g., AWS IoT, Azure IoT Hub, ThingSpeak).
Data Processing and Analytics: Tools and algorithms to analyze the collected data
and derive actionable insights.
User Interface: Applications and dashboards for users to interact with the system
and visualize data.
Conclusion
Embedded systems and IoT are transforming various industries by enabling smarter,
more efficient, and connected solutions. The integration of embedded systems with IoT
capabilities allows for advanced automation, real-time monitoring, and data-driven
decision-making, paving the way for innovative applications and improved quality of life.
DIGITAL AND ANALOG SENSORS
IR SESNOR
IR TRANSMITTER
IR transmitter is a light emitting diode (LED) which emits infrared radiations. Hence,
they are called IR LED’s. Even though an IR LED looks like a normal LED, the radiation
emitted by it is invisible to the human eye.
Fig IR Transmitter
IR RECEIVER
IR receivers are also called infrared sensors as they detect the radiation from an
IR transmitter. IR receiver come in the form of photodiodes and photo transmitters.
Infrared photodiodes are different from the normal photodiodes as they detect only the
infrared radiation.
Fig IR Receiver
IR SENSOR OPERATION
FEATURES
When light falls i.e. when the photons fall on the device, the electrons in the valence
band of the semiconductor material are excited to the conduction band. These photons
in the incident light should have energy greater than the band gap of the semiconductor
material to make the electrons jump from the valence band to the conduction band.
Hence when light having enough energy strikes on the device, more and more electrons
are excited to the conduction band which results in large number of charge carriers. The
result of this process is more and more current starts flowing through the device when
the circuit is closed and hence it is said that the resistance of the device has been
decreased. This is the most common working principle of LDR.
GAS SESNOR
Nowadays, sensors play a major role in safety systems. In order to detect smoke and
fire, smoke sensors are used. They provide appropriate action on time for safety
purposes. There are numerous types of sensors available to measure environmental
characteristics like light, noise, smoke, etc.
One such sensor used in safety systems to detect harmful gases is the MQ2 Gas sensor.
If you want to make an indoor air quality monitoring system, breath checker, or early
fire detection system, the MQ2 sensor is a suitable choice.
In this tutorial, we are going to discuss how to interface the MQ2 smoke detector sensor
with Arduino and its code. The MQ2 sensor is a powerful sensor in order to measure
different types of gases like Butane, Methane, LPG, Smoke, Alcohol, Propane, Hydrogen
concentrations in the air.
VCC provides power to the sensor comparator board and needs to be connected to
the 5V of the Arduino
GND is the ground pin and needs to be connected to the GND pin of the Arduino.
D0 is the digital output pin, which shows the digital representation of the detected
gas.
A0 is the analog output pin from which we can detect the gas type by analyzing
analog values.
LCD INTERFACE
The display used is 16x2 LCD (Liquid Crystal Display); which means 16 characters per line
by 2 lines. The standard is referred as HD44780U, which refers to the controller chip
which receives data from an external source (Here Atmega16) and communicates
directly with the LCD. Here 8-bit mode of LCD is used, i.e., using 8-bit data bus.
The EN line is called "Enable." This [5] control line is used for telling the LCD that we are
sending data. For sending data to the LCD, the program should make sure that the line is
low (0) and then set the other two control lines or put data on the data bus. When the
other lines are ready completely, bring EN high (1) and should wait for the minimum
time required by the LCD datasheet and end by bringing it low (0) again.
The RS line is "Register Select" line. When RS is low (0), the data is treated as a
command or special instruction (such as clear screen, position cursor, etc.). When the RS
is high (1), the data sent is text data which is displayed on the screen. For example, to
display the letter "B" on the screen you would set RS high.
The RW line is “Read/Write" control line. When RW is low (0), the information on the
data bus is written to the LCD. When RW is high (1), the program is effectively
questioning (or reading) the LCD. Only one instruction ("Get LCD status") is read
command. All the others are write commands--so RW will always be low.
In case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5,
DB6, and DB7.
Fig: Pin Diagram of LCD
BLUETOOTH HC-05
A Bluetooth technology is a high speed low powered wireless technology link that is
designed to connect phones or other portable equipment together. It is a specification
(IEEE 802.15.1) for the use of low power radio communications to link phones,
computers and other network devices over short distance without wires. Wireless
signals transmitted with Bluetooth cover short distances, typically up to 30 feet (10
meters).
It is achieved by embedded low cost transceivers into the devices. It supports on the
frequency band of 2.45GHz and can support upto 721KBps along with three voice
channels. This frequency band has been set aside by international agreement for the
use of industrial, scientific and medical devices (ISM).rd-compatible with 1.0 devices.
Bluetooth can connect up to “eight devices” simultaneously and each device offers a
unique 48 bit address from the IEEE 802 standard with the connections being made
point to point or multipoint.
HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed
for transparent wireless serial connection setup. The HC-05 Bluetooth Module can be
used in a Master or Slave configuration, making it a great solution for wireless
communication. This serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR
(Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and
baseband. It uses CSR Bluecore 04‐External single chip Bluetooth system with CMOS
technology and with AFH (Adaptive Frequency Hopping Feature).
The Bluetooth module HC-05 is a MASTER/SLAVE module. By default the factory setting
is SLAVE. The Role of the module (Master or Slave) can be configured only by AT
COMMANDS. The slave modules cannot initiate a connection to another Bluetooth
device, but can accept connections. Master module can initiate a connection to other
devices. The user can use it simply for a serial port replacement to establish connection
between MCU and GPS, PC to your embedded project, etc.
Hardware Features
Pin Description
ENABLE: When enable is pulled LOW, the module is disabled which means the module
will not turn on and it fails to communicate. When enable is left open or connected to
3.3V, the module is enabled i.e the module remains on and communication also takes
place.
Vcc: Supply Voltage 3.3V to 5V
GND: Ground pin
TXD & RXD: These two pins acts as an UART interface for communication
STATE: It acts as a status indicator. When the module is not connected to / paired with
any other Bluetooth device, signal goes Low. At this low state, the led flashes
continuously which denotes that the module is not paired with other device. When this
module is connected to/paired with any other Bluetooth device, the signal goes High. At
this high state, the led blinks with a constant delay say for example 2s delay which
indicates that the module is paired.
NODE MCU-ESP8266
Node MCU is an open source IoT stage. It incorporates firmware which keeps running on
the ESP8266 Wi-Fi SoC from Expressive Systems, and equipment which depends on the
ESP-12 module. The term NodeMCU typically refers to the firmware, whereas the board
is termed Devkit. NodeMCU Devkit 1.0 consists of associate ESP-12E on a board that
facilitates its use. It additionally contains a transformer, a USB interface. The expression
"NodeMCU" of course alludes to the firmware as opposed to the improvement units.
The firmware utilizes the Lua scripting dialect
The NodeMCU (Node Micro Controller Unit) is an open source software and hardware
development environment that is built around a very inexpensive System-on-a-Chip
(SoC) called the ESP8266. The ESP8266 is designed and manufactured by Express,
contains all crucial elements of the modern computer: CPU, RAM, networking (wi-fi),
and even a modern operating system and SDK. When purchased at bulk, the ESP8266
chip costs only $2 USD a piece. That makes it an excellent choice for this system design.
The NodeMCU aims to simplify ESP8266 development. It has two key components.
i. An open source ESP8266 firmware that is built on top of the chip manufacturer's
proprietary SDK. The firmware provides a simple programming environment
based on eLua (embedded Lua), which is a very simple and fast scripting
language with an established developer community. For new comers, the Lua
scripting language is easy to learn. And to add on NodeMCU can be programmed
with the Android IDE too.
ii. ii. A development kit board that incorporates the ESP8266 chip on a standard
circuit board. The board has a built-in USB port that is already wired up with the
chip, a hardware reset button, Wi-Fi antenna, LED lights, and standard-sized
GPIO (General Purpose Input Output) pins that can plug into a bread board.
Figure 2 below shows the NodeMCU development board.
There are various platforms for IoT system one of them is NodeMCU. It provides lower
level control on devices which is known as firmware. These control runs on ESP8266 Wi-
Fi SoC, which hardware is based on ESP-12 module.Esp8266 is a Wi-Fi based
communication system’s microchip. It uses TCP/IP protocol for communicating with
internet through router. It uses 802.11b/g/n slandered technology for Wi-Fi
communication. It is a Tensilica L106 32-bit RISC instruction unite microprocessor with
32 KB instruction RAM, 32KB instruction Cache RAM, 80KB Data memory.ESP8266 (Pin)
and Arduino Mega’s (Pin) common pins are GND TX (0)-3.3V, RX (0), 3.3V. For running
the ESP8266 on Arduino platform we need to install ESP8266 package in Arduino IDE. As
a board is using, we need to give the additional board manager.
Fig: Esp8266 NodeMCU chip
As shown in Fig it has 12 GPIO pins. One ADC pin. For this project 7 GPIO pins have been
used. They are D0 to D6 which delivers digital outputs.
Interface One Channel Relay Module with Arduino
This is where relay modules come into play. These well-contained modules are
inexpensive, simple to connect, and ideal for home-brew projects that require
switching modest amounts of AC or DC power. The only downside is that, because
these are electro-mechanical devices, they are more prone to wear and tear over
time.
At the core of a relay is an electromagnet (a wire coil that becomes a temporary
magnet when electricity is passed through it). A relay can be thought of as an electric
lever; you turn it on with a relatively small current, and it turns on another device with
a much larger current.