Electronics and IoT Practical Exercises

FlatterMoscovium avatar
FlatterMoscovium
·
·
Download

Start Quiz

Study Flashcards

14 Questions

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.

5/1024

What does the map() function in Arduino help us do?

Convert a value from one range to another

What does the 'analogWrite()' function do in Arduino?

Adjusts LED brightness based on sensor value

What is an IR sensor also known as?

Infrared sensor

Which components does an IR sensor typically consist of?

IR transmitter

IR Emitter emits visible light.

False

The distance threshold of the IR sensor can be set by adjusting the ____________ on the board.

potentiometer / trimpot

Match the following pins connections for the IR sensor to Arduino UNO:

Vcc = Vin / 5V GND = GND OUT = pin 9 +ve end of LED = pin 13, and –ve to GND

What does PIR stand for?

Passive Infrared

What voltage is the input voltage for typical applications of a PIR sensor?

+5V

What technology does the Ultrasonic Sensor HC-SR04 use to determine distance?

Sonar

The Echo pin of the Ultrasonic sensor is used to initiate the ultrasonic pulse.

False

The Trigger pin of the Ultrasonic Sensor is used to initiate the ____________ pulse.

ultrasonic

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, and res is set to 0.0
  • R1 is set to 1500.0 (1K) and R2 is set to 1000.0 (1.5K)
  • vin is calculated as (value * 0.5) / 1024.0 and res is calculated as R2 / (R1 + R2)
  • vout is calculated as vin * res

Smoke Sensor Code

  • sensorPin is set to A0 (MQ2 sensor analog pin) and ledPin is set to 6 (LED pin)
  • sensorValue is read using analogRead(sensorPin)
  • outputValue is calculated using map(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

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.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Resistors and Electric Circuits Quiz
10 questions
Electronics Definitions and Color Codes Quiz
10 questions
Parallel Resistor Calculation Quiz
6 questions
Resistors in Electric Circuits
14 questions
Use Quizgecko on...
Browser
Browser