Mini amplifier – 5v powered stereo modules

PAM8403 stereo amplifier board

PAM8403 stereo amplifier board

I had been looking to create a little monitoring amplifier for the Raspberry Pi for a while, as well as creating an amplifier which our phones could plug into for listening to music. After trawling that well-known internet auction site, I came across these little boards for an absolute bargain price of 99 pence each with free postage and packaging.

The power supply requirements are around 2.5v to 5.5v, which means it is suitable for powering from a USB power supply.

The module is described as a “PAM8403 5V DC Audio Amplifier 2 Channel 3W*2 Volume Control USB Power New Board”. There are a bunch of connections on one side, and a volume control/on-off switch on the other.

The connections (0.1″ spacing) are:

  • Left and right speaker connections (8Ω)
  • Power (2.5v to 5.5v)
  • Stereo audio input (Left/Right/Ground)

I hunted around the parts bins and soon came across an old usb cable and a 3.5mm stereo audio cable. These took a while to strip and tin as the usb cable had really fine wires. I needed a voltmeter to determine which of the connections would give me 5v. To make things more awkward, the colour codes used didn’t match with any of my internet research.

The internal layout. The amplifier module sits between the two speakers.

The internal layout. The amplifier module sits between the two speakers.

On to the CAM router to produce a case. The first one would be for my wife while she goes into labour, so I opted for something a little more interesting than a black box.

The template was generated from some earlier work (It’s the same size as the servo robot) but equally it could be created from the Automatic Case Designer

I use a lot of foamed PVC sheet with the router as its easy on the cutters, gives a little and makes a case that looks professional. The tabs fit the slots perfectly if a 3mm cutter is used. The case tends to hold itself together purely by friction although a glue gun can be used to permanently join the sides together.

The amplifier module comes without a knob, but searching around I found a 6mm splined shaft soft-touch knob which does the job perfectly.

Finished amplifier in its case

The finished product!

Here we have the finished case. The speaker grilles are drilled using the router into a heart pattern. The cables are USB power and a stereo jack.

One advantage of USB power was that the amplifier can also be used with a USB backup battery to make a portable amplifier. Alternatively, I found that the USB sockets on the Raspberry Pi can also be used.

Eventually, I’ll make a similar circuit for the Dalek so that it’s self-contained.

In conclusion, this little amplifier board is a perfect little problem solver. It might be possible to drive it direct from the 5v supply on the GPIO connector, although a pretty beefy power supply might be needed if the full 3w x 2 is required, given that this equates to over 1Amp. I suspect that the Raspberry Pi might crash if the amplifier is driven at high volumes with a particularly weak power supply.

Another alternative might be to create an internet/network media player. Couple one of these to a Raspberry Pi running Kodi, stick in a USB WiFi dongle to pick up network attached storage, and use a mobile phone app such as Yatse (Android) as a remote control.


Automatic Case Designer


These instructions show how to use the case creator spreadsheet.

One of the big challenges of any electronic product is to make a neat and tidy case of the correct dimensions. It’s perfectly possible to buy some lovely ready-made cases and sit there with a drill, but I quite enjoy bringing everything together so that it all matches.

I originally wrote a case designer sketch in Pro/Desktop which used formulae to change the  dimensions of the tabs and sides automatically, but an easier method seemed to be to reduce the whole thing to a bunch of coordinates in a spreadsheet. These are then copied and pasted into Notepad (or similar) and saved out as a .dxf file ready for importing into your CAD software. We use Techsoft 2d Design Tools.

A quick skim through a .dxf format file showed that it might be possible to take these coordinates to make a slot-together tabbed case. By importing PCB layouts into the final CAD package it was even possible to work out the position of connector holes.

Slot-together-case (1)

Here’s an example of a completed case housing the servo controller for the animatronic head.

The process is a little involved, in that it takes me about 1 minute (slight sarcasm) to do the whole process from beginning to end. A little practise and the possibilities are endless. Just one thing to bear in mind – height and width are the size looking at the front panel. Depth is the distance behind the front panel. Print out the result on paper if you’re unsure.  You may also wish to add to the outline to make the front panel a bit tougher if the case isn’t going to be stuck together.

The final result needs duplicating and then setting up for whatever CAM machine you have. I use a school Denford Microrouter with a 3mm cutter (which matches 3mm Foamex nicely), but it’s probably possible to send these to laser cutting companies.

If you find this useful, please pay it forward. I’ve had a lot of help from others. I’d like to rewrite this one day in Python, perhaps with a GUI. If you beat me to it, can I have a copy?

Spreadsheet image

Use this spreadsheet to automatically create the text for a dxf file.


The spreadsheet automatically creates the lines for these three parts. Duplicate to create a complete case.

Included files:

Case designer spreadsheet & Case designer instructions