AudioAmp Extension Module

Type: Actuator
Generates: Auditory Feedback
Inventory: 8 units
Pins: Serial Communication: D8, RX_S, TX_S, Sound generation via Base Module: D9, D10

The AudioAmp Extension lets you create complex sounds far beyond a 'beep' directly with the BRIX₂ platform. This allows applications such as embedded sonification or synthesizers. The AudioAmp Extension contains an optional amplification circuit, so you can not only connect headphones but also speakers directly. Above that, the module features an optional dedicated Arduino that can handle the sound synthesis, so the Base Module can care about something else.
We suggest to use the Mozzi library to generate sounds with BRIX₂.

The Mozzi Library

"Currently your Arduino can only beep like a microwave oven. Mozzi brings your Arduino to life by allowing it to produce much more complex and interesting growls, sweeps and chorusing atmospherics. These sounds can be quickly and easily constructed from familiar synthesis units like oscillators, delays, filters and envelopes.

You can use Mozzi to generate algorithmic music for an installation or performance, or make interactive sonifications of sensors, on a small, modular and super cheap Arduino, without the need for additional shields, message passing or external synths."

(from http://sensorium.github.io/Mozzi/)

Application Scenarios: It's an Arduino itself!

If you want to use the AudioAmp Extension, you have to options for designing your application. First you can just upload your Mozzi sketch to the BRIX₂ Base Module as usual. Via the lines D9 and D10, the signal is forwarded to the headphone jack of the AudioAmp module, optionaly amplified. Second, you can upload the Mozzi sketch to the Arduino on the AudioAmp module, so it will run independently. This leaves you a lot of free space on the BRIX₂ Base Module for the rest of your application. You can then control the Audio Synthesis via Serial.

Mozzi Sketch runs on Base Module

If your Mozzi sketch runs directly on the BRIX₂ Base Module, you have to set both MOZZI solder jumpers to "EXT" (https://opensource.cit-ec.de/projects/brix2/wiki/Audio_extension_new#Hardware-Configuration-by-Solder-Jumpers). Now all the AudioAmp module does is basically just providing the headphone jack plus optional amplification.

Mozzi Sketch runs on AudioAmp

In order to save space on your User Controller, you can just upload the Mozzi Sketch to the Mozzi Controller on the AudioAmp module. You can then communicate between both controllers using Serial. For Uploading and Communicating, it is necessary to put an empty sketch onto the System Controller. (https://opensource.cit-ec.de/projects/brix2/wiki/Setting_up_a_BRIX%E2%82%82_Module#Compiling-and-uploading-systemServices , choose Examples>Basics>Bare Minimum instead of SystemServices sketch!). Using the same method with the AudioAmp_Traverse sketch, you can then upload a sketch to the Mozzi Controller on the AudioAmp Module.

Hardware Configuration by Solder Jumpers

>>>The default configuration is Mozzi Ext, headphones (no amplification)<<<

On Revision 2 of the Board (90/45 degree angle traces, not round traces), there are only 2 pairs of solder jumpers that configure 4 different settings. Solder jumpers should only be changed in pairs!

Output Select (Top side of the PCB)

The green configuration provides amplified output (note the little speaker on the PCB), whereas the pink configuration (note the little pair of headphones) provides unamplified output directly from the source.

Mozzi Select (Bottom side of the PCB)

In the green configuration ("Mozzi here"), the output circuitry is hooked up to the microcontroller on the AudioAmp Extension which is then supposed to run the sound generation. In the pink configuration (Mozzi ext) the output circuitry is connected to pins D9 and D10 of the Base Module. This allows to run the Mozzi sound synthesis on the Base Module.

Uploading sketches to the AudioAmp Controller

If your AudioAmp Controller is configured to use Hardware Serial, you can just upload the >Tools>AudioAmp_Traverse sketch to your User Controller. Then select "Arduino Duemilanove w/ATmega328" as a Board and upload your Mozzi sketch to the AudioAmp Extension. Regardless if you are using a Hardware Serial or Software Serial connection to upload your sketches to the AudioAmp Extension, you need to patch your Arduino IDE (as of July 2014).

Patching the Arduino IDE

In order to program the BRIX2 System Controller via the Serial_Traverse sketch, you will need to patch a file (as of Arduino 1.0.4). The patch needed is the same as described here: https://opensource.cit-ec.de/projects/brix2/wiki/Setting_up_a_BRIX%E2%82%82_Module#Enable-upload-through-the-User-Controller

Uploading the sketch

On order to upload a sketch to the AudioAmp, you have to upload the "LiBRIX2>Tools>Soft_Serial_Traverse" sketch to the BRIX2 User Controller. After that, select"Audio Amp Extension" as board and then upload your sketch to the AudioAmp.
The sketch:

Developer Informations

Preparing a fresh AudioAmp Module

In order to install the bootloader, connect your ISP adapter to the 6 pads on the lower side of the board.

cd arduino-1.0.6/hardware/arduino/bootloaders/atmega

avrdude -B 2 -p m328p -P /dev/ttyS0 -U flash:w:ATmegaBOOT_168_atmega328.hex ; avrdude -p m328p -P /dev/ttyS0 -U lfuse:w:0xE0:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m ; avrdude -p m328p -P /dev/ttyS0 -nv

This should return something like

avrdude: safemode: lfuse reads as E0
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5

There's your bootloader.

*Status: First Tests

Bug Reports:

- Headphone Jack collides with C7 during population. Had to cut away the cones on the bottom side.
- Hardware RX/TX are swapped. TX on Mozzi controller connects to TXD of User Controller. Maybe the option should just be connecting RX of the Mozzi controller to TXD of the User Controller and restrict everything to a one-way communication. But then, the bootloader is an issue. Although we can address either System Controller or Mozzi Controller by different reset lines, they still are likely to interfere on the RX/TX lines. Maybe we could put the System Controller into a non-communication-mode first.

audioamp_new.jpg (732.207 KB) Sebastian Zehe, 2015-01-22 15:00

BRIX_Mozzi_uploading.png (46.798 KB) Sebastian Zehe, 2015-01-22 16:03

BRIX_Mozzi_application.png (43.055 KB) Sebastian Zehe, 2015-01-22 16:03

BRIX_Mozzi_from_base.png (46.541 KB) Sebastian Zehe, 2015-01-22 16:24

bot.png (16.228 KB) Sebastian Zehe, 2015-02-23 13:45

top.png (104.177 KB) Sebastian Zehe, 2015-02-23 13:45