Go Down

Topic: Challenge reading two analog inputs on Arduino  (Read 193 times) previous topic - next topic

MonDrew

Jan 23, 2016, 07:43 pm Last Edit: Jan 23, 2016, 11:01 pm by MonDrew
Hello,

I have tried all the suggested software and hardware resolutions (that I have found) relating to this topic and I still get one analog input being affected by the other analog input.  

Here is my application:
I am reading a temperature sensor on pin A0 and a potentiometer (setting the temperature trigger value) on pin A5.  When the pot is adjusted so that its value is close to the actual temperature of the sensor (A0), the actual temperature reading shoots up 20 degrees F.  Then the value of the temperature sensor begins to oscillate back & forth between that 20 degree range.  I continue to turn the pot until the trigger temperature value hits that high erroneous temperature reading from A0 and then the oscillation stops - but pin A0 continues to show the high erroneous temperature value.

I've tried the "two readings with 10ms wait time between reads" suggestion, as well as the "100nF between the pins and ground" suggestion.  I've also tried reading a dummy analog pin (with a pull-down resistor) between reads - but to no avail.  

I'm sure I'm not the only one performing this application, so there has to be a solution; something I'm missing.   Any help would be much appreciated.

Thanks!

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MarkT

Sounds like you are triggering something that causes disturbance to the 5V rail and affects the
readings.  Measure the 5V with a multimeter and see if it is fluctuating in this circumstance?

[ Also, what value pot are you using and what is the output impedance of the temperature
sensor?  (Which sensor?) ]
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

MonDrew

I'm using a 10K pot and the TMP36 sensor (from Sparkfun).  Yes, when I put an oscilloscope on the 5v rail, it fluctuates like crazy as soon as the trigger value (from the pot) equals the temperature sensor's value.  I've attached the circuit and the sketch.

jremington

Quote
I've attached the circuit and the sketch.
No attachment.

MonDrew

#5
Jan 23, 2016, 11:02 pm Last Edit: Jan 23, 2016, 11:46 pm by MonDrew
jremington, I have attached the schematic and sketch back in my original post.  MarkT, I can't find actual values for the output impedance in the spec sheet.  All I found was this: "The low output impedance of the TMP35/TMP36/TMP37 and its linear output and precise calibration simplify interfacing to temperature control circuitry and ADCs."

Thanks.

MonDrew

#6
Jan 24, 2016, 12:38 am Last Edit: Jan 24, 2016, 01:07 am by MonDrew
Following MarkT's tip, I found that when I insulate the 5v rail from the LED with a 2.7K resistor, the reading becomes stable.  (I should always have a resistor there anyway).  My job now is to properly substitute the LED with a relay circuit driven by an NPN transistor.

Thank you all for your help!  And I'll report back when I'm successful.

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!

Arduino
via Egeo 16
Torino, 10131
Italy