ICT Quiz 3
ICT Quiz 3
junction operate in 2.) setup serial with 115200 baud rate, print
WITH ARDUINO reverse bias direction) statement to check if serial monitor
IR Sensor (Infrared Proximity Sensor) – emits no light infinite resistance, open switch window is working, initialize IRSensor
infrared lights to sense some aspect of with light low resistance, closed switch pin as input and LED pin as output
the surroundings and can be Op-Amp (LM358) – voltage comparator;
employed to detect motion of an compare threshold voltage (pin2) to
object photodiode’s series resistor voltage
can only measure infrared radiation (pin3)
IR Sensor Pinout if pin3 drop > pin2, Opamp output = HIGH and 3.) [loop] read sensor pin with digitalRead()
1 – red – vcc (3.3v/5v operation voltage) LED is on (indicating detection of an object) and store value to sensorStatus variable
2 – black - gnd IR Motion Sensor Module – Parts
3 – blue green/green – digital output If output high = no motion detected, LED is
LOW no motion detected LOW, and print status in serial monitor
HIGH motion is detected window
1. Apply voltage to IR LED If output low = motion detected, LED is HIGH,
2. emits infrared light and print status in serial monitor window
3. light propagates through air and
hits an object
4. light gets reflected in photodiode
sensor
If object is close, reflected light is stronger
Power LED – on when power is applied to
If object is far away, reflected light is weaker
board
TWO MAIN COMPONENTS:
Signal LED – on when circuit is triggered
IR Transmitter Section – IR led is used
Arduino Code
IR Receiver Section – photodiode is used to
1.) declare (int) two global variables (1 – holds
receive ir signal before getting output
pin value where ir sensor is
IR LED (Transmitter) – emits light in IR
connected, 2 – holds value where LED
frequency range (approx.. 20-60
is connected)
degree of light-emitting angle, cm-ft
range); converts electricity into light
Photodiode (Receiver) – converts light to