Eman Tarek
Published © MPL-2.0

IR Sensor Module

IR sensor module is used to detect motion and trigger a relay for automation tasks like lighting or alarms. Simple and no coding needed.

IntermediateFull instructions provided6 hours86
IR Sensor Module

Things used in this project

Hardware components

Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 100 ohm
Resistor 100 ohm
×1
PCBWay Header 3 position
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
General Purpose Dual Op-Amp
Texas Instruments General Purpose Dual Op-Amp
×1
LED, Infrared
LED, Infrared
×1
LED (generic)
LED (generic)
×1

Software apps and online services

Circuit Maker
CircuitMaker by Altium Circuit Maker

Hand tools and fabrication machines

Circuit Board PCB Holder, Rapid Assembly
Circuit Board PCB Holder, Rapid Assembly

Story

Read more

Custom parts and enclosures

IR Sensor Module PCB

R sensor module used to detect motion and trigger a relay for automation tasks like lighting or alarms. Simple and no coding needed.

Schematics

IR Sensor Module Schematic

R sensor module used to detect motion and trigger a relay for automation tasks like lighting or alarms. Simple and no coding needed.

Code

IR Sensor Module Code

Python
import RPi.GPIO as GPIO
import time

sensor_pin = 17  

GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor_pin, GPIO.IN)

try:
    while True:
        if GPIO.input(sensor_pin) == GPIO.HIGH:
            print("Object Detected")
        else:
            print("No Object")
        time.sleep(0.5)

except KeyboardInterrupt:
    print("Exiting Program")

finally:
    GPIO.cleanup()

Credits

Eman Tarek
3 projects • 0 followers
Electronics engineering student. I design complex hardware-only circuits using logic ICs, sensors, and analog components. No coding.
Contact

Comments

Please log in or sign up to comment.