ReSpeaker 4-Mic Array for the Raspberry Pi

Today’s project is a ReSpeaker 4-Mic Array for the Raspberry Pi. It is a quad-microphone expansion board designed for AI and voice applications. This means that we can build a more powerful and flexible voice product that integrates Amazon Alexa Voice Service, Google Assistant, and so on.

The Respeaker comes assembled and easily fits onto any Raspberry Pi provided that the header is already installed to it.

Mount ReSpeaker 4-Mic Array on Raspberry Pi, make sure that the pins are properly aligned when stacking the ReSpeaker 4-Mic Array for Raspberry Pi.

Note: Hot-plugging ReSpeaker is not allowed. It will damage the respeaker.

Install driver

The AC108 codec is not supported by Pi kernel builds currently, we have to build it manually.

sudo apt-get update
sudo apt-get upgrade
git clone https://github.com/respeaker/seeed-voicecard.git
cd seeed-voicecard
sudo ./install.sh
reboot

  • Step 3. Then select the headphone jack on Raspberry Pi for audio output:

sudo raspi-config
# Select 7 Advanced Options
# Select A4 Audio
# Select 1 Force 3.5mm (‘headphone’) jack
# Select Finish

BONUS: Play with APA102 LEDs

Each on-board APA102 LED has an additional driver chip. The driver chip takes care of receiving the desired color via its input lines and then holding this color until a new command is received.

  • Step 1. Activate SPI:
    • sudo raspi-config
    • Go to “Interfacing Options”
    • Go to “SPI”
    • Enable SPI
    • Exit the tool
  • Step 2. Get APA102 LEDs Library and examples

pi@raspberrypi:~ $ cd /home/pi
pi@raspberrypi:~ $ git clone https://github.com/respeaker/4mics_hat.git
pi@raspberrypi:~ $ cd /home/pi/4mics_hat
pi@raspberrypi:~/4mics_hat $ sudo apt install python-virtualenv 
pi@raspberrypi:~/4mics_hat $ virtualenv –system-site-packages ~/env 
pi@raspberrypi:~/4mics_hat $ source ~/env/bin/activate 
(env) pi@raspberrypi:~/4mics_hat $ pip install spidev gpiozero

  • Step 3. Then run the example code under virtualenv, now we can see the LEDs blink like Google Assistant.

(env) pi@raspberrypi:~/4mics_hat $ python pixels_demo.py

There is a LOT more you can do with this board but I will leave that for you to discover. There is a great WiKi on this over at the Seeed Studio website.

The main reason for me wanting to install the Respeaker is that there are two programs that I used on a regular basis that require a microphone to work and this is the perfect solution for my needs. Those programs are:

Both are easy to install and I will show you how to install both of these in a future video.

Final Thoughts:

The Respeaker is a great add-on for the Raspberry Pi. It is expensive but it has a lot to offer. For all of my future projects, this seems for now to be a good choice. See you next week!

The Pimoroni Inky pHAT

This tutorial will show you how to install the Pimoroni  Inky pHAT Python library, and then walk through its functionality. You’ll learn how to run the a few of the included examples: the calendar and the name badge. For the complete tutorial you can go the the Pimoroni website:

Inky-pHAT1
Inky-pHAT1

https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat

Inky-pHAT2
Inky-pHAT2

First thing I did on my Raspberry Pi Zero WH was open a new terminal window and update the software to tun the Pimoroni  Inky pHAT:

sudo pip install –upgrade inkyphat

Inky-pHAT3
Inky-pHAT3

Then I made sure my version of Raspbian was up to date with this command:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Inky-pHAT4
Inky-pHAT4

Then I the following command to setup the Inky pHAT:

curl https://get.pimoroni.com/inkyphat | bash

Inky-pHAT5
Inky-pHAT5

Once that’s done reboot your Pi to let the changes propagate.

After the reboot open up a terminal window and navigate to:

cd /home/pi/Pimoroni/inkyphat/examples

Once there you can then type “ls” to see the examples in that directory. I did the calendar:

python cal.py

Inky-pHAT6
Inky-pHAT6

Then:

python hello.py “Single-Board.com”

Inky-pHAT7
Inky-pHAT7

Final thoughts:

I am very happy with the completion of this project. It seems that all the soldering I did on the header works as intended. I will update more as I intend to use this Inky pHAT in all of my future projects. I will definitely be adding my logo on there!

What is next weeks project?

Inky-pHAT8

Inky-pHAT8

%d bloggers like this: