Assignment -1 Ans
Assignment -1 Ans
Unit-2
Q-1:What is sensor? Explain heart-beat sensor.
1
IOT assignment
2
IOT assignment
3
IOT assignment
4
IOT assignment
5
IOT assignment
6
IOT assignment
7
IOT assignment
Q-2: What is Sensor ? list diff. type of sensors used to
develop IOT.
8
IOT assignment
9
IOT assignment
#define SamplingInterval 20
int pHArrayIndex = 0;
10
IOT assignment
void setup() {
pinMode(SensorPin, INPUT);
void loop() {
samplingTime = millis();
if (pHArrayIndex == ArrayLength) {
pHArrayIndex = 0;
int avgValue = 0;
avgValue += pHArray[i];
avgValue /= ArrayLength;
11
IOT assignment
// Convert voltage to pH value (assuming sensor output ranges from 0-14 pH)
Serial.println(phValue);
} else {
Serial.println("Unknown Substance");
Serial.println("--------------------");
12
IOT assignment
What is ARM?
ARM (Advanced RISC Machine) is a family of Reduced Instruction Set Computing (RISC) architectures
developed by ARM Holdings. ARM processors are widely used in embedded systems, smartphones,
tablets, IoT devices, and even some computers due to their high efficiency and low power consumption.
ARM processors have several unique features that make them popular in various applications:
1. RISC Architecture
o Uses a simplified instruction set that allows for faster processing compared to Complex
Instruction Set Computing (CISC) architectures.
13
IOT assignment
o Designed for energy efficiency, making them ideal for mobile devices and embedded
systems.
o Supports Thumb mode, which allows 16-bit instructions, reducing memory usage while
maintaining performance.
4. Pipelining
o ARM processors have large register sets, which reduce the need for memory accesses.
6. Load/Store Architecture
o Data processing operations only work with registers, and memory is accessed using load
and store instructions, improving efficiency.
o Includes different modes like User Mode, Supervisor Mode, and IRQ Mode, providing
better control and security.
o Some ARM processors have TrustZone technology, which allows running secure and
non-secure applications separately.
o Some ARM processors support NEON technology, which enhances multimedia and
signal processing tasks.
10. Scalability
• ARM processors range from simple microcontrollers (ARM Cortex-M series) to powerful
processors (ARM Cortex-A series) used in smartphones and computers.
CSPR in ARM
CSPR stands for Current Program Status Register in ARM architecture. It is a key register that stores
system status and control information.
Functions of CSPR:
14
IOT assignment
1. Condition Flags
o Stores flags (N, Z, C, V) that reflect the result of arithmetic or logical operations:
2. Mode Bits
o Determines the processor's operating mode (User, Supervisor, FIQ, IRQ, etc.).
o Controls the enabling and disabling of IRQ (Interrupt Request) and FIQ (Fast Interrupt
Request).
4. State Bits
o Defines whether the processor is operating in ARM (32-bit instructions) or Thumb (16-
bit instructions) mode.
1. CPSR (Current Program Status Register) – Stores the current execution state.
2. SPSR (Saved Program Status Register) – Used to save CPSR values when switching between
modes (like interrupts).
The pinMode() function is used to configure a specific digital pin as an input or output.
15
IOT assignment
• mode → The mode of operation, which can be:
Example:
void setup() {
2. digitalRead(pin)
The digitalRead() function reads the value from a digital input pin and returns HIGH (1) or
LOW (0).
Example:
void loop() {
if (buttonState == HIGH) {
} else {
16
IOT assignment
}
3. digitalWrite(pin, value)
The digitalWrite() function sets a digital output pin to HIGH (5V) or LOW (0V).
Syntax:
digitalWrite(pin, value);
Example:
void loop() {
17
IOT assignment
Q-6:Explain 80851 Architecture with various register
set.
18
IOT assignment
19
IOT assignment
20
IOT assignment
21
IOT assignment
Unit-3
Q-1: What is IP addressing? Explain with dia. IPV4
Header format.
What is IP Addressing?
IP (Internet Protocol) addressing is a system used to identify devices on a network. Each device
connected to a network (such as a computer, smartphone, or router) is assigned a unique IP address
that allows it to send and receive data.
22
IOT assignment
23
IOT assignment
24
IOT assignment
25
IOT assignment
26
IOT assignment
Q-2:Draw & Explain IPV6 Header format.
27
IOT assignment
28
IOT assignment
29
IOT assignment
Q-3:Compare IPV4 & IPv6
30
IOT assignment
Q-4:Differentiate COAP & MQTT
31
IOT assignment
Q-5: Explain MQTT Broker & client
32
IOT assignment
33
IOT assignment
34
IOT assignment
35
IOT assignment
36
IOT assignment
Q-6: what is COAP & MQTT ? List out the key features
of COAP.
What is CoAP & MQTT?
1. CoAP (Constrained Application Protocol)
CoAP is a lightweight web-based protocol designed for low-power IoT devices that operate in
constrained environments. It follows a client-server model and is similar to HTTP but optimized
for IoT.
37
IOT assignment
MQTT is a publish-subscribe messaging protocol designed for reliable, real-time
communication between IoT devices. It uses a broker to manage messages between devices.
1. Lightweight Protocol
o Uses UDP (User Datagram Protocol) instead of TCP, reducing overhead and
latency.
2. Request-Response Model
o Works like HTTP, allowing devices to GET, POST, PUT, DELETE resources.
3. Low Power Consumption
o Optimized for battery-powered IoT devices.
4. Supports Asynchronous Messaging
o Devices can send responses later if processing takes time.
5. Built-in Reliability Mechanisms
o Uses Confirmable (CON) and Non-confirmable (NON) messages to ensure
message delivery.
6. Multicast Support
o Allows one-to-many communication, reducing network load.
7. Security via DTLS (Datagram Transport Layer Security)
o Provides encryption and authentication for secure communication.
8. Interoperability
o Works with RESTful APIs and integrates easily with HTTP-based systems.
38
IOT assignment
Q-7: What is BLE? Explain components of BLE
39
IOT assignment
40
IOT assignment
41
IOT assignment
42
IOT assignment
43
IOT assignment
44
IOT assignment
45