May 16, 2009 AT 7:47 pm

New in the store – IR distance sensor w/cable (10cm-80cm)

Sharpdist Lrg
This SHARP distance sensor bounces IR off objects to determine how far away they are. It returns an analog voltage that can be used to determine how close the nearest object is. Comes with 12″ long 3-JST interface wire. These sensors are good for short-range detection. For over 1 m distance, we suggest using sonar sensors

To use, connect black wire to ground, red wire to 5V and white wire to analog input. The analog voltage out will range from 3V when an object is only 4″ (10 cm) away and 0.4V when the object is 32″ (80 cm) away

For more information, please see the datasheet – and check it out in our store

Here’s a quick and simple project you can do with an Arduino, a breadboard, 2 servos and the IR distance sensor – a edge detecting robot!


#include "Servo.h"

Servo leftServo;  
Servo rightServo;  
int distSensor = 0; 

void setup() {  
  leftServo.attach(10);  
  rightServo.attach(9);
}   

void loop() {  
  distSensor = analogRead(0);
  if (distSensor 

Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!



2 Comments

  1. what if there is an object closer that 10cm from the sensor? does it output higher voltages?

  2. the voltage goes back down when objects are closer than 10cm, see the datasheet for a graph

Sorry, the comment form is closed at this time.