Go Down

### Topic: Variable resistor (pot) - Even results? (Read 1 time)previous topic - next topic

#### sparklini

##### Mar 18, 2011, 12:33 am
I'm building a toy for my little boy with a bunch a blinky lights, buttons and plugs.
I'd like to put a Pot on so that it will make a clicking sound when he turns it or change the flashing rate of an LED.

The 500k variable resistor is connected fine and I can Serial.print it's values correctly. The values are logarithmic (i think). Can anyone suggest a way to convert the values so that when the knob is turned the clicking or flashing speed has more of a x=y ratio?

#### RuggedCircuits

#1
##### Mar 18, 2011, 12:57 am
Sounds like you have a pot with an "audio taper". A simple way to correct (without fancy math) is to characterize the pot. Set it to the 0-degree setting (all the way counterclockwise), take a reading, store it in a spreadsheet. Turn the pot to 10 degrees, take a reading, store it in the spreadsheet. Continue all the way around.

Now, turn this spreadsheet around. Store it in an array in your code, then whenever you get a reading, look it up in the table (you'll have to look between two nearest values) and the index into the table is the linearized return value.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

#2
##### Mar 18, 2011, 05:22 am
I see three options

1) Use a lookup table as RC suggests
2) Go out and buy a linear pot

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

#### sparklini

#3
##### Mar 19, 2011, 12:07 am
Ha thanks guys. Right now we are working on the Principals of Electrical Theory. I'll going to give the 'array' idea a try. Thanks.

Spark

Go Up