Podcast
Questions and Answers
What is the formula used to calculate Vout in the given IoT practical exercise?
What is the formula used to calculate Vout in the given IoT practical exercise?
Vout = Vin * R2 / (R1 + R2)
In the provided Arduino code, each step represents approximately __ volts or 0.00488 volts.
In the provided Arduino code, each step represents approximately __ volts or 0.00488 volts.
5/1024
What does the map() function in Arduino help us do?
What does the map() function in Arduino help us do?
What does the 'analogWrite()' function do in Arduino?
What does the 'analogWrite()' function do in Arduino?
Signup and view all the answers
What is an IR sensor also known as?
What is an IR sensor also known as?
Signup and view all the answers
Which components does an IR sensor typically consist of?
Which components does an IR sensor typically consist of?
Signup and view all the answers
IR Emitter emits visible light.
IR Emitter emits visible light.
Signup and view all the answers
The distance threshold of the IR sensor can be set by adjusting the ____________ on the board.
The distance threshold of the IR sensor can be set by adjusting the ____________ on the board.
Signup and view all the answers
Match the following pins connections for the IR sensor to Arduino UNO:
Match the following pins connections for the IR sensor to Arduino UNO:
Signup and view all the answers
What does PIR stand for?
What does PIR stand for?
Signup and view all the answers
What voltage is the input voltage for typical applications of a PIR sensor?
What voltage is the input voltage for typical applications of a PIR sensor?
Signup and view all the answers
What technology does the Ultrasonic Sensor HC-SR04 use to determine distance?
What technology does the Ultrasonic Sensor HC-SR04 use to determine distance?
Signup and view all the answers
The Echo pin of the Ultrasonic sensor is used to initiate the ultrasonic pulse.
The Echo pin of the Ultrasonic sensor is used to initiate the ultrasonic pulse.
Signup and view all the answers
The Trigger pin of the Ultrasonic Sensor is used to initiate the ____________ pulse.
The Trigger pin of the Ultrasonic Sensor is used to initiate the ____________ pulse.
Signup and view all the answers
Study Notes
IoT Practical Exercises
- Resistor/Resistor configuration: Vin is the input voltage, Vout is the output voltage, and Vout = Vin * R2 / (R1 + R2)
Resistor/Resistor Code
-
analogInput
is set to 1,vout
is set to 0.0,vin
is set to 0.0, andres
is set to 0.0 -
R1
is set to 1500.0 (1K) andR2
is set to 1000.0 (1.5K) -
vin
is calculated as(value * 0.5) / 1024.0
andres
is calculated asR2 / (R1 + R2)
-
vout
is calculated asvin * res
Smoke Sensor Code
-
sensorPin
is set to A0 (MQ2 sensor analog pin) andledPin
is set to 6 (LED pin) -
sensorValue
is read usinganalogRead(sensorPin)
-
outputValue
is calculated usingmap(sensorValue, 0, 1023, 0, 255)
-
map()
function is used to convert a value from one range to another -
analogWrite(ledPin, outputValue)
is used to adjust LED brightness based on sensor value
Map() Function
-
map()
function is used to convert a value from one range to another - Example: if sensor reading is 0, LED brightness is 0, and if sensor reading is 1023, LED brightness is 255
IR Sensor
- IR sensor detects infrared radiation in its surroundings, which is not visible to the human eye but can be felt as heat
- Consists of an IR transmitter and receiver; the transmitter emits IR radiation, and the receiver detects any reflected or emitted radiation
- Can detect objects between 2cm and 30cm within the view of the IR LED and Photoresistor
- Has three pins: two power pins (VCC and GND) and a sense/data pin
- Can be connected to an Arduino board, with the OUT pin connected to pin 9 and the LED connected to pin 13
PIR/Motion Sensor
- Passive Infrared sensor detects motion based on changes in infrared light in the environment
- Ideal for detecting human movement in or out of the sensor range
- Has three pins: VCC, GND, and OUT; VCC requires +5V for typical applications
- OUT pin provides a digital pulse high (3.3V) when triggered (motion detected) and digital low (0V) when idle (no motion detected)
- Can be connected to an Arduino board, with the OUT pin connected to digital input pin 2 and the LED connected to pin 13
Ultrasonic Sensor HC-SR04
- Uses sonar to determine the distance to an object, measuring the distance by emitting ultrasonic sound waves and receiving the waves that bounce back
- Measures distances from 2cm to 400cm
- Has four pins: VCC, GND, Trig (Trigger), and Echo
- Trig pin initiates the ultrasonic pulse, and the Echo pin detects the ultrasonic waves reflected back from an object
- Can be connected to an Arduino board, with the Trig pin connected to pin 9, the Echo pin connected to pin 10, and the LED connected to pin 13
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
This quiz covers practical exercises related to IoT and electronics, focusing on resistor circuits and voltage calculations. It includes programming exercises in C++ for Arduino.