Go Down

Topic: ADC reading changes when digital pins are HIGH (Read 1 time) previous topic - next topic

maddios

Ok, seems I've found my cuprit, looks like my sensor is broken. I just put my dvm across the sensor's output pin and ground, it'll read .706v at room temp, but randomly i see the number jump around. down to like .62 and below, then recovers to .706 again. It does this while supply voltage is stable at 5.052+-.003

I guess I'll just leave it at this, a purely academic test, though a very effective one since I learned a lot.

I have a DHT22 temp/humidity sensor on order from sparkfun.

MarkT

The Arduino board connects the digital and analog supplies together - this compromises analog accuracy considerably, you need a custom board with separate analog and digital supplies, regulator and ground planes to improve things.  The most likely reason for the disturbance is the regulator output voltage changing as the pin switches due to the increased current demand, or an IR voltage developed in the supply traces.  We are talking 15mV or so to trigger a few LSBs.
[ I won't respond to messages, use the forum please ]

Coding Badly

I think there might be something else going on, specifically with the internal reference shifting a little bit. My guess is the internal reference is a current shunt and if you're driving current out of the chip by setting a digital pin high, you can subtly change the reference voltage


What a coincidence!  I just finished a several week test using an ATtiny85 processor with varying supply voltages, ambient temperatures, and output pins.  The internal voltage reference varied from 1.087 to 1.092; a range of about 0.45%.  The supply voltage and ambient temperature seemed to effect the reference.  The output pins did not.

Quote
(which is NOT a precise reference)


It is certainly not always "1.1 volts" but, in my experience, it is very stable.

Snowman

Have you tried to measure how much AC is on your sensor output?  0.01 or 0.1uf cap to ground may help
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

retrolefty

I found that a .1ufd cap from the aref pin to ground helped quite down a +/- 2 count variation measuring a fixed DC input. Funny it helped one board, a RS-232 serial arduino, but wasn't needed on my Seeeduino mega board, go figure. Hey it's analog, if it was pure digital any code monkey could handle it.  8)

Go Up