Go Down

Topic: arduino with sharp IR sensors (Read 1 time) previous topic - next topic


so i'm working on a basic setup with 5 sharp infrared sensors, plugged into analog pins 0-4 for control, and running off the 5V power plug.  initially i tested this setup with 1 infrared sensor plugged into analog 3, getting power from the 5V.  the code i'm using is basically this:

senAval = analogRead(0);
senBval = analogRead(1);
senCval = analogRead(2);
senDval = analogRead(3);
senEval = analogRead(4);

when i was initially testing with the one sensor, it was basically just two lines of code, and the arduino was returning different values based on my proximity to the sensor (between ~20 and ~500), which seemed to be correct.  when i got 5 sensors plugged in, and duplicated the code the only response i could get back is 1023.

did i damage the sensors (all of them??  seems unlikely)?  did i screw something up when i re-connected all of the control wires to the analog pins?


Can you provide the part number of your sensors or a link to a data sheet for them? The 3 terminal IR receiver devices I am familiar with output a digital signal not a analog signal. Here is a project using such a sensor from the playground.







Sorry Brad, I have no experiance with that type of sensor. Seems like does output a analog voltage. Perhaps you could use a digital volt meter to see if there is valid voltage coming out of the sensor(s).



i think i found some bad solder points, so, that may be the problem!


Make sure that the emitting LED is not interfering with a sensor not associated with it. As a test tape up all but one connector so no light gets out of it. See if this illimates the problem. If so you have a mechanical placement problem rather than an electrical one.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131