In this article you will find out what an IR sensor D is and how to use it
The sensor contains 2 elements: an infrared LED that emits light in the infrared range, and a sensitive photocell. If there is a reflective surface near the sensor, part of the light returns to the photocell. The closer the surface and the “whiter” it is, the more light returns to the receiver, the higher the sensor readings. The sensor transmits the value 0 and 1.
The IR sensor D is Lego- and Arduino-compatible.
Technical description:

– Size (L*W*H): 40x24x24
– Lego compatible body
– (PIN D) The sensor registers the reflection of the light signal and changes the value of PIN D 1\0 (White\Black colour)
– Working voltage: 5V
– Connector for connecting to another device: XH 3pin

Functionality when connected to RED X controller:

The infrared sensor registers the amount of reflected infrared light.

IR sensor (D) connecting scheme

RED Code Example
*Physically, if the IR sensor D sensor connected to port D2 reads white colour, then the servomotor connected to port D1 rotates by zero degree, otherwise the servomotor rotates by 180 degrees

Technical support

Technical support in Telegram

© R:ED – Robotics Education. All rights reserved