Close

Prototype #1 based on Raspberry Pi + ReSpeaker 4 Mic Linear Array

A project log for Smart Speaker from Scratch

Make an open source smart speaker for daily use

YihuiYihui 03/20/2019 at 14:180 Comments

This is a paper case smart speaker made with Raspberry Pi and ReSpeaker 4 Mic Linear Array. See also on Github

Hardware

The hardware includes:

Raspberry Pi and ReSpeaker 4 Mic Linear Array can be found at Seeed Studio, and we get the 45mm speaker and nylon rivets from Alibaba or Taobao.

Design a Paper Case

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 circels. 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.

The Python script is like:

import ezdxf

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')

 The output will be:

We can use both LibreCAD and Python script to make a complex design.

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. If you prefer to offline voice assistant, Snips.ai is a good option. You can find a full list of resources at voice-engine/make-a-smart-speaker.

Discussions