Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Correct way of wiring IR distance sensor

Mon Oct 20, 2014 4:42 am

I have a Sharp 100-500cm IR distance sensor.

I've tried to follow the blog posts online, but can't figure it out. I have wired up an MCP3008 as per http://jeremyblythe.blogspot.co.uk/2012 ... nputs.html and I've tried to follow the directions from Adafruit on wiring up the sensor. If I use the code to translate distance, I get anywhere between 30-50cm (which clearly isn't right for a sensor for 100-500cm).

I've got the 220uF capacitor that came with the sensor in there, but I'm not sure I'm putting it in the right place to be effective. I can't find any examples of where to actually put the capacitor in relation to the VCC/GND of the sensor other than the sentence "Connect the + pin of the capacitor to the Vcc wire connection, and the - pin of the capacitor to the GND wire connection". Does that actually mean

VCC(5v)---(sensor VCC)----Capacitor---(sensor GND)---GND

Any ideas what I'm doing wrong?

User avatar
Posts: 14605
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Correct way of wiring IR distance sensor

Mon Oct 20, 2014 6:08 am

The capacitor is connected to the voltage supply, presumably to smooth out any variability.

So connect the capacitor + to +ve and the capacitor - to ground.

The IR sensor should also be connected to +ve and ground.

The capacitor and IR sensor are connected in parallel to the power supply.

Return to “Automation, sensing and robotics”