Analog ports disturbed

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?

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

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

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);

What are the values of the resistors in the voltage divider?

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

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?

Here ther is the project with freezing

Can you post a photo of your setup?

It is not a photo is it?

Your diagram shows a transistor of some sort connected to digital pin 11. What type is it?

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

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

The transistor is a TIP121

The potentiometer is connected just like in the sketch!

:slight_smile:

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.

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! :zipper_mouth_face:

MarkT:
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.

The wiring of the pot in the photo looks correct to me, assuming it is a normal pot with the wiper being the middle connection.

dc42:
The wiring of the pot in the photo looks correct to me, assuming it is a normal pot with the wiper being the middle connection.

Ok I'm blind, I magnified it and now I can see that the orange wiper wire extends beyond the power bus and into A1. What about the red wire on the outer tab of the pot? It "appears" to be connected to an empty bus strip I think. Also I see a ground wire connecting the bottom negative bus to the top one, but I don't see a positive wire extending to the bottom bus.

I found the problem. When I store a value from analogRead and then use it in analogWrite, all the other analog ports gets disturbed.

Do you have the same problem?

If analogWrite interferes with analogRead, this normally means that you have a common ground wire serving your input and output devices, and a dodgy connection in that ground wire.

Yes you are right!!! Thank you so much!!!

But What should I do to solve the problem?