The infrared distance sensor connects to an Arduino with the black wire to ground, red to 5V, and white to an analog input. Serial print is used to read voltage values from the sensor in the serial monitor, with higher voltages indicating closer objects. Inside the sensor, an infrared LED and sensor measure the time for light to bounce back and change the output voltage. Stranded wires on the sensor increase flexibility compared to litz wire used for high frequency signals, and can be soldered to header pins for easier breadboard use.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
27 views1 page
How To Use Infrared Sensor
The infrared distance sensor connects to an Arduino with the black wire to ground, red to 5V, and white to an analog input. Serial print is used to read voltage values from the sensor in the serial monitor, with higher voltages indicating closer objects. Inside the sensor, an infrared LED and sensor measure the time for light to bounce back and change the output voltage. Stranded wires on the sensor increase flexibility compared to litz wire used for high frequency signals, and can be soldered to header pins for easier breadboard use.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
ENGRI 1820
ELCA Fall 2015
How to use Infrared Sensor
The infrared distance sensor provided is from adafruit (https://www.adafruit.com/products/164). To use this, plug the black wire to ground, the red cable to 5V, and the white cable to an analog input of the Arduino. Use Serial.println() in your code and serial monitor to find out what values the Arduino is getting from the sensor. The voltage goes higher when an object is closer, as you can see by the graph below, taken from the datasheet. One of the black dots on the sensor is an infrared LED, the other is a sensor. Theres some electronics inside to change the output voltage based on the time it takes for the infrared light to bounce back.
Youll notice the wires connected to the infrared
sensor are made of a bunch of noninsulated smaller wires (see picture to the above right). This type of wire is called stranded wire and is used to increase the flexibility of a connection. This is different than litz wire, which is a braid of smaller, insulated wires and used to carry high frequency signals. It might be easier to solder these stranded wires to header pins to make it easier to interface with the breadboard. Fun side note: your phone camera can detect some infrared light! With the sensor powered up, use your camera to see which part of the sensor is the infrared LED.