Author Topic: Quick question about potentiometers  (Read 1329 times)

0 Members and 1 Guest are viewing this topic.

Offline codeblueTopic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Quick question about potentiometers
« on: February 15, 2011, 07:07:54 PM »
I have a potentiometer running from my arduinos power to ground and on the middle pin have a wire coming out to read the value.. should I put i resistor in series with the five volts coming from the arduino.. I don't think i need it but im trying to avoid frying something..
Thanks ;)

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Quick question about potentiometers
« Reply #1 on: February 15, 2011, 08:54:46 PM »
I'll assume the power from your arduino is 5V. What is the resistance in Ohms of the POT?
If it is fairly low then you may want to add a series resistor to reduce the current through the pot.

What is the Wattage rating of the Pot? How big is it physically?

Do you know Ohm's Law and the power equation? Use these to determine if connecting the pot to 5V will hurt anything.

Do you want to connect the pot's wiper (middle pin) to the ADC input of the arduino?

Offline codeblueTopic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Quick question about potentiometers
« Reply #2 on: February 15, 2011, 10:26:19 PM »
Yeah.. I know ohms law.. I = E/R. the question is if I have the current running through the pot and have the wiper as an analog input on my arduino will i need a resistor... I dont think I do, but I'm scared im going to fry something ;D

Offline BEAMer

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: Quick question about potentiometers
« Reply #3 on: February 16, 2011, 04:20:12 AM »
Hi,

This is a nice problem to investigate. First of all, the ADC input of any controller will have a sample and hold circuitry consisting of a resistor and a capacitor. You can refer to the datasheet of the controller for more details. So you wont fry anything... But adding a series resistor will definitely affect your ADC's acquisition time (Time taken for the capacitor to charge) and unless you calculate this time and allow this in the code, your readings might be erroneous. Just give it a try by putting different series resistor values and see how much the ADC values change.

BEAMer

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Quick question about potentiometers
« Reply #4 on: February 16, 2011, 10:16:54 AM »
BEAMer's answer is good.

As to the ADC input or really any input pin on your processor:
 If the voltage applied is between Vdd and VSS (power + and ground) it will not hurt the processor as the voltage is "in spec". Just ensure that the processor pin is an input and not an output.

Offline codeblueTopic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Quick question about potentiometers
« Reply #5 on: February 16, 2011, 08:10:27 PM »
Thanks guys.. I'm still new to the whole microcontroller aspect of things eventhough I'm almost through my third year of electronics

Offline BEAMer

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: Quick question about potentiometers
« Reply #6 on: February 16, 2011, 10:38:31 PM »
Thanks Waltr... I think, even if an MCU pin is configured as output and an input is given to that pin, only that particular pin will fry. Rest of the MCU will function fine.

BEAMer

Offline BEAMer

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: Quick question about potentiometers
« Reply #7 on: February 16, 2011, 10:46:46 PM »
And Codeblue,

My advice is that anyone who works with MCUs must not neglect the datasheet. I would say you must walk with the datasheet, sleep with the datasheet and eat with the datasheet :).

Because, it contains wealth of knowledge about the controller and will also give you a very good understanding. Device manufacturers spend tons of money for preparing these datasheets.

BEAMer

 


data_list