Go Down

Topic: Replacing integrated pots with Arduino control? (Read 155 times) previous topic - next topic

majhi

Hello all.  I recently bought this amp for a project that I'm working on (http://www.amazon.com/gp/product/B007TUSXEY) that's based on a Mega 2560.  As you can see, it has physical pots on the face.  However I will need to mount this somewhere that won't be easily accessible.  I have a 4.3" touchscreen TFT that I use in the same project to control other things.

My question is this: is it possible to hack apart the amp and remove the pots, then hook up the controls to the Mega and adjust levels via PWM?  For example, I would like to put volume controls on the TFT, thus I would need to remove the volume pot off the amp, then hook up the Mega to where that pot was.

It seems like that's possible as I would just be using a PWM pin to emulate the pot.  I don't know if I'd need a relay or not, but I'm assuming yes since the amp runs off 12v and the Arduino can't carry that by itself.  I already have a 12v relay in the project that just so happens to have an empty spot, so if I need one, I can hook it up there.

I apologize in advance for not having a schematic drawn up that I can show you, I just woke up and haven't gotten to that yet.  Thank you in advance.

Robin2

Potentiometers and PWM are not interchangeable. You might use a pot to control something that produces a PWM signal - say to make a motor go fast or slow. But a pot produces a variable voltage signal as part of the circuit it is built into. That circuit will not be designed to receive a PWM signal.

Yoy may be able to replace the pots on your device with digital potentiometers that can be controlled by the Arduino.

...R

DVDdoug

#2
Aug 09, 2015, 05:58 pm Last Edit: Aug 09, 2015, 06:03 pm by DVDdoug
You can get digital pots.  Here is one example.   (You'd need two, or a dual digital pot for stereo.)

I wouldn't bother modifying the amp.   Just put the digital pot in series with the input and turn the volume on the amp up to maximum (or as loud as you want to go).

I believe there are 3 types of digital pots  - Parallel control, SPI control (serial), and step-up and step-down inputs.    The step up & down type seems "safest" for audio, since you are less likely to accidentally send a "full on" command.

majhi

To make sure I understand correctly, pots have a "smoother" adjustment than a PWM which has "steps," is that correct?  Because I had another project that controlled 12v LED strips (via relay) with an analog pot, but I eventually removed the pot and replaced it with "steps" using PWM to control the dimming.

Here's a snippet of my PWM dimming:
Code: [Select]
     case G1_LIGHTS_25:
      easyvr.playSound(6, EasyVR::VOL_HALF);
      if (idx == 3){      // received command is "lights 25"
        analogWrite(6, 255*.25);     // sets LED strips to 25% brightness
      }
      group = GROUP_0;
      break;
    case G1_LIGHTS_50:
      easyvr.playSound(6, EasyVR::VOL_HALF);
      if (idx == 4){      // lights 50
        analogWrite(6, 255*.5);
      }
      group = GROUP_0;
      break;


That's using an EasyVR shield (voice recognition), hence why some of the code is a bit "non-standard."  So am I to understand I can't do the same thing to "dim" the volume?

majhi

I wouldn't bother modifying the amp.   Just put the digital pot in series with the input and turn the volume on the amp up to maximum (or as loud as you want to go).
Oh good call!  I didn't even think of that.  I just need to make sure it won't dim the LEDs in the circuit, too.  Here's a description of what I have right now.

MP3 player hooked up to a stereo splitter/Y-cable.  One end goes to the speakers, the other goes to a TIP31.  The LEDs beat to the music because of the transistor.

This will definitely be something I need to look into.  Thank you!

Robin2

To make sure I understand correctly, pots have a "smoother" adjustment than a PWM which has "steps," is that correct?
NO.

Pots are entirely different from PWM.

It is not a question of smoothness. A pot is a passive device - a variable resistance.
A PWM output is an active output.

They are NOT alternatives.

...R

Hutkikz

To make sure I understand correctly, pots have a "smoother" adjustment than a PWM which has "steps," is that correct
As Robin said that won't work .

A pot set in the middle of a 0-5v range puts out a relatively steady 2.5v

Pwm set in the middle of a 0-5v range puts out a square wave signal that is 5v 50% of the time and 0v the other 50%.
 
 This happens fast enough that an Led or motor will average that out but a arduino input will see it as alternating high and low's so that a reading on that pin at any given moment will be high or low


Wawa

Digital pots have steps. The question is how many.
Our hearing can just distinguish 1db steps.
Hearing range is just over 100db, so you can't hear volume steps if the pot has 128steps (7-bit) or more.
Even 64 steps are barely audible.
Look at how many steps the remote control of your TV, or the volume of a laptop use. 32?
Choose a LOG pot for volume. A LIN pot will not adjust smoothly.
Leo..

dave-in-nj

you can leave your amp alone, add a servo on each pot and control the servo to some position.
fast, easy and painless.


majhi

you can leave your amp alone, add a servo on each pot and control the servo to some position.
fast, easy and painless.

Funny you should mention that because I was just digging through my salvage box and I found an old motor.  That might be the way to go, all things considered.

Robin2

#10
Aug 10, 2015, 08:30 am Last Edit: Aug 10, 2015, 08:31 am by Robin2
you can leave your amp alone, add a servo on each pot and control the servo to some position.
fast, easy and painless.
I had forgotten that we had a Sony 3 in 1 music centre years ago. When you changed the volume with the remote it operated a small DC motor that rotated the volume control. I thought it looked very cool.

...R

Go Up