# Hacking a Pot

Hi All, it's time again for Calculon's noob question of the day!!!

For today's question, I'm hacking a sound recorder that has a "tweak" feautre on it. This tweak is a potentiometer that determines the pitch of the playback. What I would like to do is replace the physical turn-the-knob with PIC outputs, so my robot can do the tweeking itself. Is that possible?

## Comment viewing options

if it was just a simple tone generator, you could replace the pot with a couple buttons, which control how fast you output PWM (square wave) to the speaker.

- It DOES change the pitch while it's playing. It actually controls the SPEED, and (thus the pitch).

- It's not a cassette player, it's a chip.

- It looks like this:

(The user end is on the other side)

So if I understand right, a pot varies the resitance? Would that mean that I'm varying the amount of current being fed to the chip, and that's what speeds it up or down?

Correct, POT = variable resistor

variable resistor means you can vary voltage

Voltage, Current and Resistance are like the Holy Trinity of Electronics - they are all inter-related and always affect one another, Amen

If your sound do'hicky is solid state (ie. no moving parts completely electronic) then some part of it relies on the varying voltage to determine speed.  I'm gonna guess its probably some tank circuit , which in turn is aplified to a speaker.   Or if its more sophisticated its a clock which (still based on a tank circuit) which outputs recorded data to a simple digital to analogue converter.

So at this point I imagine you saying .. geeeeze, I just want to have my bot change the pitch ... what is this guy on about.

Alright, to the meat then.

Git Her Done Instructions
Measure the voltage coming from the pot as you turn the knob.  One side will change the other will not.  Find out what the Max and Min voltage is.  See if your PIC does an analogue output, what are its Min and Max.  If they match your basically done.  Connect them, although you might want to start by putting a resistor between for safety purposes.

If your PIC has the wrong values, you can use resistors or transistors to amplify or limit the range to what your sound device expects.

If your PIC does not have analogue only digital outputs then you can make your simple DAC .. I did, its not hard.

Good luck, and sorry for the brain dump :P

No that's all awesome info. I'll have to find out about my PIC's analog output ability. I don't think it has any ...

If this is an old cassete player then the pitch adjust probaly varies the speed of the motor in which case you turn the pitch to the highest setting, put a transistor in series with the motor and drive it with an analog or even PWM output.

If the pitch is electronically controlled (base/treble) then the pot is part of a filter circuit, this would be much harder to replace and may distort the sound.

Can  you change the pitch while it is playing? That would make for some interesting sounds!
servos turn knobs, kinda
yeah, I thought of using a servo, but if i can cut down on the volume and weight of a servo by doing it electronically ....
A Pot basicially just changes resistance as it turns. Isn't it possible to mimic it using the PIC and have it send out a stronger or weaker signal? I wonder if the servo command would mimic this to some extent? I would need to play around, but I'm sure it can be done.

*rumbles around in a deep drawer with leftover links*

got it

And that's why I let someone else answer this one! ;-)

8ik