Introduction: Mr. Speaker - 3D Printed DSP Portable Speaker
I got a 3D printer last year and so I wanted to create something that exemplifies the unique freedom of design that 3D printing allows. I have built a number of speakers over the years so I started playing with shapes and this is what popped out.
Say hello to Mr. Speaker! He is:
- 3D Printed
- Battery powered
- DSP (flat response 45Hz - 20,000Hz and linear phase)
Traditionally speakers need filter electronics to separate the signal for each driver and tune the sound. This can be a rather clumsy process involving large and expensive parts which nonetheless force the designer to choose many significant compromises.
Mr. Speaker makes use of a modern digital signal processor (DSP) the Analog Devices ADAU1401 to bypass many of the traditional design compromises. Only some years ago such processing was the remit of large professional speaker installations with a rack of dedicated equipment, but is now becoming increasingly accessible. This technology allows a designer unprecedented control over behaviour of the audio system for a final result that is as near perfect as possible - from deep bass to high treble.
I'm separating this instructable into two types of step; Build and Design.
- Steps labelled (Build) are all you need to follow to make your own speaker.
- The (Design) steps cover the process I went through to create Mr. Speaker. These steps are not necessary to build Mr. Speaker but I hope they will function as an educational tool to help learn about the fascinating subject of audio design.
Having uploaded this a few people have asked 'How does it sound?' Honestly amazing! I didn't expect a 3D printed enclosure to be able to sound this good. You probably can't tell from a video recorded on my mobile phone but here is a bit of example music!
Mr. Speaker is 3D printed, but you will need to purchase a few electronics parts to make him sing. I strongly recommend getting the exact same circuits I use to avoid unexpected problems.
I will provide a link for each item that I actually purchased. I am not sponsoring that specific seller, it is just to illustrate the part needed. You may prefer to purchase the same part elsewhere.
- ADAU1401 DSP Board (Signal Processing)
- EZ-USB Programmer (Program the DSP memory)
- TPA3118 Mono Amp Board (Woofer Amp)
- TPA3110 Stereo Amp Board (Tweeter Amp)
- 14500 Batteries and Charger ('AA' sized batteries with high voltage and capacity)
- 4x 'AA' Battery Holder (Series connection for high voltage, not parallel. Sold as '6V' for AA batteries)
- 5 Volt Regulator (To power bluetooth and DSP boards)
- Speaker wadding
- M3 4mm Button Screws
- Bluetooth Module M28
- Source & Power Switch (2pcs, double pole, double throw, latching)
- Volume Switch (single pole, double throw, momentary)
- Aux Jack (3.5mm stereo)
Total cost should be approximately £125 GBP
You will also need basic tools like a soldering iron and some miscellaneous bits like glue and wire. And, of course, a 3D printer large enough (200x200x200) for example Ender3 plus PLA filament.
Update: I tested play time on one charge. Lasted about 3 hours.
Step 1: 3D Printing (Build)
Mr. Speaker is created as 6 pieces (STL files below).
The over-all model was designed in Autodesk Fusion360 and that file is also provided so that users can modify the design if they wish. I'm sorry to say I have not included the design history because it became way too messy.
- Port Tube
- Tweeter Cups
- Battery Cover
I designed the entire speaker knowing it would be 3D printed so avoided direct overhangs where possible by using chamfered edges. The 'phase plug' (we'll get to that later) also helps act as a support for the tweeter hole. This all means supports do not need to be added during slicing.
The two exceptions are the Bottom component that has large overhangs on the battery compartment and the Battery Cover itself. It would be wise to generate supports for both parts. That said I did print the Bottom without support and bridging of the gap was successful.
The Battery Cover prints okay without support laying flat, but I found the layer adhistion was not strong enough on the clip that needs to bend. So I printed it standing up with supports, to align the layers in the strongest way for the clip.
I slice models in Cura. To keep the Z-seam neat, enable 'Z-Seam Alignment' and 'Z-Seam Position' settings. Set alignment to 'Back Left' and then rotate the part until the Z-Seam is kept maintained along one edge. This is particularly clear to see on the main body. You can visualise the Z-Seam better in Cura if you enable the 'Coasting' setting.
I also recommend enabling 'Z-hop' so that the print head does not hit delicate tall parts such as the tweeter phase plug or the port tube while it is being built up. I do enable 'combing' but with the setting 'Not in Skin'.
I strongly recommend printing all other parts before the main body. The main body is a long print so you want to be confident everything is dialled in for your printer and filament. I used maximum part cooling to aid overhangs but this can result in some stringing especially on small details like the tweeter.
After the main body was printed I used some 220grit sand paper to remove rough endges from the back of the phase plate area so it would not contact the tweeter cone. The phase plate should be approx. 0.5mm from the tweeter cone, so it needs to be smooth and clean.
Step 2: Driver Choice (Design)
The first step in designing a speaker is usually choosing drivers.
I knew that a smaller woofer would be needed to keep the size of Mr. Speaker reasonably portable. I also knew that two woofers (for stereo) would need twice as much enclosure volume (litres) as a single woofer. Sorting through many options on the web I came to the Dayton ND91-4.
This driver appears to offer the deepest bass of all the 3" woofers as well as a very impressive 'X-max' which is the excursion capability, or put another way, how far the woofer can move back and forward to generate sound. If you want deep bass you need to move a lot of air so this is important, especially on a small driver.
Basic aspects of woofer performance can be specified with a set of numbers called 'thiele small' parameters. These provide data that can be used in calculations to predict how the woofer will respond in certain enclosure volumes or with various types of bass port. We don't need to do the calculations by hand though, we can use software like WinISD.
Here we quickly see that an enclosure volume of 2.2L and a port tubed to 58Hz will produce some pretty respectable bass output.
There are some 3" 'sub-woofer' drivers that go deeper but they can not be directly paired with a tweeter as they are totally bass focused.
Great, we've got a woofer! How about a tweeter?
Despite the ND91-4 being marketed as a 'full-range' driver it is simply not. Although it may appear to reach about 15,000Hz looking at the graph above, it only does this when you are exactly in front of it (on-axis). The high frequency sounds will disappear as you move even just a little bit to the side (off-axis). In short, if we want to hear the full musical range without being clamped in one precise spot, a tweeter is needed.
If this small 3" woofer is working very hard to produce deep bass, the higher range of sounds will suffer as a consequence. This is known a inter-modulation distortion; one sound effecting another. It might be akin to asking an artist to draw a detailed picture while doing a workout. Lines that were intended to be neat and smooth could easily come out wobbly.
The majority of affordable tweeters are not very good at reproducing the lower range of treble so I didn't want to use the standard silk-dome that needs to be swapped over to the woofer below 3,000Hz. Instead I chose the Hi-Vi B1S becasue it can reach as low as 800Hz, meaning more of the important musical range will remain detailed and clear when the woofer is doing a workout. Also, I had some in a box already!
You are probably wondering what the trade-off is here because nothing is free. The trade is mostly reduced efficiency; the B1S doesn't give much output level for the power you input. It also has a few bumps in the response. These might be problematic for a traditional 'passive' speaker design, but this isn't much of an issue with our DSP based active design.
Step 3: Acoustic Prototyping (Design)
At this point in the design I had the first full build prototype assembled and it was time to see what these drivers do in a real word enclosure.
An accurate microphone is placed in front of Mr. Speaker and the woofer and tweeter directly connected to the amplifier to test the raw output. These measurements were carried out using a software package called ARTA.
The woofer output (below) looks nice! The bass doesn't seem quite as strong as simulated, but does go deeper. Therefore it looks like the port can be made a bit shorter to tune it higher as pushing this 3" woofer to 40Hz is asking too much. Additionally, the microphone is a little bit closer to the woofer than the port tube which will make the low bass output look weaker than it is. We can definitely work with this!
The tweeter output (below) looks decent too. The distortion remains quite low from about 700Hz up to the top of the range. Below 700Hz the distortion rises. This gives us a sensible filter point to crossover to the woofer for frequencies below 800Hz.
There is an unexpected issue here; a sharp notch around 17,000Hz. This could easily be corrected in the DSP filtering, but if we measure off-axis (graph below, red and violet traces) we see that the notch moves lower in frequency. If we try to correct this with filters, when the listener moves to a different position in the room the correction won't be right anymore. If possible, we should fix this acoustically.
I know from experience this type of issue is usually caused by a reflection from something near the tweeter. When the reflected sound wave comes back to meet the original sound it can interfere causing bumps or dips in the output as we see above. In fact, this effect can even be caused by sound from the outside edge of the driver cone interfering with sound from the centre of the cone.
There is a weapon at our disposal called a 'phase-plug' that can influence the higher frequencies of a tweeter or woofer. A phase-plug is basically an object with a specific shape in front of the driver that forces sound to travel a certain path. If we choose the shape correctly, we can ensure sound that otherwise causes a cancellation is either blocked or takes a different path so it doesn't interfere. A few example images below:
Here I set out on a journey of trial and error armed with blu-tak and a 3D printer!
I started by using blu-tack to create various shapes that I stuck to a thin wire in front of the tweeter. This way I confirmed the area of interest can be influenced and improved. Then I turned to the 3D printer to rapidly create numerous phase-plug designs and test them. 3D printers are superb for fast iteration design. The graph above shows just how significant tiny changes in the shape of the phase plug design can be.
After settling on an optimal design I worked it in to the main body as an integral part, printed it again and saved some final acoustic measurements for exporting to the filter generation software.
Step 4: Filter Generation (Design)
To produce the DSP filter we export the raw response of each driver, including the phase data, to a program called RePhase.
This free software allows us to manipulate the frequency response and phase independently to generate a custom filter that corrects our driver to the desired output.
What is 'phase'? Explained simply, it is the timing of the sound arriving at the listener. Due to various reasons, not all frequencies get reproduced at the same time from a speaker. For instance, when the woofer and tweeter are in slightly different physical positions the sound from one driver might arrive at the listener earlier than the other. Going a bit deeper, aspects such as electronic filters can store energy at some frequencies longer than others meaning high frequencies might arrive at the listener sooner than mids. The difference in timing is too small to hear as a delay, but it can effect perceived clarity, so it's nice that we can correct it with DSP.
We can adjust all aspects of the filter until we have a flat frequency response in the desired pass-band, the crossover filtering at 800hz and then we tweak the phase and timing of the driver to get an accurate result. We do this for each driver to create a symmetrical match between the tweeter and woofer.
We can then generate 'filter coefficients' which are basically variables in a repetitive mathematical equation used to manipulate the sound signal. Entering our carefully generated coefficients in to the DSP we can manipulate the signal to get exactly the sound we want from the speaker. Mr. Speaker uses 250 coefficient sets or 'taps' per driver to tune the sound just as desired.
The DSP processor itself is programmed using a software called Sigma Studio. This allows a signal flow to be built up with the functions we desire such as splitting the woofer and tweeter signals with the custom filters we generated, aligning the timing of the drivers and adjusting the volume level. The DSP is capable of far more complex tasks so if you are adventurous I encourage you to play in Sigma Studio to customise Mr. Speaker your own way! Perhaps add some dynamics processing or EQ for your specific listening environment?
The acoustic output should then be confirmed with real measurements, and if necessary tweaked.
I'm super happy with this result! The phase response of the woofer starts to 'creep' below about 200Hz because the limited memory of the tiny DSP limits the length of the filter mathematics that can be used. Still, this is an impressive result!! Frankly, that is a more accurate frequency and phase output than most professional studio monitors :)
Step 5: Install the DSP Programmer (Build)
This part is mostly just a matter of installing the free software Analog Devices Sigma Studio and then installing the special 'FreeDSP' drivers for the programming board that make it appear inside Sigma Studio (Analog Devices make a programmer board but it is rather expensive, hence the special driver to use this affordable one).
Download Sigma Studio and install it. Just click next, next..
Download the FreeDSP driver and un-zip it to a folder you can find again.
The driver must be installed with Microsoft 'driver signing' disabled because, naturally, nobody paid Microsoft to sign it.
To do this click the Restart button from the start menu, but hold the left 'shift' key while you click it. When the computer re-starts you will see a screen with some options. Select Troubleshoot > Advanced Options > Startup Settings > Restart.
When the PC restarts, you need top press the number 7 on the keyboard to boot without driver signing.
Remove any pin jumpers from the programmer PCB. I've seen two versions, one with a single jumper, one with two jumpers. All must be removed.
First we must copy a file called 'ADI_USBi.spt' from the Sigma Studio install folder to the driver folder. I assume Windows 10 64bit.
The Sigma Studio file is found here: Your Drive > Program Files > Analog Devices > Sigma Studio 4.5 > USB Drivers > x64 > ADI_USBi.spt
The driver folder is found here: YourDrive > freeUSBi-master > SOURCES > DRIVERS > Win10 > x64
Connect the programmer by its USB cable and open Device Manager. To do this click on the Start Menu and simply begin typing 'Device Manager'. It should show the icon for you.
Find the 'Unknown Device' which will be the programmer board. *Right* click and select 'Update Driver'.
Select 'Browse my computer for driver software'.
Now click the 'Browse' button and point it to the folder where you un-zipped the driver and copied the file from Sigma Studio. Click Okay.
Windows should find the driver and ask if you really want to install it, even though it is not 'signed'. Select 'Install this driver software anyway'.
We are almost done. Hopefully Windows reports a successful install. Now unplug the programmer board and then re-connect it to make the driver install complete.
Restart your PC.
Step 6: Program the DSP (Build)
Now that Sigma Studio and the programmer board are installed we can load the DSP program.
Download the program (link below) I created for the DSP board and un-zip it somewhere you'll remember.
We need to connect the programming board and the DSP board together for power and data transfer. When each board turns on they both act as the 'master' on the data lines. This causes a problem if the programmer is powered up before the DSP board.
I think the easiest way to ensure the DSP board gets power first is to connect it directly to the USB power line, while the programmer board is turned on by the blue and white switch that it has.
We also need the ability to connect the 'WP' and 'GND' pins together temporarily while we store the program. 'WP' is Write Protect. It's not a good idea to leave those permanently connected because the memory could be corrupted by random power fluctuations or whatever.
So we need to do a bit of soldering and connect wires as shown:
Connect the USB cable to your computer. If the programmer turned on immediately you need to power it off by the switch, then disconnect and reconnect the cable. This way the DSP board will get power before the programmer. After connecting and waiting 5 seconds to allow the DSP board to boot, we can press the power switch on the programmer.
Open Sigma Studio.
Open the program you downloaded.
It should present a screen like this. Hopefully the USBi will have a green colour to indicate the programmer board has been detected. You might need to click on the 'Hardware Configuration' tab to see this screen.
If not... well poop. The driver install can be a little fussy, you can try again connected to a different USB port. Check Device Manager to ensure it doesn't show errors. Try re-starting the programmer. Go to diyaudio.com forums and ask for help ;)
Assuming all is well, simply click the 'Link Compile Download' button. This will load the program to the DSP active memory and run it. If it worked, we should see 'Active: Downloaded' in the bottom right of the screen.
HOWEVER, it is not saved on the DSP board storage yet, so when you restart the DSP it will revert to the default program.
Once the program is in active memory we can store it onboard. To do this, right click the box that says 'ADAU1401' and then select 'Write latest compilation to E2PROM'.
Do not click 'okay' yet!
To allow the memory to be written to permanent storage, the DSP board pin 'WP' must be connected to 'GND' temporarily, just while the program is stored. This disables storage write protection. So twist those wires together now. Then click okay.
Once the write is complete, you should un-twist the wires for 'WP' and 'GND' to protect the memory.
That's it! When the DSP board is powered off and powered on, it should automatically load and run the program for Mr.Speaker from the onboard storage. You can remove the wires now and get ready to install it in Mr. Speaker.
I know that just because you like 3D printing or electronics does not necessarily mean you are comfortable messing around with computers. I don't want this to put people off building Mr. Speaker. So I'll make you a deal - If you try to program your DSP board and fail, you can post the board to me in the UK and I'll program it for free. But you need to at least try yourself first!
Step 7: Assemble the Electronics (Build)
The bottom piece of Mr. Speaker is designed to house the battery, circuit boards and provide some wire routing. You can feed wires through the holes to keep them tidy.
To attach the circuit boards I used double sided sticky foam pads. These keep the boards lifted a few millimetres off the base so they do not make noise vibrating and soldered wires have a bit of space to pass through the pads. I used the same to affix the battery holder.
The first thing to do before we solder all the wires is to set the output voltage of the regulator board. On the back there are some solder pads. We need to use a solder blob or small wire strand to bridge the 'SV' one as shown (or is that meant to read 6V?).
Now connect the battery positive and negative wires directly to the regulator IN+ and GND pads. Use a multi-meter to measure Volts DC between GND and VO. Use a small screwdriver to adjust the little dial at the top right of the board and set as accurately to 5V as possible. It's better to go slightly under than over. I think I killed the bluetooth PCB by giving it 5.3V. It was happy with 4.8V. They are not expensive though so I bought another. Once the voltage is set we can disconnect the battery wires and move on.
The assembly of the electronics is pretty simple, but time consuming. You simply need to solder a number of wires between the circuit boards as shown in the two images 'Power Wiring' and 'Signal Wiring'. I suggest 26AWG wire.
The colour of the wires in the images is just to make it clear and does not indicate signal type etc..
The power wiring diagram shows the black GND (ground / negative) wires connecting every circuit and the battery to the 'GND' pad on the bluetooth board. It is important to wire each circuit back to that point as the diagram shows. This is called a 'star ground'. Do not assume that becasue the wires are connected together they can join at any point, that would cause extra noise.
Connect the switches and aux jack with some wire length so they can reach the mounting points later and assembly will not be too tricky.
Power switch to amps 15cm
Source switch to bluetooth 25cm
Source switch to DSP 25cm
Source switch to Aux socket 20cm
Volume switch to DSP 25cm
Seal the hole where the battery wires pass through with tack. A speaker cabinet must be air-tight so the bass port can operate efficiently. Also small air leaks can make 'farting' sounds.
You may like to attach the woofer to each of the amp output in turn (not at the same time!) and check you hear an output from the bluetooth module or aux jack. However, now is not the time to connect the drivers to the amp boards, we will do that at the final assembly step.
Step 8: Install the Drivers (Build)
Mr. Speaker has screw holes to mount the drivers, but they do not have a thread form. To create the thread form we need to heat up a screw with a flame and them press it gently in to the hole. This will allow the plastic to melt around the screw and form a thread shape. Once the screw cools down we can un-screw them ready to install the drivers.
Heat the screw while it is already on the end of the hex key. I found 10 seconds in the flame works well. If you drop the screw use pliers to pick it up. Do not be silly and burn yourself!
I recommend using M3 4mm screws, at least for the tweeters. These are not so common as 5mm screws but should be available from eBay or Amazon. Remember the tweeter body thickness will be added later so there is no need to insert the screws 100%.
When installing the tweeters and woofer, make sure to use the included foam gasket to help seal air gaps. You can poke the hex key through the screw holes to make sure it is lined up before inserting the screws.
Solder wires to the tweeters before screwing them in. Note the solder tag with a red mark is the positive terminal. If the connections are reversed the sound will be wrong.
Do the same for the woofer and again note the positive terminal. Remember the gasket.
Now we need to add the tweeter cups, so the delicate tweeters are not pulsated by the air pressure from the woofer. Thread the tweeter wires though the hole in the back. Cut out a piece of damping material about 3cm x 12cm and place it in the cup. This will help absorb sound waves from the back of the tweeter.
Now add a bead of contact adhesive on main body where the tweeter is installed and also on the tweeter cup. Let the adhesive dry for about 10 minutes. Once it is slightly dry you can press the two together firmly.
Do not press the face of Mr. Speaker against the table like I did, the tweeter phase plate cracked!
When the tweeter cup has been installed, the hole on the back must be sealed. I used tack. Be sure it is well sealed, even a small air gap can cause distortion.
Step 9: Connect and Close (Build)
You made it to the last step, awesome!
We just need to solder the woofer and tweeter wires to the amp boards as shown in the diagram. Take note of the positive and negative markings on the boards.
It's now a good time to fit the aux socket and the power switch in the main body. I suggest adding some epoxy glue or sealant to keep them in place and air-tight.
Toggle switches work kind of backwards. When the lever points upwards, they connect to the wires on the bottom terminals. So note the toggle switch orientation when you install it.
The top and bottom piece are both designed with snap in place joints. So they do not need glue to fix them, but a little bit of silicone sealant is still a good idea to seal them, once you know everything is correct. You can test dry.
Once the bottom is installed, the source and volume switches can be fixed in, again with a little glue.
It's a good idea to add some speaker wadding inside the main body to reduce reflections from the back of the woofer. I used a piece about 15cm x 40cm.
The Top piece and the Port tube slot together and it's a good idea to use a little sealant again here.
The port tube should be oriented towards the small cut-off corner of the top piece, that's the back of Mr. Speaker. The larger cut-off corner is the front.
Finally, the top piece can be snapped in to place. Again a bit of sealant should go on the joint once you know everything is operating correctly.
Now he's done!
Second Prize in the
Audio Challenge 2020