Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1] 2   Go Down
Author Topic: Analog ports disturbed  (Read 2795 times)
0 Members and 1 Guest are viewing this topic.
Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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% smiley-mad
Why?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 654
Posts: 35023
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 234
Posts: 14296
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 228
Posts: 6644
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 228
Posts: 6644
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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.

Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here ther is the project with freezing


* prog moto.PNG (70.07 KB, 821x391 - viewed 26 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 654
Posts: 35023
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can you post a photo of your setup?
It is not a photo is it?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 228
Posts: 6644
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

0
Offline Offline
Shannon Member
****
Karma: 226
Posts: 12963
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

The transistor is a TIP121

The potentiometer is connected just like in the sketch!

 smiley


* WP_20130314_003.jpg (2264.83 KB, 3552x2000 - viewed 23 times.)
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 228
Posts: 6644
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Italy
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry in the skatch I miss to drag the wire to the edge of the board!  smiley-confuse

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

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Experience, it's what you get when you were expecting something else.

Pages: [1] 2   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: