Winter Bootcamp in ML and IoT in Jaipur
 Course content (For Bootcamp & Winter Training):- Machine Learning (ML) || Internet of Things (IoT) || Register for winter bootcamp
0 like 0 dislike
in Tutorial & Interview questions by (3.3k points)

1 Answer

0 like 0 dislike
by (3.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)

Winter 10 Days boot-camp classes(7 HRS Daily) will start from 5, 20 & 27 December 2019 in:
1) Internet of things(IoT) Using RASPBERRY-PI
2) Machine Learning (ML)

70% OFF| Fee-INR 3,000/-

Limited seats!! Hurry up!!

[[ CALL - 07976731765 ]]

Some Study Resources are compiled from original Stack Overflow Documentation, the content is developed by the different experts at Stack Overflow. Study resources are released under Creative Commons BY-SA. Images may be copyright of their respective owners. This website is for self-learning and not affiliated with Stack Overflow. All trademarks and registered trademarks are the property of their respective company owners. Please send feedback and corrections to chandwaglobal@gmail.com.

Goeduhub Important Lists Our Youtube Channels (For free E-learning)
About Us List of IITs Goeduhub Technologies
Contact Us List of NITs AI and Big Data-HADOOP E-Learning Series
  List of PSUs Smart Learning PLC-SCADA, IoT and Raspberry-PI
  List of Exams After Graduation  
...