arduino with sharp IR sensors

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); Serial.println(senAval); senBval = analogRead(1); Serial.println(senBval); senCval = analogRead(2); Serial.println(senCval); senDval = analogRead(3); Serial.println(senDval); senEval = analogRead(4); Serial.println(senEval);

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.