Make a Smart Speaker With Raspberry Pi for Daily Use
by yihui in Circuits > Raspberry Pi
12305 Views, 6 Favorites, 0 Comments
Make a Smart Speaker With Raspberry Pi for Daily Use
![prototype1.jpg](/proxy/?url=https://content.instructables.com/FEA/BL9X/JTIYGA8J/FEABL9XJTIYGA8J.jpg&filename=prototype1.jpg)
![protopyte1a.png](/proxy/?url=https://content.instructables.com/FWF/620U/JTIYGA8G/FWF620UJTIYGA8G.png&filename=protopyte1a.png)
![IMG_20190308_113218.jpg](/proxy/?url=https://content.instructables.com/FDT/4CCJ/JSYZBRIQ/FDT4CCJJSYZBRIQ.jpg&filename=IMG_20190308_113218.jpg)
If we make something with Raspberry Pi or Arduino but without a case,most likely we would not use it in everyday life. So when I finished to make a smart speaker with Raspberry Pi, I thought I should make a case for it. Here we go.
Prepare Hardware
![Raspberry-Pi-3-Flat-Top-800.jpg](/proxy/?url=https://content.instructables.com/FBO/E8YX/JTIYG9ZA/FBOE8YXJTIYG9ZA.jpg&filename=Raspberry-Pi-3-Flat-Top-800.jpg)
![respeaker-4mic-linear-array.jpg](/proxy/?url=https://content.instructables.com/FFV/Z2T0/JTIYG9FI/FFVZ2T0JTIYG9FI.jpg&filename=respeaker-4mic-linear-array.jpg)
![45mm-speaker.png](/proxy/?url=https://content.instructables.com/F0Y/A1GG/JTIYG8HL/F0YA1GGJTIYG8HL.png&filename=45mm-speaker.png)
![nylon_rivet.png](/proxy/?url=https://content.instructables.com/FU1/62JA/JTIYG8C4/FU162JAJTIYG8C4.png&filename=nylon_rivet.png)
The hardware includes:
- Raspberry Pi 3B (or 3B+)
- ReSpeaker 4 Mic Linear Array
- 45mm Speaker
- Laser-Cut Paper Case
- 2 Nylon Rivets (R3035 or R3045), the diameter of mounting holes is 3mm (ф3). Screws will also work, while rivets is easier to use
Make a Paper Case
![prototype1_librecad.png](/proxy/?url=https://content.instructables.com/FYW/EN3K/JTIYG8KX/FYWEN3KJTIYG8KX.png&filename=prototype1_librecad.png)
![speaker_hole.png](/proxy/?url=https://content.instructables.com/F3V/RO2E/JTIYG8LW/F3VRO2EJTIYG8LW.png&filename=speaker_hole.png)
To use a laser cutter, we need a CAD design file. I learned how to use a CAD software at college, but have not used CAD for many years. Fortunately, it is easy to design a paper case. We only have to know how draw lines and circles. Commercial CAD tools are quite expensive, but for this simple task, the open source CAD tool - LibreCAD is enough to get it done. You can design a unique paper case based on my work.
If you have not used any CAD software, it will take some time to be familiar with a CAD software like LibreCAD. You can also use Python script to genrate the CAD DXF file. Manfred Moitzi's handy Python library - ezdxf will help us to do the design work. For example, to draw an array of speaker holes, using Python script is much easier:
<p>import ezdxf<br> dwg = ezdxf.new('R2007') msp = dwg.modelspace() d = 40. n = int(40 / 1.5) delta = d / n start = (100, 100) msp.add_circle(start, 20) for x in range(-n, n): for y in range(-n, n): if y & 1: offset = 0.5 else: offset = 0 rx = ((x + offset)**2 + y**2)**0.5 if rx <= (n/2 + 0.1): r = 0.35 # (0.25 * delta * (n/2 - rx) / (n/2) + 0.15 * delta) msp.add_circle((start[0] + (x + offset) * delta, start[1] + y * delta), r) dwg.saveas('speaker_hole.dxf')</p>
Downloads
Assambling
Software
For a smart speaker, the software is the key point. The easiest way is using Alexa Voice Service or Google Assistant SDK. If you want to know how a voice assistant works, you should try MyCroft. Or if you prefer to an offline voice assistant, Snips.ai is a good option. You can find a full list of resources at voice-engine/make-a-smart-speaker.
You can find a step by step guide to setup Alexa Voice Service as a voice assistant at voice-engine/smart_speaker_from_scratch