Pages: [1]   Go Down
Author Topic: Variable resistor (pot) - Even results?  (Read 634 times)
0 Members and 1 Guest are viewing this topic.
Toronto, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?   
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I see three options

1) Use a lookup table as RC suggests
2) Go out and buy a linear pot
3) Describe logarithmic principles to your lad, this has the added beneficial side affect of giving him a head start in maths smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Toronto, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: