Skip to content

Hardware

daviderovell0 edited this page Apr 18, 2020 · 15 revisions

This page provides the necessary information to build a simple working prototype.

System diagram

The following diagram gives an overview of the device components and their interactions. Hardware system diagram The bzzzbz prototype (v1.0) uses a Raspberry Pi 3B+ as core of the system to exploit the capabilities of a Linux system with direct access to hardware. Custom electronics circuits are connected to the Pi's GPIOs in order to interface the Pi with the external analogue inputs: audio input and control surface. The following sections will outline each subsystem in detail.

Audio interface

The audio interface uses the WM8731 audio CODEC to perform analogue to digital conversion to the incoming audio signal (line input). The chip also provides headphones/line outputs that allow our prototype to have an audio output together with the generated visuals. Furthermore, the Linux kernel (v4.19) in the Raspbian OS comes with an integrated driver for the WM8731 so that the chip can be configured and used directly from the Raspberry Pi.

The chip is mounted on a breakout board in order to be connected to the Raspberry Pi header pins. The schematic for the breakout board is shown in the figure below: Audio breakout board The board uses decoupling capacitors to protect the analogue inputs and the power lines as advised in the codec datasheet. A 12MHz crystal was connected to the XTO/MCLK inputs of the chip enabling it as a master clocking source (with the raspberry Pi consequently acting as a slave). These inputs can be also left disconnected for the chip to receive the clock from the Raspberry Pi, the two configurations are interchangeable. Standard PCB 2.54mm headers are used for power and wired connection to the Raspberry Pi. The line and headphones connections use stereo 3.5mm jack sockets. The final breakout board is shown below.

picture here

The schematic and PCB files can be found in the hardware folder in the main repository under wm8731-breakout.

Controls interface

The control interface consists of 3 potentiometers connected to the MCP3008 multi-channel ADC converter. The chip is then connected to the Raspberry Pi via jumper cables, where the values of the incoming potentiometers are read through SPI communication. A schematic of the control breakout board is shown below.
Controls breakout board Due to the current emergency lockdown, the breakout board could not be completed before the release date. The PCB files are therefore missing. However, the same result can be achieved with a breadboard! The picture below shows a reproduction of the schematic on breadboard.

picture here

The schematic can be found in the hardware folder in the main repository under mcp3008-breakout.

Connecting everything together

When all the subsystems are assembled, the connectors on both boards can be connected to the Raspberry Pi header according to the following table using jumper cables:

WM8731 pin # MCP3008 pin # Raspberry Pi pin
2 - GND
3 - 12
4 - 40
5 - 35
6 - 20
7 - 35
21 - GND
22 - GND
23 - 3
24 - 5
- 10 24
- 11 19
- 12 21
- 13 23

Then connect the VDD/VDDA from the audio breakout to 3.3V, 5V to the power lines in the control breakout breadboard, grounds accordingly. The hardware prototype is now ready, following section briefly describes how to configure the Raspberry Pi to communicate with the hardware.

Raspberry Pi configuration

Flash the SD card with the latest Raspbian distribution (choose the version without the GUI as it would introduces several issues and latencies in the software).

Log in and edit the /boot/config.txt with replacing the following line:

#dtparam-audio=on <-- comment this out
dtoverlay=audioinjector-wm8731-audio

The audio codec is now configured. Reboot the system and run sudo alsamixer. If the hardware was assembled correctly you should see the mixer interface displaying the WM8731 configuration options. Enable the Line In input, Output Mixer Line Bypass and Capture - Line in. The system is now fully configured for the software, visit the Getting started page to start making some bzzzbz visuals.

Future objectives

The current prototype can be used for demonstration and testing purposes due to t. It is however very fragile and introduces several latencies and faults in the system (such as SPI/I2S long cables). Our objective is to develop a finished prototyped box and compact surface-mount pi-hat for the next release. Meanwhile you can still start playing and experimenting with this easy-to-assemble prototype.

Clone this wiki locally