IoT Unit-IV Question
IoT Unit-IV Question
(AUTONOMOUS)
Siddharth Nagar, Narayanavanam Road – 517583
QUESTION BANK (DESCRIPTIVE)
UNIT IV
IOT PHYSICAL DEVICES & ENDPOINTS
• UART pins – UART stands for universal asynchronous receiver-transmitter, which is a physical
circuit designed to send and receive data.
• PWM pins – PWM means “pulse width modulation,” which is a communication protocol best used
with stuff that moves and lights up: motors, LEDs, and so on.
• I2C pins – I 2C is short for inter-integrated circuit (two “inters” or I"squared"C). It works similarly
to SPI, but it doesn’t force you to use nearly so many pins
2 a) With the help of neat diagram explain the basic building blocks of IoT device.
Basic building blocks of an IoT Device: An IoT device can consist of a number of modules based on
functional attributes, such as:
Sensing: Sensors can be either on-board the IoT device or attached to the device. IoT device can collect
various types of information from the on board or attached sensors such as temperature, humidity, light
intensity etc. The sensed information can be communicated either to other devices or cloud-based
servers/storage.
Actuation: IoT devices can have various types of actuators attached that allow taking actions upon the
physical entities in the vicinity of the device.
Communication: Communication modules are responsible for sending collected data to other devices
or cloud-based servers/storage and receiving data from other devices and commands from remote
applications.
COURSE CODE: 20EC0453 R20
Analysis & Processing: Analysis and processing modules are responsible for making sense of the
collected data
Raspberry Pi Computer
Construction It is a motherboard. All The basis is the motherboard. It
components are soldered has other components such as
directly onto the motherboard RAM, Storage, CPU, and GPU
that are connected to the
motherboard using standard
connectors.
Size Average 85.60 mm × 56.5 mm 14 × 7 inches for the mini-
× 17 mm tower and 24 × 8 inches for the
full tower cases
Price $25 for model A and $35 for $400-$3500 for the entire
model B motherboard. computer.
Memory and Storage RAM between 1 and 8 GB. Average RAM of 4GB, cab be
Micro SD card for storage. extended to 32GB and Hard
Drive/SSD for storage.
Connectivity Has 4 USB ports, 1 HDMI Highly depends on the
monitor minimum, 1 audio computer model, but usually
COURSE CODE: 20EC0453 R20
port, an Ethernet port. Has includes at least the equivalent,
Bluetooth and Wi-Fi capability. with options for easy
No Microphone, no additional expanding.
ports
Architecture ARM AMD64
Screen No screen Can have a screen
6 a) Write a short note on various raspberry pi interfaces used for data transfer.
Raspberry Pi Interfaces:
• 802.11 b/g/n/ac Wireless LAN
• Bluetooth 5.0 with BLE
• 1x SD Card
• 2x micro-HDMI ports supporting dual displays up to 4Kp60 resolution
• 2x USB2 ports
• 2x USB3 ports
• 1x Gigabit Ethernet port (supports PoE with add-on PoE HAT)
• 1x Raspberry Pi camera port (2-lane MIPI CSI)
• 1x Raspberry Pi display port (2-lane MIPI DSI)
6 b) List out various single board computers which are alternatives to Raspberry pi.
Raspberry Pi Alternatives
1| ASUS Tinker Board S
• Dual-CH LPDDR3 2GB memory size
• Debian 9 / Android 6 OS support
• Cortex-A17 Quad-core 1.8GHz processor
2| Banana Pi M3
• Octo-Core 1.8GHz CPU
• PowerVR SGX544MP1 GPU
• 8GB eMMC storage
• 2 GB LPDDR3 memory
3| Le Potato
• Form Factor Compatible with Raspberry Pi® 2/3 Model B/B+
• Quad 64-bit Low Power Cores
• Penta Core 3D GPU with OpenGL ES 2.0
• Up to 2GB DDR3
6| Odroid-XU4
• Quad Core 2GHz A15
• Gigabit Ethernet port
• Samsung Exynos5422 Cortex™-A15 2Ghz and Cortex™-A7 Octa core CPUs40 pin GPIOs with 7
pin I2S
• 2Gbyte LPDDR3 RAM PoP stacked
7| Onion Omega2+
• MT7688 SoC
• 580 MHz MIPS CPU
• 2.4 GHz IEEE 802.11 b/g/n WiFi. 128MB of DDR2 DRAM memory
Support for GPIO is available in the latest versions of Estimote app and SDK.
• input
• output
• UART interface
GPIO input: This is the default mode, in which the beacon receives input from the connected
device via GPIO. You can imagine a button broadcasting its status (on/off) through the beacon.
GPIO output: In the output mode, beacon delivers data to the connected device via GPIO. You could
for example switch a LED lamp on or off with the beacon controlled from a mobile app. In this
configuration, the beacon will deliver data from two pins about their binary states to the connected
device.
UART: If you configure GPIO as an UART interface, you’ll be able to define custom advertising
packets for an Estimote Beacon. This feature will soon be enabled in the SDK.
COURSE CODE: 20EC0453 R20
Program:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT)
While 1:
GPIO.output(17, GPIO.HIGH)
time.sleep(1)
GPIO.output(17, GPIO.LOW)
GPIO.sleep(1)
8) Design an automatic refrigerator light system with LED, switch & raspberry pi and
write a python program to support the working of that design.
A Push Button switch is a type of switch which consists of a simple electric mechanism or air switch
mechanism to turn something on or off. Depending on model they could operate with momentary or
latching action function. Inside refrigerator, a push button is used to turn on the light, when door is
opened and off when door is closed
COURSE CODE: 20EC0453 R20
Program:
from gpiozero import LED, Button
led = LED(17)
button = Button(18)
while: if(button.is_pressed())
led.off()
else:
led.on()
9 a) What is the use of SPI and I2C interfaces on raspberry pi?
SPI: SPI is a bidirectional, synchronous, serial communications interface - like I2C. Also, like I2C, it
is used for relatively short distances. Unlike I2C, however, SPI operates at full duplex, meaning data
can be sent and received simultaneously. Additionally, it can operate at faster data transmission rates,
with rates upwards of 8 Mbits or more possible on the RPi. The RPi has two Chip Select (CE0 & CE1)
lines readily available. More can be defined by configuring other GPIO pins and through software
programming.
I2C: I2C is bidirectional, synchronous, serial communications interface. It operates on two lines in a
half-duplex mode. A single master (the RPi) can communicate with one or more slave devices. Each
connected device is selected via a 7-bit address (10 or more bit addressing is possible, but more
complex). Originally limited to 100 kbits per second, it now supports faster transmission rates. The Pi
can support 100 kbits standard mode as well as 400 kbits "fast mode", with some reports citing higher
speeds depending on cable length, board model and software processing.
I2C connection to the RPi is made using GPIO board pins 3 for SDA and 5 for SCL (BCM mode GPIO
2 and GPIO 3). The RPi GPIO operates at 3.3v so care must be taken to ensure connections to slave
COURSE CODE: 20EC0453 R20
devices are also 3.3v. A voltage level converter can be used if necessary to interface to other devices,
i.e. 5v Arduino to RPi 3.
9 b) Illustrate how to interface a switch to raspberry pi.
Push button switches are present in so many areas across different industries and for different uses here
are some examples;
Calculator buttons – a hand held calculator has lots of small push button switches
Reset switches – these are usually small and require a tool to press to avoid accidental operation
Stopping machinery – often around industrial machinery there will be an emergency stop button,
sometimes these are located on the wall
Arcade gaming – these are usually brightly coloured to encourage people to play
Program:
from gpiozero import Button
button = Button(2)
button.wait_for_press()
print('You pushed me')
10 a) Illustrate how to interface a Light sensor (LDR) with raspberry pi.
An LDR (sometimes called a photocell) is a special type of resistor. When light hits the LDR, its
resistance is very low, but when it’s in the dark its resistance is very high. By placing a capacitor in
series with an LDR, the capacitor will charge at different speeds depending on whether it’s light or
dark.
COURSE CODE: 20EC0453 R20
Program:
from gpiozero import LightSensor
ldr = LightSensor(4) # alter if using a different pin
while True:
print(ldr.value)
10 b) Design an automatic lightening system with LDR, Light and raspberry pi and
write a python program to support the working of that design.
An LDR (Light Dependent Resistor) or a photo resistor is a photo conductive sensor. It is a variable
resistor that changes it’s resistance in a proportion to the light exposed to it. Its resistance decreases
with the intensity of light.
COURSE CODE: 20EC0453 R20
Program:
from gpiozero import LightSensor, LED
ldr = LightSensor(4) # alter if using a different pin
led = LED(17)
while True:
print(ldr.value)
if(value <=100):
led.off()
else:
led.on()