Module - Ii: Elements of Iot
Module - Ii: Elements of Iot
Elements of IoT
ARDUINO BOARD
Arduino is a microcontroller-based
open source electronic prototyping
board which can be programmed with
an easy-to-use Arduino IDE.
A microcontroller (sometimes
called an MCU or Microcontroller
Unit) is a single Integrated Circuit
(IC) that is typically used for a
specific application and designed
to implement certain tasks
Standard Interfacing Circuits:
1. The Standard Transistor Output Device Interfacing:
Interfacing Circuit 1. LED
2. Using a Darlington Driver IC 2. Signal Lamp
3. The Standard Relay Interfacing 3. Buzzer
Circuit 4. Piezo Sounder & Speakers
4. The Standard FET Interfacing 5. Solar & DC (“toy”)
Circuit 6. Motors Unipolar Stepper Motor
7. Bipolar Stepper Motor
8. Radio-Control Servo
9. Counter Module
Input Device Interfacing: 10. Seven Segment Display
1. Switches 11. Solenoid & Isonic Solenoid Valve
2. Potentiometers 12. Smart Wire / Spring
3. Light Dependent Resistor (LDR)
4. Thermistor
CASE STUDY
❑ Home appliances like refrigerator, microcontroller is used for controlling the different
operations of refrigerator. It is getting the temperature from some temperature sensor
and by reading the temperature it is controlling your compressor.
❑ Now it is taking decision that whether to drive whether to run the compressor or not
depending among the temperature inside temperature of the refrigerator.
❑ It is also used to generate some voices or alarms if the temperature gets high like in case
you have opened the door of a refrigerator for a long time or it can display the internal
temperature of the refrigerator on some LCD device.
INPUT DEVICE INTERFACING
Flame Sensor
Gas Sensor
Raspberry-Pi
Raspberry pi is the name of the “credit card-sized computer board” developed by the
Raspberry pi foundation. It gets plugged in a TV or monitor and provides a fully
functional computer capability.
❑ Various versions of Raspberry Pi have been out till date. All versions consist of a
Broadcom system on a chip (SoC) with an integrated ARM-compatible CPU and on-
chip graphics processing unit (GPU).
❑ The original device had a single-core Processor speed of device ranges from 700 MHz to
1.2 GHz and a memory range from 256 MB to 1 GB RAM.
❑ To store the operating system and program memory Secure Digital (SD) cards are used.
Raspbian OS which is a Linux operating system is recommended OS by Raspberry Pi
Foundation. Some other third party operating systems like RISC OS Pi. Diet Pi, Kali,
Linux can also be run on Raspberry Pi.
Why use Raspberry Pi
• Robust and affordable,
• Raspberry Pi technology has been deployed in tens of thousands of
applications in a variety of industries across the world.
• With a wide range of computing products and a network of trusted
design partners, Raspberry Pi not only has the technology to help your
business, but can also provide the vital help you need to find your perfect
setup. in tens of thousands of applications in a variety of industries
across the world.
With a wide range of computing products and a network of trusted design partners,
Raspberry Pi not only has the technology to help your business, but can also provide
the vital help you need to find your perfect setup.
Raspberry Pi Interfaces
❑ Serial: The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins
for communication with serial peripherals.
❑ SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheral devices.
❑ I2C: The I2C interface pins on Raspberry Pi allow you to connect hardware modules.
I2C interface allows synchronous data transfer with just two pins - SDA (data line)
and SCL (clock line)
General specifications:
− There are two USB 3.0 ports and two USB 2.0 ports.
− There are two micro-HDMI ports. − GPIO header with 40 pins.
− Gigabit Ethernet.
− 2-lane MIPI DSI display port.
− 2-lane MIPI CSI camera port.
− LPDDR4-3200 SDRAM (2, 4, or 8 GB).
− Broadcom BCM2711.
− Quad-core Cortex-A72 (A.R.M. v8) 1.5 GHz processor.
• The software's offered are RASPBIAN, PIDORA, OPENELEC, RASPBMC, RISC OS,
ARCH LINUX.
• All these software's can be downloaded easily and for free from the official forum under
the NOOBS (new out of the box software) category.
It provides support for functioning and coding in Python as the main programming
language. It also provides support for BASIC, C, C++, JAVA, Perl and Ruby.
Raspberry Pi Example: Interfacing LED and switch with
Raspberry Pi
Booting Process
The booting method involves the following steps:
1. Downloading the NOOBS operating system install manager from the official forum of Raspberry Pi.
2. Formatting a microSD card.
3. Burning the NOOBS image onto a microSD card.
4. Inserting the card into the microSD card slot on the RaspberryPi board.
5. Plugging in keyboard, mouse and monitor cable onto the board and to the monitor.
6. Plugging in the USB power cable.
7. The boot process has now begun and a configuration window appears to enable the camera module if
present and setting the date and time.
8. The command line interface loads up asking for the username and password, upon submitting successful
information the board is fully operational.
9. The graphical user interface can be chosen by typing startx.
10. Default username and passwords for first boot are: username: pi, password: raspberry.
Adoption
❑ Pin3 (VCC): This input supply pin is used to power the relay coil.
❑ Pin6 (Normally Closed): This is the Normally closed (NC) terminal of the relay.
Electromechanical Relay (EMR)
❑ An electromechanical relay uses a physical moving part to connect contacts within
the output component of the relay.
❑ The movement of this contact is generated using electromagnetic forces from the
low-power input signal, allowing the completion of the circuit that contains the high-
power signal.
❑ SSRs use a low power electrical signal to generate an optical semiconductor signal,
typically with an optocoupler, that transmits and energizes the output signal.
❑ When activated, the input optical signal acts as the “switch” that allows a high voltage
signal to pass through the SSR’s output component.
❑ There are several ways of doing this, but the common theme between them all is the
lack of moving parts, thus making them solid-state.
❑ Relays are composed by an electromagnet that moves a tiny metallic plank, which is
called COM terminal, between two different positions NC terminal and NO terminal.
Here, the coil at the top is energized by applying electricity in the polarity shown. The
magnetized shaft is attracted to this coil and then locks into place.
The internal components of a servo motor are described below:
It consists of:
•A motor - Acts as the actuator to rotate the shaft. Can be DC, AC
•Amplifier - Powers the motor as per command signal from a controller.
•Encoder - Acts as position sensor to detect shaft rotation in degrees or radians.
•Controller - Compares reference and feedback position signals to generate correcting
commands.
•Programming inputs - Provides desired commanded position, speed, and torque.
A servo motor consists of three wires– a black wire connected to the ground, a
white/yellow wire connected to the control unit and a red wire connected to the
power supply.
Transistors can act as electronic switches. When a small current flows through the
base (for a Bipolar Junction Transistor, BJT), it allows a much larger current to flow
between the collector and emitter (BJT).
Types of Transistors: BJT: Requires a base current to turn on. MOSFET: Requires
a gate voltage to turn on. Typically, N-channel MOSFETs are used for switching as
they have lower on-resistance.
Circuit Design
1. Choosing the Right Transistor: Ensure the transistor can handle the required
load current and voltage. For high-power applications, a MOSFET is often
preferred due to its lower power dissipation.
2. Base Resistor: A resistor is often placed between the control signal and the base
to limit current and protect the transistor.
Bipolar Transistor MOSFET Connection
In a unipolar stepper motor only half of each coil is used at one time. In most
configurations, a positive voltage is applied to the center tap and left there. A negative
voltage is then applied to one side of the coil to attract the motor shaft.
❑ Bipolar stepper motors do not have a center tap;
instead, each coil has two ends that are connected to
the driver. The current must flow in both directions
through each coil to produce movement. They
usually have 4 wires.
❑ They require more complex driver circuitry to
reverse the direction of current in the coils.
However, they can achieve higher torque and better
performance because the entire coil is used.
❑ They generally provide higher torque compared to
unipolar stepper motors for the same current due to
the full use of the coil.
❑ Bipolar stepper motors
consist of two coils of wire
(electrically, actually split
into several physical coils)
and generally have four
connections, two per coil.
❑ An advantage of bipolar
stepper motors is that they
make use of the entire coil
winding so they are more
efficient. However, they
require a more complex
controller or driver to
operate as to reverse
direction the polarity of the
voltage applied to the coils
needs to be reversed.
Programming API’s (using Python/Arduino) for Communication
API stands for Application Programming Interface. In the context of APIs, the word
Application refers to any software with a distinct function. Interface can be thought of
as a contract of service between two applications. This contract defines how the two
communicate with each other using requests and responses.
Types: REST (Representational state transfer) is an architectural
1. REST API pattern designed in 2000.
2. WebSocket API
1. It has no official standard at all because it is an architectural
style.
2. Works with multiple formats like : plain text, XML, HTML
and JSON (JavaScript Object Notation).
1.Client sends a regular HTTP request to the server , an upgrade header is included in this
request which informs the server that the client wishes to establish a WebSocket connection.
2.If the server supports the WebSocket protocol, it will agree to the upgrade and will
communicate this through the Upgrade header in the response.
3.Once the connection has been established, the initial HTTP connection is replaced by a
WebSocket connection that uses the same underlying TCP/IP connection. At this point, either
party can start sending data as they want until one of them ends the connection .
Python can communicate with external devices through serial communication using libraries
like pyserial, which allows for data exchange over serial ports.
For network communication, Python can use libraries such as socket to establish
connections and exchange data over TCP/IP or UDP protocols.