Potentiometer causing voltage variation throughout circuit

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm pretty new to all this and I'm trying to get a simple analog to digital test circuit hooked up.

I have a +5V voltage regulator with a couple capacitors hooked up to supply power to at atmega16, and that all works great. However, when I introduce a variable resistor to vary the voltage being applied to one of the analog to digital pins of the chip, I see small changes in voltage throughout my circuit.

Without the variable resistor I see 4.95V being supplied as VCC. When I add the variable resistor I see VCC vary between 4.90V and 4.95V between the two extremes.

Is this expected? Will this cause problems if I added more variable resistors to some of the other ADC pins? How can I use a potentiometer to vary voltage to a pin, without changing the voltage in my entire circuit?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Schematic?

How close are the capacitors to the regulator, and are they as specified in the data sheet?

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have to put the juice and ground on the end terminals of the pot... USUALLY the outside two terminals. The wiper is in the center. If you accidentally put the juice on the wiper, then as you move the wiper closer to ground, the R starts getting Real Low and the Amps starts getting Real Hi and under certain conditions this will trigger an olfactory sensation not unlike burning phenolic plastic.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, that's how it's setup. VCC and ground on outside pins, the inside pin is hooked to an ADC pin on the atmega16.

Currently the circuit is made on a solderless breadboard with the capacitors and regulator in close proximity to eachother. I got the capacitor values from, "robot builders bonanza". I don't have all the info on me at the moment, but I'll try to put together a schematic tonight with the values.

I thought that the capacitors were mostly there to clean up the power supplied to the circuit. What I'm seeing isn't noise, the voltage supplied to whole circuit changes, but it stays steady at 4.90 at one extreme or 4.95 at the other extreme. I'm not seeing it dip to 4.90 when I adjust it and then it jump back up and even out on its own.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The regulator might be oscillating, I wouldn't put one on a solderless breadboard. I wouldn't use a solderless breadboard for anything, come to that.

Leon Heller G1HSM

Last Edited: Tue. Jun 29, 2010 - 07:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the potentiometer value? What is the wiper arm hooked to?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Breadboard should be fine.

As Jim asked, what is the value of the pot?

What regulator are you using?

Do you also have 0.1 uF by-pass caps across the uC's V+ and Gnd pins?

You are seeing a 1% variation in output as your load varies. What does the data sheet for the voltage regulator say the output is as a function of the load current being drawn?

What is the accuracy of your voltmeter?

As Bob implied, and Jim is seeking: Make sure you do NOT connect the wiper to one end of the pot for this particular purpose.

I'm not sure you have much to worry about here.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might try connecting the two ends of the pot right at the regulator. Also have you set the software up so the ADC input is an ADC input? I do not know the atmega16 but if the pin can be used for other functions you would want to be sure it is an ADC input.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the circuit I'm using to supply power:

Here is the rest of the circuit:

The potentiometer value is 100 ohms, and is properly hooked up to +5V and GND with the wiper attached to PA0.

I have setup all pins on PORTA for input and initialized PA0 for ADC.

The final circuit that I will be building will have 4 potentiometers used as voltage dividers and read using ADC, but when I add a second pots the voltage fluctuates throughout the circuit even more. I'm worried that by the time 4 are added that my circuit won't work as the pots change.

What is wrong with breadboarding? How do you prototype and experiment on circuits?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Solderless breadboards are unreliable and awkward to use. I make a PCB at home if I need a quick prototype, it only takes me 30 minutes or so.

100R is rather low for a pot in that sort of application.

You should have a 100n capacitor directly across the regulator output and ground leads. It can oscillate otherwise.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll agree and disagee with Leon, as follows:

Breadboards are fine, especially when just throwing together a quick test circuit.

100 ohms is too low for what you are doing. Switch to a 1K (at least), or a 10K pot. Also put a 0.1 uf cap from the wiper to ground. 100 ohms is drawing 50 mA from your power supply. What is the rating for your pot?

Also, are you using the 7805 or the 78L05? The pin outs are different. Since you measured about 5 V I suspect you are using the 7805 and have it correctly connected.

As a test you could remove the 100 ohm pot from the circuit and string a few 1K ohm resistors in series, between +5 and ground, and then just manually connect the ADC input wire at various points along the chain. See if your readings match the calculated voltage based upon the divider.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DO NOT connect AREF to anything but a 100nF cap to ground.
DO USE 100nf caps (2 off) at the input and output pins of the regulator and as close as possoble to it, even soldering them to the regulator leads.

edit of of course use 100nF caps near the chip on VCC and AVCC also.

The 1M pullup resistor on the reset line is not doing much as the chip has an internal pull up of about 20-50K. The 1uF cap across the reset line is likely to disturb ISP, use 100nF.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am willing to bet that the "center pin" of the pot is NOT the wiper. Simple test:

Start with the pot fully clockwise, With the ohm-meter section of a multi-meter, note the resistance FROM the CENTER terminal TO each of the other two terminals. Turn the pot a ways, and, again, note the values. One should go up and the other should go down. Rotate further and check again; the one that went down in the previous step should be even smaller and the one that went up should be even larger.

If this does not happen, then your pot is not as you think it is. To determine which pin is which, turn the pot all the way to one extreme. Measure the three resistance values between each combination of pins. One pair should read near zero and the other two should read the same high value. ONE of the two pins with the low value is the wiper. Rotate the pot to the other extreme, and do the three-way resistance check again. One of the three values will be very small; one of the two pins with the small reading will be the wiper. The one pin shared between the two low-resistance measurement pairs is the wiper.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But then, if he wired the potentiometer wrongly, it would quickly turn into a HOTentiometer when being fully turned towards one end...

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking at the circuit you've posted, I see you have the AREF pin (pin 32) connected directly to VDD. this is supposed to be a 2.56v reference voltage brought out to a pin for filtering only. Either leave this pin open, or connect a 100nF capacitor to ground. I suspect this is a big part of your problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But you select where the ref v comes from in sw. Power on default is 00 which is avcc, so he's ok unless he changes the ref source inadvertently...

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for all the help. It turned out that the only issue was a potentiometer with too little resistance as suggested by DocJC. Switching it out for something larger fixed the issue.

Can you guys clear up what aref should be connected to? I'm not seeing any issues with the current setup and it works with ADC and uart, but I guess that doesn't mean that it's hooked up correctly necessarily. As bobgardner suggested I'm not changing the power on default ref source.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The AREF pin follows whatever voltage reference is selected by your code. So if say you select a 1.1V or 2.56V internal reference and the pin is tied to VCC what do you think will happen?

Th data sheet says you should only connect a cap to ground there (100nF usually).

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly