Weird analog IR sensor behaviour with different power sources

Hi guys, I’m building a line follower. I’ve used 5 analog IR sensors. I get high values on a black surface and low values on white. I’m facing some trouble with analog IR sensors while using different power supplies. Here’s a screen shot of actual sensor data(picture attached):

These are the readings obtained from the sensors with different power supplies. These sensor readings were taken keeping the line follower at a fixed position over the line. I suspect the unusual sensor readings for the second case is due to irregular voltage spikes. Can somebody please suggest a solution? Any rectifier circuit that I need to add? I wish to use both batteries as well as the battery eliminator for providing power(not simultaneously).

I’ve used a 7805 power regulator with two 10uF 63V capacitors for regulated 5V supply. One capacitor is connected between 7805’s input and Gnd, and other is connected between 7805’s output and Gnd.

Here’s a description of analog IR sensor, commonly used in line following applications. http://www.pololu.com/catalog/product/958
They give an analog output depending upon how much black or white surface they see. S1 to S5 are the readings of 5 sensors I’m using in my bot. Line is the weighted mean of the 5 sensor readings(this column may be ignored). I’m not using the pololu ones, but a similar circuit with tweaked resistances and locally available IR sensor and emitter. When a sensor is over a black surface, it gives high values and when on white, gives low values. I connected the sensors to analog inputs of a arduino, which interprets the sensor input in the range 0 to 1000.

Do you have a schematic of your circuit?

It's kind of hard to guess what is going on without a diagram or something. More information about your setup means more help here from my experience, especially more information about the power supplies. Sounds like a 9V and something else.

The first thing I would suggest checking is that your ir leds are actually illuminated with the non-working supply. I use my cellphone camera for this.

Hey I finally solved the issue. The problem indeed was due to voltage ripples from the eliminator. I added a 100uf capacitor(between Vin and Gnd) and a 0.1uF capacitor(between Vout and Gnd) to my 7805 circuit and voila! The sensor readings became much more stable, even lesser fluctuating than those in the table! The 100 uF cap smooths out the bigger ripples, while the 0.1 uF cap smooths out the high frequency ripples after the 7805.