Friday, 18 May 2018

arduino - Sharp IR distance sensor outputting consistently high voltage


I am on a steep learning curve, and a bit bamboozled by my sharp distance sensor (data sheet). I am building a project with two distance sensors that signal an Arduino to operate a servo motor when an object comes into range. This currently works well, except that the sensors are outputting a relatively high voltage all the time, so I have to set a very high cutoff voltage in the Arduino code, or the motor is triggered all the time - eg both sensors are giving the Arduino numbers like 350-450 via the analog Read command (which should be about 1.7 - 2.1V as far as I understand it) all the time. This means that if I set a cutoff of 550 or 600, the setup works, but only if an object is within 12cm of the sensor (which should be able to detect objects as far away as 80cm). The sensors are not optically interfering with each other.


I am using an old computer ribbon cable to connect both sensors to the Arduino and I am suspicious that this is somehow causing noise in the output voltage, but the Arduino never seems to be read values less than about 300 (1.4V), and I would have expected noise to give some low readings sometimes. Any help would be greatly appreciated. I tried posting a circuit diagram, but as a guest user, the site won't let me. Also, I'd post the code, but it is embarrassingly messy. The Arduino and the servo have separate power sources with common ground, the sensors are powered from the regulated 5V Arduino supply, and connected to separate analog pins.


<code>circuit diagram</code>




No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...