Go Down

### Topic: analog input alters voltage... doesn't read properly (Read 15579 times)previous topic - next topic

#### Robin2

#15
##### Apr 30, 2013, 09:03 am
I have to take issue with you on this one. Page 377 of doc8161.pdf doesn't deal with impedance. Have you a link to the document you refer to?

In any case unless your document specifically refers to the inputs to the ADC I will believe the "facts" in doc8161. Indeed I have just proved it to my own satisfaction because a 4k7 potentiometer works properly whereas a 47k pot produces jittery values from the ADC.

Oh, and there is a difference between DC impedance and AC impedance.

...R

Quote
"The ADC is optimized for analog signals with an output impedance of approximately 10 k? or less"

Extract from Section 23.6.1 of Atmel doc8161.pdf

...R
That means that the output (source) impedance of whatever is driving the ADC input should be less than 10K.  The Arduino's input impedance is much greater...  The spec sheet (page 377) says 100 Megohms minimum.

Two or three hours spent thinking and reading documentation solves most programming problems.

#### AWOL

#16
##### Apr 30, 2013, 09:11 amLast Edit: Apr 30, 2013, 09:36 am by AWOL Reason: 1
RAIN (Analogue Input Resistance) is, indeed, typically 100Mohm (section 28.8 ADC Characteristics)
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### DVDdoug

#17
##### Apr 30, 2013, 09:19 amLast Edit: Apr 30, 2013, 09:26 am by DVDdoug Reason: 1
Quote
And yes- i am sure i've got a 5v power for the Arduino- tested that a few times, its a V regulator from radioshack... solid as a rock at 5 volts.
5V into the barrel jack is not enough!  There is a voltage drop across the on-board regulator and diode.   You may only have 4V powering the Arduino chip.  (You can measure that on the 5V pin.)   The specs say 6V minimum, with a recommended minimum of 7V.  (Or with an external 5V regulator, you can power the Arduino at the 5V pin.)

Less than 5V powering the Arduino chip would cause the protection diodes to kick-in below 5V, clamping/limiting the analog input voltage (at slightly more than the chip-supply voltage).

Also, if you are using an LED 7-Segment display, I don't see any current limiting resistors on your schematic.   Without current limiting resistors, you could be pulling excess current, which could also pull-down the 5V supply on the Arduino-side of the regulator.    And, you can potentially damage your Arduino and/or the LED display.      14.5V into the barrel jack should not have fried you other Arduino, but the lack of current limiting could explain that too.

#### Robin2

#18
##### Apr 30, 2013, 10:32 am
Thanks. I've found that now.

This has nothing at all to do with the input impedance of the ADC when it is working.

...R

RAIN (Analogue Input Resistance) is, indeed, typically 100Mohm (section 28.8 ADC Characteristics)
Two or three hours spent thinking and reading documentation solves most programming problems.

#### pcguru000

#19
##### Apr 30, 2013, 01:52 pm
Well there is this whole thread:

http://www.svrider.com/forum/showthread.php?t=184545

You'l see "TeeRiver" did a different version of this (far prettier haha).

Pulled from http://www.svrider.com/forum/showpost.php?p=2967561&postcount=38

Quote
Inside the ECM is a 1k resistor pulled up to 5v. If the 1k internal ECM resistor is proper, then a 1k ohm external load will voltage divide 5v down to 2.5v. If you don't see 2.5v then start looking for a series resistor inserted somewhere on the Pink wire to the ECM.

You can also test the gear position sensor resistors individually by disconnecting the sensor, then measure resistance between sensor Pink, and ground Black/White. Should see:
1st: 374 ohms
2nd: 547
3rd: 1k
4th: 1.82k
5th: 4.6k
6th: 10k
N: open circuit.

FYI- there aren't any extra resistors inline here I've checked, just the 1k in the ECM and then the list above.

Perhaps there is a way to calculate this?

I'll give some readings:

 With Arduino Connected Without Arduino Connected 1 1.34 1.36 2 1.81 1.76 3 2.48 2.57 4 3.22 3.23 5 3.75 4.11 6 3.84 4.52 Neutral 3.89 4.97

All of this said- I reprogrammed the arudino to look at the "On and Plugged in" numbers- that is the closest I got - but it displays 3 for First gear, 4 for 2nd gear, and N (Neutral) for all the rest... as if it is STILL not seeing the same voltage my multimeter is reading.

My old laptop isn't working with a batter- im half inclined to setup the duino with a LCD and have it print voltage readings and then just program for those numbers....

As for transistors and resistors... I have a bunch of resistors- this whole kit http://www.amazon.com/Arduino-Sidekick-Basic-Kit-Version/dp/B007B14HM8/ref=sr_1_1?ie=UTF8&qid=1367321842&sr=8-1&keywords=arduino+sidekick

And a few other things laying around. Again- really wasn't anticipating a complicated project.

#### runaway_pancake

#20
##### Apr 30, 2013, 02:50 pm
Quote
...really wasn't anticipating a complicated project.

Well, see it through.

I can't see your schematic here at work (that picture site is blocked.)
What's the power source?
Is it connected through the barrel jack (re. Q. DVDDoug)?  Or is it connected to "+5" on the power header?

We can do some "impedance matching" (1 transistor, two resistors - easy), but I can't post that till later this afternoon.

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

#### pcguru000

#21
##### Apr 30, 2013, 08:53 pm
Ah Thank you for this- I did not see Dougs post above and probably would have missed it all together if you didn't mention it.

I am power via the barrel jack HOWEVER I have a 5v regulator inline PRIOR to it- because I thought I'd aim for safer lower voltages (vs the 14.5 the bike throws).

As he said though- this is too little and could be causing strange behavior- I am going to wire in a 9V regulator that I have and see if that fixes it... hopefully that won't run too hot (really don't like it getting hot, at 14.5 volts the 328 chip actually scorched my finger a bit which was surprising.)

I'll post back here once I've tried this again w/ a 9v regulator.

#### AWOL

#22
##### Apr 30, 2013, 09:01 pm
Quote
at 14.5 volts the 328 chip actually scorched my finger a bit which was surprising.)

Very surprising.
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### pcguru000

#23
##### Apr 30, 2013, 11:38 pm

Quote
at 14.5 volts the 328 chip actually scorched my finger a bit which was surprising.)

Very surprising.

Is that sarcasm or amiright that this shouldn't have been the case...

I had it plugged in for like 20 seconds and then when i touched it on removal it was really hot...

#### Grumpy_Mike

#24
##### May 01, 2013, 12:02 am

This has nothing at all to do with the input impedance of the ADC when it is working.

RAIN (Analogue Input Resistance) is, indeed, typically 100Mohm (section 28.8 ADC Characteristics)

Yes it does!
You are mixing up the input impedance of the A/D with the output impedance you need from your input source to drive it. While the input impedance of the A/D is very high, if you just connected it up to a signal with a high output impedance then the input sample and hold capacitor will take time to charge up once you switch channels. Therefore you will not be able to measure several channels in quick succession. However, the analogue input will still have a high impedance.

#### DVDdoug

#25
##### May 01, 2013, 12:30 am
Quote
I had it plugged in for like 20 seconds and then when i touched it on removal it was really hot...
How about those missing resistors to the LED display?

#### pcguru000

#26
##### May 01, 2013, 01:28 am

Quote
I had it plugged in for like 20 seconds and then when i touched it on removal it was really hot...
How about those missing resistors to the LED display?

I don't understand why these would be necessary (is it just a best practice?)- its common anode so its just one 3.3v power source and then grounded lines - when not grounded they throw 3.3 volts. Seemed straight forward enough- and in practice, is working perfectly.

Regardless of whether the 7 segment display is connected (and i mean ANY of it) the voltage readings I get when the arduino is plugged into the GPS are the same... so this has nothing to do with it.

#### runaway_pancake

#27
##### May 01, 2013, 03:10 am

Ah Thank you for this- I did not see Dougs post above and probably would have missed it all together if you didn't mention it.

I am power via the barrel jack HOWEVER I have a 5v regulator inline PRIOR to it- because I thought I'd aim for safer lower voltages (vs the 14.5 the bike throws).

As he said though- this is too little and could be causing strange behavior- I am going to wire in a 9V regulator that I have and see if that fixes it... hopefully that won't run too hot (really don't like it getting hot, at 14.5 volts the 328 chip actually scorched my finger a bit which was surprising.)

I'll post back here once I've tried this again w/ a 9v regulator.

Well, you could just put the output of the "regulated 5V" to the Arduino power header, but I wouldn't want you to biff it.
The 9V via the barrel jack is fine - I guess we'll wait.

Try not and go over 12V input.  Even so, the 328 wouldn't get "scorched my finger" hot unless there was something terribly wrong-o.

Quote
I don't understand why these would be necessary (is it just a best practice?)"

And, yes, resistors with the LEDs are necessary, because LEDs aren't light bulbs.
I don't understand why people want to fight this.
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

#### pcguru000

#28
##### May 01, 2013, 03:40 am
Radioshack didn't have a 9v regulator in stock (I thought I had one, turned out it was a 12v :/) so I am gonna place and order and wait a few days...

As for the resistors and LEDS- reading about it- I am still not sure how this applies/works with a common anode 7 segment display- should i place a resistor in the 3.3v line?

In testing everything works 100% so I am not exactly sure why I need to add more components... (really was aiming for super simple lol, i am a web developer, not an electrical engineer afterall lol)

The arduinos 3.3v is the exact voltage the 7 segment requires to power it so I figured my input voltage is already clean, i don't need to adjust it. I understand that voltage changes can greatly affect the current draw from the led- but again, there isn't any change, just 3.3v...

#### Grumpy_Mike

#29
##### May 01, 2013, 04:51 am
Look if you don't understand what you are doing why the *** are you arguing. You need a resistor in seriese with each LED segment otherwise you damage things because your not in control of the current. Any one who thinks you don't need some sort of current control with an LED is just an idiot.

Go Up