0% found this document useful (0 votes)
120 views13 pages

IoT Unit-IV Question

Uploaded by

poojithkeerthi8
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)
120 views13 pages

IoT Unit-IV Question

Uploaded by

poojithkeerthi8
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/ 13

COURSE CODE: 20EC0453 R20

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY: PUTTUR

(AUTONOMOUS)
Siddharth Nagar, Narayanavanam Road – 517583
QUESTION BANK (DESCRIPTIVE)

Subject with Code: Introduction to IoT (20EC0453)


Course& Branch: B.Tech & AGRI,CSE,CSM
Year & Sem: IV-B.Tech.& I-Sem. Regulation: R20

UNIT IV
IOT PHYSICAL DEVICES & ENDPOINTS

1 a) Define an IoT device & give some examples.


IoT Device: A "Thing" in Internet of Things (IoT) can be any object that has a unique identifier and
which can send/receive data (including user data) over a network (e.g., smart phone, smart TV,
computer, refrigerator, car, etc.).
• IoT devices are connected to the Internet and send information about themselves or about their
surroundings (e.g. information sensed by the connected sensors) over a network (to other devices or
servers/storage) or allow actuation upon the physical entities/environment around them remotely.
IoT Device Examples: A home automation device that allows remotely monitoring the status of
appliances and controlling the appliances.
• An industrial machine which sends information abouts its operation and health monitoring data to a
server.
• A car which sends information about its location to a cloud-based service.
• A wireless-enabled wearable device that measures data about a person such as the number of steps
walked and sends the data to a cloud-based service.

1 b) Explain the GPIO pins of Raspberry Pi device with neat diagram.


• Power & Ground Pins - which include both 3.3V and 5V, GND These pins transmit power as output
to power attached peripherals.
• Standard GPIO Pins - the pins that are dedicated to sending output and receiving input.
• SPI pins – The Serial Peripheral Interface (SPI) is a communication protocol used to transfer data
between micro-computers like the Raspberry Pi and peripheral devices.
COURSE CODE: 20EC0453 R20

• 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

2 b) Justify how Raspberry Pi is different from a desktop computer.

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

3 a) Describe various features of a Raspberry Pi device.


• Broadcom BCM2711, Quad core Processor Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
• 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)
• 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
• Gigabit Ethernet • 2 USB 3.0 ports; 2 USB 2.0 ports.
• Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
• 2 × micro-HDMI ports (up to 4kp60 supported)
• 2-lane MIPI DSI display port
• 2-lane MIPI CSI camera port
• 4-pole stereo audio and composite video port
• H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
• OpenGL ES 3.1, Vulkan 1.0
• Micro-SD card slot for loading operating system and data storage
• 5V DC via USB-C connector (minimum 3A*)
• 5V DC via GPIO header (minimum 3A*)
• Power over Ethernet (PoE) enabled (requires separate PoE HAT)
• Operating temperature: 0 – 50 degrees C ambient

3 b) List out various versions of raspberry pi devices till date.


COURSE CODE: 20EC0453 R20

4 a) What is a module in python? Explain with an example


Module in Python:
• Python allows organizing the program code into different modules which improves the code
readability and management.
• A module is a Python file that defines some functionality in the form of functions or classes.
• Modules can be imported using the import keyword.
• Modules to be imported must be present in the search path.

Example: create a simple module


Def add(x, y):
return (x+y)
def subtract(x, y):
return (x-y)
# importing module calc.py
import calc
print(calc.add(10, 2))
Output: 12
# importing sqrt() and factorial from the
# module math from math import sqrt, factorial
# if we simply do "import math", then
# math.sqrt(16) and math.factorial()
# are required.
print(sqrt(16))
print(factorial(6))

4 b) Explain in brief about the OOP concepts.


Main Concepts of Object-Oriented Programming (OOPs)
Class: A class is a collection of objects. A class contains the blueprints or the prototype from which the
objects are being created. It is a logical entity that contains some attributes and methods.
• Classes are created by keyword class.
• Attributes are the variables that belong to a class.
• Attributes are always public and can be accessed using the dot (.) operator. Eg : My class. My attribute
Objects: The object is an entity that has a state and behavior associated with it. It may be any real -
world object like a mouse, keyboard, chair, table, pen, etc. An object consists of:
• State: It is represented by the attributes of an object. It also reflects the properties of an object.
• Behavior: It is represented by the methods of an object. It also reflects the response of an object to
other objects.
• Identity: It gives a unique name to an object and enables one object to interact with other objects.
Encapsulation: Encapsulation in Python is the process of wrapping up variables and methods into a
COURSE CODE: 20EC0453 R20
single entity. In programming; a class is an example that wraps all the variables and methods defined
inside it.
Abstraction: Abstraction in Python is the process of hiding the real implementation of an application
from the user and emphasizing only on usage of it.
Inheritance: Inheritance is a concept in object-oriented programming where existing classes can be
modified by a new class. The existing class is called the base class and the new class is called the
derived class. In this post, we will discuss class inheritance in python.
Polymorphism: Polymorphism is taken from the Greek Words Poly (many) and morphism (forms). It
means that the same function name can be used for different types. This makes programming more
intuitive and easier.
5 a) Mention the flavors of Linux OS supported by Raspberry pi device.
Raspbian - Raspbian Linux is a Debian Wheezy port optimized for Raspberry Pi.
Arch - Arch is an Arch Linux port for AMD devices.
Pidora - Pidora Linux is a Fedora Linux optimized for Raspberry Pi.
RaspBMC - RaspBMC is an XBMC media-center distribution for Raspberry Pi.
OpenELEC - OpenELEC is a fast and user-friendly XBMC media-center distribution.
RISC OS - RISC OS is a very fast and compact operating system.
5 b) List the various frequently used commands during operation of Linux OS.
COURSE CODE: 20EC0453 R20

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)

• 28x user GPIO supporting various interface options: – Up to 6x UART – Up to 6x I2C – Up to


5x SPI – 1x SDIO interface – 1x DPI (Parallel RGB Display) – 1x PCM – Up to 2x PWM
channels – Up to 3x GPCLK outputs

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

4| NVIDIA Jetson Nano Developer Kit


• 128-core Maxwell GPU
• Quad-core ARM A57 @ 1.43 GHz CPU
• 4 GB 64-bit LPDDR4 25.6 GB/s memory
COURSE CODE: 20EC0453 R20
5| NanoPi NEO4
• Dual-Core Cortex-A72(up to 2.0GHz) + Quad-Core Cortex-A53(up to 1.5GHz) CPU
• Mali-T864 GPU supports OpenGL ES1.1/2.0/3.0/3.1, OpenCL, DX11, and AFBC GPU
• 1GB DDR3-1866 RAM
• Rockchip RK3399 SoC

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

7 a) What is the use of GPIO pins in an IoT device?


GPIO stands for General Purpose Input/Output. It’s a standard interface used to connect
microcontrollers to other electronic devices. For example, it can be used with sensors, diodes, displays,
and System-on-Chip modules. Estimote Location Beacons (Hardware Revision F2.3 and later) are
equipped with GPIO. It allows for providing external power supply, remote control of connected
devices, broadcasting more contextual data, or defining contents for custom Bluetooth data packets.

Support for GPIO is available in the latest versions of Estimote app and SDK.

GPIO can be used in three modes:

• 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

7 b) Illustrate how to interface a LED to raspberry pi and write a program to blink


LEDs are delicate little things. If you put too much current through them, they will pop (sometimes
quite spectacularly). To limit the current going through the LED, you should always use a resistor in
series with it.

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()

You might also like