Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help. Wiring a Potentiometer.

Status
Not open for further replies.
Hello. This is my first Post.
Although I have experience programming, I have almost zero experience with circuits and electronics so any help will be greatly appreciated. Please bear in mind that I am not sure of even the basics :eek:

Anyway, I have been asked to build a new project that has three components: A potentiometer, A microcontroller, and an actuator. I would like to concentrate first on the first: The potentiometer

I know the theory behind so I would really like to ask about how to wire the potentiometer

first I thought something very simple:

1)
Code:
 Battery(5v)---------3[ Pot   ]1---------Ground
                            2|__________________________ to the A/D

but then I read somewhere that I will need a "capacitor" (I have no idea what these are for)
so

2)
Code:
Battery(5v)------------------------3[ Pot   ]1---------Ground
                       |               2|__________________________ to the A/D
                       |
                       |
                       |__________________| Capacitor(0.1µF)|-------------Ground

And then I read the docs on the pot that says:
the contact resistance(R1) in this sensor is set to a high level because its output terminal is designed to directly connect to the A/D port of the microprocessor. Consequently set the connection impedance (R2) to 1Mohm or more to eliminate the influence of the contact resistance(R1)

and they draw the following

3)
Code:
Battery(5v)----------------3[ Pot(R1)   ]1---------Ground
                                   2|
                                    |_____[R2]-----Ground
                                    |                         
                                    |
                                    |_____|capacitor|----Ground
                                    |
                                    |__________________________ to the A/D
Now they dont even put the values of this R2 and capacitor....I am very confused.


Can someone teach or point me please to the simplest way to attach a potentiometer to a battery and use the connection 2 as an input to the A/D of the microcontroller.

Any help will be greatly appreciated.

Thanks in advance

Kansai
 
Last edited:
Hi Kansai,

when connecting a potentiometer you certainly want the full range of 0 to 5V for the input. Use a carbon film pot of 10K and connect it as shown in the attachment.

ATMEL and MICROCHIP MCUs perform A/D conversion at 10 Bit resolution. So the lowest A/D converted value corresponds to 4.882mV (5,000/1,024)

Use a cap big enough to allow a steady signal for conversion. 10 - 100nF should suffice.

The example shows an ATmega8 with internal Vref used. Connect your desired Vref if it differs from the internal. AVCC should be decoupled and filtered with 10µH inductance and a 100nF cap.

I hope that helps.

Regards

Boncuk
 

Attachments

  • A-D.gif
    A-D.gif
    18 KB · Views: 292
Last edited:
Hello Boncuk

And thank you for the prompt reply.

Now I have a few questions:
I saw your wiring (can you believe I am intimidated by even that...!) and after analyzing it I got that it is equivalent to the one I am attaching here. am I correct??circuit1.JPG

does this means than I will need a capacitor of 10nanoFaradays before connecting to the A/D? (no additional resistors??)

and my second question, in the circuit it is indicated that the wiper is number 3 and the 5v goes to number 2. I thought 2 is the wiper or does that varies with the potentiometer I got?? (ALPS RDC506)

Thanks always for the help
----------

Also I didnt get so much about the last part. I am planning to use a PIC 18F2550 mic for this. Any comment about that will be appreciated as well.

Regards

Kansai
 
Last edited:
Hello Boncuk

And thank you for the prompt reply.

Now I have a few questions:
I saw your wiring (can you believe I am intimidated by even that...!) and after analyzing it I got that it is equivalent to the one I am attaching here. am I correct??View attachment 37812

does this means than I will need a capacitor of 10nanoFaradays before connecting to the A/D? (no additional resistors??)

and my second question, in the circuit it is indicated that the wiper is number 3 and the 5v goes to number 2. I thought 2 is the wiper or does that varies with the potentiometer I got?? (ALPS RDC506)

Thanks always for the help
----------

Also I didnt get so much about the last part. I am planning to use a PIC 18F2550 mic for this. Any comment about that will be appreciated as well.

Regards

Kansai

Don't be bothered by number 2 or 3.

Sometimes you use A B C, as B being the wiper. (Alphabetical order)

Sometimes you use A C B, as C being the wiper. The reason for this is that the non-wiping terminals are connected internally through a carbon film (or resistive wire) and the Wiper terminal slides on this film. As A is adjacent to B, some think it is more convenient to let C be the wiping terminal.

The same thing happens when you name your terminals with numbers 123 or 132. They are the same.

100-potentiometer.jpg

The external terminals are connected through the resistive element.

Seeing the RDC506 datasheet (PDF pg. 3), proofs that it doesn't stay out of the rule. The middle terminal is the wiper terminal. https://www.alps.se/products/WebObjects/catalog.woa/E/PDF/Sensor/Position/RDC40/RDC40.PDF

Yes you just need the 10nF capacitor, to filter some transients. The ADC input is high impedance so you don't need any additional resistors.
 
Hello Boncuk

And thank you for the prompt reply.

Now I have a few questions:
I saw your wiring (can you believe I am intimidated by even that...!) and after analyzing it I got that it is equivalent to the one I am attaching here. am I correct??

does this means than I will need a capacitor of 10nanoFaradays before connecting to the A/D? (no additional resistors??)

and my second question, in the circuit it is indicated that the wiper is number 3 and the 5v goes to number 2. I thought 2 is the wiper or does that varies with the potentiometer I got?? (ALPS RDC506)

Thanks always for the help
----------

Also I didnt get so much about the last part. I am planning to use a PIC 18F2550 mic for this. Any comment about that will be appreciated as well.

Regards

Kansai

Hi Kansai,

numbering pins/pads of a pot desn't make any difference in how it should be connected to act as a pot and in the desired direction.

I prefer to number the entire resistor pins1 and 2 and the wiper pin3. The logical device (package) must be numbered the same way to make connections in a schematic free of error regarding increase or decrease of the value at the wiper.

Having pin1 connected to ground and pin2 connected to a positive voltage source the voltage at the wiper (pin3) will increase by turning the pot clockwise (like used for volume control on the stereo).

This will become clear looking at the package drawing of the pot. Pin1 connected to ground will allow no positive voltage at pin3 (wiper) if the knob is turned fully left. (meaning pin3 (wiper) is shorted to ground. Turning the knob clockwise in the direction of pin2 (connected to VCC) the wiper voltage increases.

The two samples you posted are completely different. The left hand partial circuit shows an analog input with a pot and the right one shows the \RESET circuit. For normal operation of both ATMEL and MICROCHIP MCUs the \RESET must be high, while for in-system-programming (AVR-ISP for ATMEL and ICSP for MICROCHIP) the \RESET pin must be pulled low.

For a full span (0 to 5V) A/D conversion no further resistor is necessary. The value of the cap depends on the MCU clock frequency and the desired refresh rate of the A/D channel, but 10 to 100nF should suffice in any case, using 100nF for slow clocking.

The cap at the \RESET pin is not a MUST, but recommendable to avoid unintended resets of the MCU due to stray signals.

One thing applies to both - PCs and MCUs: Garbage in --> Garbage out (Why produce garbage when designing the circuit?)

Regards

Boncuk
 

Attachments

  • POT.gif
    POT.gif
    7.8 KB · Views: 213
Status
Not open for further replies.

Latest threads

Back
Top