FIFA-2022 Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
8.8k views
in Tutorial & Interview questions by Goeduhub's Expert (9.3k points)
Interface Infrared (IR) Sensor with Raspberry-Pi

1 Answer

0 like 0 dislike
by Goeduhub's Expert (9.3k points)
selected by
 
Best answer

Working of Infrared (IR) Sensor

Interface Infrared (IR) Sensor often used as Obstacle Detecting Sensors or Proximity Sensors. An IR Sensor Module basically consists of three parts: an IR Transmitter, an IR Detector and a control circuit.

Usually, an IR LED is used as an IR Transmitter and a Photo Diode or a Photo Transistor (less often) is used as an IR Detector. The control circuit consists of a Comparator IC with necessary components.IR Sensor in IoT with Raspberry-PI training in Jaipur

Infrared (IR) Sensor Specification:

  • 5VDC Operating voltage
  • I/O pins are 5V and 3.3V compliant
  • ange: Up to 20cm
  • Adjustable Sensing range
  • Built-in Ambient Light Sensor
  • 20mA supply current
  • Mounting hole

Components of IR Sensor

  • Emitter: This component continuously emits the infrared signal
  • Receiver: It waits for the signal which is bounced back by obstacle
  • Indicator: On board LED to signal if obstacle is deducted by the sensor
  • Output: Could be used as Input for further processing of the signal
  • Ground: Ground/Negative point of the circuit
  • Voltage: Input voltage point of the circuit

 Infrared (IR) Sensor Pinout:

Pin Name

Description

VCC

Power Supply Input

GND

Power Supply Ground

OUT

Active High Output

 Connection: IR sensor to Raspberry-PI

IR Sensor connection with Raspberry-PI

  1.      Connect Vcc Pin of IR sensor to 5v Pin of Raspberry-pi (We are Using PIN 2)
  2.    Connect Ground Pin of IR sensor to Ground Pin of RASPBERRY-PI (We are Using PIN 6)
  3.     Connect Out PIN of IR sensor to GPIO PIN of Raspberry-PI (We are Using PIN 40) 

Python Program:


import RPi.GPIO as GPIO

import time

GPIO.setmode(GPIO.BOARD)

GPIO.setwarnings(False)

GPIO.setup(40,GPIO.IN)

while(1):

        state=GPIO.input(40)

        if state==False:

                time.sleep(1)

        else:

                print("Object Detected")

                time.sleep(1)

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory

...