How to do a stable voltage divider circuit to test ADC

JBrookes

Member
An open question: I tried to make a voltage divider with an ebay pot, but it was too noisy for a stable reading. The ADC value bounced around.
Yes, I know, a cheap pot, and there will no doubt be the "Ford vs. Chevy" posts about the best pots.
But I'd rather it were NOT dependent on the pot, or if someone can tell me a way to quiet the pot down. One could put a low pass filter on the pot, but that seems a band-aid approach.
So is there a possibility of an led-ldr IC driven by a pot?
Or will shelling out more money solve this? (a better pot)
or a low pass filter on the pot?

There's gotta be a pony in here somewhere!
Thanks in advance for your thoughts.
 

Goeytex

Senior Member
Here's my thoughts on this. Some questions are rhetorical, some are not.
I will assume that you have a bypass capacitor across the Picaxe power pins.


1. How do you know the cause of the bouncing around is a noisy pot?
2. How much does it deviate? ADC or ADC10? Is it noisy in all positions ?
3. When the pot is full one way does is read zero or above zero? Does is reach a full 255 or 1023 the other way?
4. Does the ADC reading bounce around with 2 4K7 Resistors in a voltage divider?
5 Place two 4K7 resistors in series with one end connected to V+ and the other to ground, with the point between them to the ADC PIN ------ . Does it still bounce around? If yes, then there are other issues.
6. Is this on a breadboard or something else?
7. What is the power source? Batteries. regulator? wall-wart? Are the batteries fresh?
8. Is a bulk/filter capacitor fitted on the board?
9. Try placing jumper wires from the pot's outside leads direct to the Picaxe V+ and Ground Pins. Or as close as possible.
a. Does the behavior change?
10. What else is on the board that might be drawing significant current or causing voltage drooping?
11. Do you have a scope ?
 

JBrookes

Member
Replies interleaved below...


Here's my thoughts on this. Some questions are rhetorical, some are not.
I will assume that you have a bypass capacitor across the Picaxe power pins.
***Yes - 50 mfd or so on the dev board V+, but nothing physically at the chip V+ itself.


1. How do you know the cause of the bouncing around is a noisy pot?
***goes away when fixed resistors used
2. How much does it deviate? ADC or ADC10? Is it noisy in all positions ?
***Its been a while since I did this - yes, I remember all positions.
3. When the pot is full one way does is read zero or above zero? Does is reach a full 255 or 1023 the other way?
*** didn't check
4. Does the ADC reading bounce around with 2 4K7 Resistors in a voltage divider?
*** no, stable.
5 Place two 4K7 resistors in series with one end connected to V+ and the other to ground, with the point between them to the ADC PIN ------ . Does it still bounce around? If yes, then there are other issues.
***stable
6. Is this on a breadboard or something else?
***a Rev Ed breadboard
7. What is the power source? Batteries. regulator? wall-wart? Are the batteries fresh?
*** batteries - believe they are fresh.
8. Is a bulk/filter capacitor fitted on the board?
*** yes, electrolytic can.
9. Try placing jumper wires from the pot's outside leads direct to the Picaxe V+ and Ground Pins. Or as close as possible.
a. Does the behavior change?
10. What else is on the board that might be drawing significant current or causing voltage drooping?
11. Do you have a scope ?
*** yes. The scope operator semi-skilled. :)
 

JimPerry

Senior Member
Old trick is to use a can of air to blow dust from inside pot - might help (can use air freshener at a push) :confused:
 

Dippy

Moderator
Pots are still used on many pieces of expensive laboratory equipment; good ones are not cheap and very good ones can cost quite a few quid.
We are in the area of 'you get what you pay for'.
Are you talking about a trimmer or a panel-mounted type pot with a shaft?

Assumptions:-
1. You have a nice smooth and stable supply and the PICAXE is decoupled.
2. Your connections are good and as short as possible.
3. You have double-checked with a 'scope that no extraneous noise is getting to PICAXE (supply, ground or ADC pin).
4. You have checked with 'scope that the pot is the real culprit.

A good quality pot will give good results. Multifinger wiper on a cermet or conductive plastic should give reasonable results at a low-ish cost.
And multi-turn will give better resolution but none will be as good as fixed resistors.
Get a proper one from a proper manufacturer not a penny-special from an unknown shed. "Buy cheap, buy twice".
There is nothing wrong with a little bit of RC filtering as it can really help during the twiddling.

But all this assumes the rest of your circuit is good, so check it first.


Edit: if you get a good quality sealed/hermitically sealed pot you won't need to blow dust from it :)
 

Goeytex

Senior Member
Does sound like a "noisy" pot. If it is, there are several things you can do.

1. Chase you tail and spend extra time and money with filtering (software or hardware) trying to eliminate the noise.
2. Buy a good pot. I use generally use Bournes pots and have never had a "noisy pot".

I have had ADC noise issues, but never directly caused by a pot. I have a bucket full of Bournes 10K 1 turn Pots and Murata 10K 22 turn pots . I'd be glad to send you a few. Send me a PM with your address and I'll put them in the mail.

Goey
 

BeanieBots

Moderator
What value is the POT?
If it's greater than 20k, then unstable values are to be expected. (10k is about the ideal value)
If it is simply an unstable pot, then try spraying the track with aftershave.
Carbon tracked pots (the cheapest type) can dry out. The water + alcohol in aftershave can rejuvenate them.

As Dippy states, a decent quality POT can cost several quid. About £30 for a top quality servo POT!
 

rossko57

Senior Member
An ancient "noiseless pot" technique; rheostat controlled filament lamp illuminating LDR (BBC circa 1955?). Seems easier to add the low pass filter to a conventional cheapo pot1 here.
 
When being adjusted, a potentiometer with carbon tracks can be very noisy if DC current flows through the track, such as in your application. As noted by other members of this forum, cermet, plastic track or wire-wound potentiometers are much better and also have a longer life.

RC filtering will help but is a band aid rather than a solution. One of my current projects uses a 10 turn wire-wound potentiometer, digitised to 10 bits by a 28X2 and that works just fine without any filtering.

Ensure that your supply to the PICAXE is stable if you are using the ADC facilities - these days I devote a 78L05 regulator just to the PICAXE and other circuitry is run from another regulator. This is important if you use an OLED display, as was discussed on this forum a few days ago.

Richard
 
Top