Bluetooth Enabled Synthesizer for mbed
Group Members: Mark Pinion, Jake Campbell, John Aspinall
Description:
This notebook page covers a design project involving a sound synthesizer for the mbed that is controlled via a bluetooth module. The mbed outputs the sounds via the AnalogOut pin to an amplifier circuit, and from there to a small speaker mounted on a breadboard with the rest of the components. An LCD is also included in the design, and displays the current values of a few parameters that will affect the sound that the mbed outputs. These parameters include the current octave, the current duration that the note will play, the current shape of the waveform (sine, square, sawtooth), as well as the current ADSR (attack, decay, sustain, and release) envelope that modulates the amplitude of the wave to give different sounds. An Adafruit low energy bluetooth module allows communication to the mbed, either from a PC with a compatible bluetooth dongle running Adafruit's software, or via Adafruit's app available on the app store as well as for Android devices. In addition, there is a GUI which gives the user visual information regarding the current state of the parameters previously mentioned that affect the sound that is played. The GUI also displays two graphs, one showing the type of waveform and the other showing the shape of the 'envelope'. The last note played is also displayed to the user. The synthesizer covers all the full octaves that can be heard on a piano, and all notes except for the sharps are included (A, B, C, D, E, F, G). All inputs are passed through the bluetooth module to the mbed by sending certain characters through Adafruit's application in UART mode. The bluetooth module must also be set to UART mode with a small switch that is mounted to the board containing the bluetooth hardware.
A link to the Adafruit software used to communicate with the module can be found here: https://github.com/adafruit/adafruit-bluefruit-le-desktop
The dongle we bought to enable our computer to communicate with the module can be found here: https://www.adafruit.com/products/1327
Hookup Guide:
For the Adafruit LE Bluetooth Module:
Mbed | Adafruit Bluetooth Module |
---|---|
Gnd | GND |
Gnd | CTS |
p14 (Any serial Rx Pin) | TXO |
p13 (Any serial Tx Pin) | RXI |
Vout (5V) | VIN |
Not Used | MOD |
Not Used | DFU |
Not Used | RTS |
For the Speaker and Audio Amp Breakout Board:
mbed | TPA2005D1 | Speaker |
---|---|---|
gnd | pwr - (gnd), in - | |
Vout (3.3V) or 5V | pwr + | |
p18 (Any PWM or D/A) | in + | |
out + | + | |
out - | - | |
Any DigitalOut pin(optional) | S (low for shutdown) |
You can also hook-up a potentiometer to the three volume terminals on the TPA2005D1 in order to be able to adjust the volume on the fly.
SparkFun MicroSD Breakout Board:
MicroSD Breakout Board | mbed |
---|---|
CS | p8 (DigitalOut) |
DI | p5 (SPI mosi) |
VCC | Vout (3.3V) |
SCK | p7 (SPI sclk) |
GND | GND |
DO | p6 (SPI miso) |
CD |
DO NOT HOOK UP VCC TO 5V, IT COULD DAMAGE YOUR SD CARD.
uLCD:
uLCD jumper wires | mbed |
---|---|
+5V | VU (5.0v) |
RX | p14 (any Serial rx pin) |
TX | p13 (any Serial tx pin) |
GND | GND |
RES | p11 (Any DigitalOut pin, Optional) |
The code for the synthesizer can be found here;
Import programBlueSynth
Bluetooth Enabled Keyboard/Synthesizer
Here is a picture of the complete setup on the board:
Here is a picture of the GUI:
Here is a video demonstrating the capabilities of the synthesizer:
Here is the link to our GUI code: https://github.com/guidingarrow/BlueSynth
One last thing to note is that in order to have the GUI function correctly in tandem with the Adafruit application that sends the characters to the mbed, we wrote a script that causes a few things to happen when a button is pressed. The mbed will behave correctly as long as you send characters to it through the Adafruit program, but in order to have our GUI work at the same time, some extra steps are needed. The software we used to develop the script can be found at the following website: https://autohotkey.com/
Please log in to post comments.