Bukit Mertajam, Penang

Getting Started with Medium range Infrared Sensor ( IR01A) with Arduino

This article is written by internship student Yunus (UNITEN)

This Medium Range Infrared sensor offers simple, user-friendly and fast obstacle detection using infrared; it is non-contact detection. The implementations of modulated IR signal immune the sensor to the interferences caused by the normal light of a light bulb or the sunlight. The sensing distance can be adjusted manually.

IR01A uses a special sensor to modulate IR signal emitted from 2 IR transmitters and detects the modulated IR signal reflected back from a nearby object. This sensor has a built-in IR LED driver to modulate the IR signal at 38KHz to match the built-in detector. This modulated IR signal immunes the sensor from the interferences caused by the normal light of a light bulb or the sunlight and will give HIGH output if no object is detected and a LOW if an object is detected.

This tutorial will show you how to operate this sensor using Maker UNO.


  • 5V powered, low current consumption, less than 10mA.
  • 3 pin interface which is signal, GND and 5V.
  • Small LED as an indicator of detection status.
  • Obstacle detection up to 8cm.
  • Adjustable sensing range (2cm – 8cm).
  • Small size makes it easy to assemble.
  • Single bit output.
  • Compatible with all types of microcontrollers.
  • Dimension: 2.6cm x 2cm




    1. Solder Right Angle Pin Header (Male) to the IR01A hole.
    2. Build circuit as in the schematics :
    3. Sketch the following code in the Arduino IDE :
      /*Created on 4/5/2018 by Cytron Technologies
       *IR01A - Medium Range Infrared Sensor 
       *Product page - https://www.cytron.io/p-ir01a 
      int IR_pin = A0;			//Set IR pin to pin A0 of MakerUNO
      void setup() {
        pinMode(IR_pin, INPUT);		//Set IR_pin as INPUT
        Serial.begin (9600);		//Communication baud rate use 9600
      void loop() {
        int IR_Reading = digitalRead (IR_pin);	//Get the reading input for the IR01A
        Serial.print(" IR Reading = ");  	//Print the IR Reading on Serial Monitor
        Serial.println(IR_Reading);		//Print the value of IR Reading
    4. Upload the code and enjoy it!
LOW condition when nothing detected.
HIGH condition when something is detected.


  1. IR01A User’s Manual
  2. IR01A Fritzing File

Note: For further inquiries or discussions, please visit our forum.

Related Posts

Leave a comment