PAM8403 3W Audio Amp Volume view/control using esphome

Hello. I am working on a project where I want to disconnect the speaker wire from a Halloween prop and connect it to a 3w amp and then output to a better speaker. This is the project I am undertaking: https://www.youtube.com/watch?v=1ozdvts2L2E and it looks to work well.

I found this PAM8403 amp: Amazon.com: HiLetgo Mini 3W+3W DC 5V Audio Amplifier Handy Digital Power Amp Module Board Dual-channel PAM8403 Stereo Amplifiers with Potentiometer for DIY portable : Electronics

I am trying to find a way to connect it to an esp32 so I can view and change the volume in esphome. I have been searching for the answer but did not find an answer/example, so I am hoping somebody could help.

Would it be possible to do this using a PAM8403 or is there a better way to do this?

Thanks!

You could replace the pot with a digital pot.

Or you could put some sort of motor on the pot.

Thanks! I am not committed to using the PAM8403, I only saw it is what they used in the video. I saw your comment about the digital pot, so that got me thinking to search for a 3w digital amp and I found PAM8803. It seems similar but it has volume up and down connections already available. Maybe I will try that one.

I can then add a rotary encoder to the esp32 in the future if I want knob control rather than through home assistant or the onboard buttons.

1 Like