Uno - Inconsistant analogRead values / supply voltages

Ok, Im stumped, but not in panic mode, so I’ll try to explain and be as detailed as I can, however, there’s not much ‘detail’ to the issue.

I have a Uno reading a LM335 every 5 seconds. I have a Xbee Series 1, transmitting data back to the PC.

My issue is this -

reading the LM335 with the Uno connected to the SFE-9FD (+9vdc) power supply , the readings are correct, +/-1 degree.

reading the LM335 with the Uno connected to JUST USB power, the readings the readings increase.

reading the LM335 with the Uno connected to a 9vdc battery pack, the readings decrease.

Now, to be more technical, The LM335 output is connected as - pin 1 is NC, pin 2 is 3v with 2.2K outputting to A0 and pin 3 is ground, and works within specs when connected to the SFE-9FD power supply.

I decided to monitor the +5 and +3 output’s with A1 and A2, and then converting it to a voltage reading to be sent with the serial data as well.

Setting 1, from above, the 5v output is 5.01v, 3v output is 3.33v

Setting 2, from above, the 5v output is 5.01v, 3v output is 3.33v

Setting 3, from above, the 5v output is 5.01v, 3v output is 4.25v

As far as output, Room temp is 76.0 degrees.

With just the power supply, it shows 77.3, I’m fine with that. With the USB supplying power, It goes start to jump between 84.3 and 86.7 and doing just a 9vdc battery pack, it goes 233+ because of a high output on the 3v rail of the Uno.

Since this sensor will be battery/solar operated, should I just reconfigure the LM335 for the 5v supply, which the Uno seems pretty good to keeping regulated, or am I totally overlooking a reason/solution to why the Uno is all over the place with the 3v rail?

Thanks in advance

Yes, I may have overkilled the info, but you cant really flame me for not providing enough info and showing that I have done my homework on it instead of just a ‘hey, it doesnt work’ question :wink:

From my quick read of the LM335 datasheet, the output would be expected to change not just based on temperature but as a function of supply voltage. Your best bet is to remove the voltage variable by running the part from a well regulated supply. Something that will not change with sunlight of battery level.

I agree, thinking along the lines of a 3.3v regulator being fed by the onboard 5v rail to smooth things out. Which brings up the next question …

Anyone else experienced or know why the 3v rail of the Uno jumps around so much? I would assume the onboard regulator would keep it pretty constant, but 9v coming for the SF wall-wart and 9v coming from a battery pack isn’t the same, with the battery pack showing higher output on the 3v side. I would have expected the exact opposite, with the wall-wart giving a little too much voltage, but I’m scratching my head.

rvaughan:
reading the LM335 with the Uno connected to the SFE-9FD (+9vdc) power supply , the readings are correct, +/-1 degree.

reading the LM335 with the Uno connected to JUST USB power, the readings the readings increase.

reading the LM335 with the Uno connected to a 9vdc battery pack, the readings decrease.

I decided to monitor the +5 and +3 output’s with A1 and A2, and then converting it to a voltage reading to be sent with the serial data as well.

Setting 1, from above, the 5v output is 5.01v, 3v output is 3.33v

Setting 2, from above, the 5v output is 5.01v, 3v output is 3.33v

Setting 3, from above, the 5v output is 5.01v, 3v output is 4.25v

am I totally overlooking a reason/solution to why the Uno is all over the place with the 3v rail?

Have you tried checking any of the voltages with an independent device, such as a multimeter?

When you use the analog-to-digital converter (ADC) on an Arduino, what you are measuring is the ratio of the voltage on the analog input (AI) pin to the reference voltage (Vref). The ratio is reported on a scale of 0 to 1023.

By default, IIRC, Vref is the 5 V rail of the Arduino. If your power supply is weak (that is, under load, it produces less than the required voltage), the 5V rail will sag and things compared to it will appear to have higher voltage. It is, in your case, possible that, when you use the battery, the “5 V” rail and, therefore, Vref, is only ~3.5 V. So, the 3V rail, if it were at 3 V, would be reported as being 3 V * (5 V/3.5 V) = 4.3 V.

Moving on to the sensor:

You describe your connection as, in part, “pin 2 is 3v with 2.2K outputting to A0”. Under what conditions do you have 3 V at pin 2?

If the voltage drop across the LM335 were 0 V, the current would be (3 V/ 2200 Ω = 1.36 mA). However, at the temperature you reported of 76 °F = 24.4 °C = 297.6 K, the nominal voltage drop across the LM355 is (297.6K * 10 mV/K = 2.976 V). That leaves 0.024 V to drop across your resistor, giving a current of (0.024 V/ 2200 Ω = 10.9 µA) , which is well below the minimum specified operating current of 400 µA.

I suggest you try using an ~5 V power supply, as SparkFun recommends on its catalog page. at room temperature, that should provide (5 V - (298 K * 10 mV/K) = 2.02 V) to drop across your resistor, resulting n a current of (2.02 V/ 2200 Ω = 918 µA =0.918 mA), which is comfortably within the specified 400 µA to 5 mA operating current range.

Good Luck,

Eric