Intro

The pandemic has made us cautious about touching public objects. Even pressing elevator buttons has become a concern. In response, protective films are used on high-touch surfaces and people often use personal items to avoid direct contact. I visited a department store in South Korea that introduced me to 'touchless buttons,' in the elevator highlighting the pace of our changing world.

This experience resurfaced as I began researching sensors, leading me to consider their potential role in enhancing accessibility—a realization of my interest in delving deeper into this field.

IR Sensor | Proximity Sensor

Untitled

Description

The Infrared (IR) Sensor is an advanced and sensitive detection device. Unlike conventional sensors, it offers a broader range of detection, enabling dynamic interactions from the user. The sensor functions by transmitting an infrared light beam and measuring the time taken for the reflected light to return, thereby determining the distance of an object with precision. This sophisticated technology consists of a transmitter and receiver that work in harmony, activating when they detect variations in infrared light intensity. This makes IR sensors particularly effective in applications like proximity sensing, object detection, or even gesture recognition.

What does the sensor do? How does the sensor work?

An Infrared (IR) sensor is a device that measures infrared radiation to assess its environment. It operates in two primary modes: active and passive. Active IR sensors emit infrared light using an IR LED, which reflects off objects and returns to the sensor's detector, allowing it to determine properties such as distance or object presence.

circuit diagram

Untitled

Code

// Arduino IR Sensor Code

int IRSensor = 9; // connect ir sensor module to Arduino pin 9

int LED = 13; // conect LED to Arduino pin 13

void setup()

{

  Serial.begin(115200); // Init Serila at 115200 Baud

  Serial.println("Serial Working"); // Test to check if serial is working or not

  pinMode(IRSensor, INPUT); // IR Sensor pin INPUT

  pinMode(LED, OUTPUT); // LED Pin Output

}

 

void loop()

{

  int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input

 

  if (sensorStatus == 1) // Check if the pin high or not

  {

    // if the pin is high turn off the onboard Led

    digitalWrite(LED, LOW); // LED LOW

    Serial.println("Motion Ended!"); // print Motion Detected! on the serial monitor window

  }

  else

  {

    //else turn on the onboard LED

    digitalWrite(LED, HIGH); // LED High

    Serial.println("Motion Detected!"); // print Motion Ended! on the serial monitor window

  }

}

Tutorial

Automatic Light Project | IR sensor | Digital Sensor | Proximity Sensor | Arduino | Robotics