Go Down

Topic: Analog ports disturbed (Read 3259 times) previous topic - next topic

olimex

Hi, thank you for your support!
I'm prototiping a sort of control panel for my motor bike, to dim lights, temperature, voltage of the battery and so on. I'm using an arduino uno now but in the final product there will be an Arduino micro.
I'm using 3 of the 5 analog ports on the board and there i a problem. When i actionate the potentiometer (10kohm) on A0, in A1 and A2 the reading is somehow influenced and changes. More precisely, when the potentiometer in at 1024 value (5.00v), the reading on the other two changes of -5%/10% :0
Why?

Grumpy_Mike

This can happen if the impedance of the other inputs is high. What are the other inputs?

olimex

A0 is the potentiometer
A1 is connected to a couple of resistor (voltage divider from 12v to 5v)
A2 is connected to a lm35 termometer

in recent test i've noticed that when A1 is to 0 (potentiometer completely closed) the reading of the other two ports is perfect and stable. When i activate the potentiometer it goes all crazy

robtillaart

you might need introduce an extra read for every analog input to give it more time to stabilize. Behind the 6 pins there is only one ADC that switches between them.

in code:

analogRead(A0);
int p = analogRead(A0);
Rob Tillaart

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

dc42

What are the values of the resistors in the voltage divider?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

olimex

the correct value is shown only when the potentiometer is at 0V.

the resistors are 4.3kohm between GND and Vout and 13kohm betwen Vout and Vin

dc42

Something is not right, those 3 devices you have connected to the analog inputs are all low-resistance sources, so there should be no interference. Can you post a photo of your setup?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

olimex

Here ther is the project with freezing

Grumpy_Mike

Quote
Can you post a photo of your setup?

It is not a photo is it?

dc42

Your diagram shows a transistor of some sort connected to digital pin 11. What type is it?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

MarkT

Sketch?  Are you doing anything with the potentiometer value that might have an impact on the supply voltage?
[ I won't respond to messages, use the forum please ]

olimex

Sorry, I thought that the wiring was a bit confusing!

The transistor is a TIP121

The potentiometer is connected just like in the sketch!

:)

dc42

One obvious problem is that you are overloading the Arduino digital output by connecting it direct to the base of the TIP121. You need to use a series resistor. 1K is a suitable value.

Your Fritzing diagram doesn't show a connection between the pot and +5V, but from the photo I can see that there is one.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

olimex

Sorry in the skatch I miss to drag the wire to the edge of the board!  :~

Thank you for the resistor, i really don't know where arduino need those pieces, but this question is off topic!  :smiley-zipper:

afremont


Sketch?  Are you doing anything with the potentiometer value that might have an impact on the supply voltage?


Ding ding ding, give that man a cigar.  Look at the pot in the fritzling thingy.  It's not wired right, it's pulling the voltage down when adjusted.  It's set up to where it can completely short the power rails if it is adjusted all the way to one side.
Experience, it's what you get when you were expecting something else.

Go Up