# Grand Central Soundboard in Ten Minutes

## Overview

https://youtu.be/m3bLDwXRJHo

The Adafruit Grand Central is arguably one of the most feature-rich boards Adafruit produces. Adafruit is planning some great tutorials to showcase using the Grand Central in many ways. But what about a simple "I just got my board and want to do a quick demo to kick the tires?"

Rather than code some "blink the LED" or "Hello World" project, here is a quick project only using a few parts which will have you building a fully functional soundboard in about ten minutes.

The ability to do this partially lays with the powerful processor on the Grand Central but has everything to do with being able to run CircuitPython. This easy to use yet powerful code is loaded onto the board by saving a file onto the flash drive, which shows up when you plug the Grand Central into your PC / Mac / Linux / Chromebook via a USB cable. It is that easy, no software framework to set up, no compiling, no compatibility issues. It really allows you to plug, copy, and go!

This project will get you started with the code and eight public domain/creative commons sound files and you can make this project your own by changing things up.

## Parts
### Adafruit Grand Central M4 Express featuring the SAMD51

[Adafruit Grand Central M4 Express featuring the SAMD51](https://www.adafruit.com/product/4064)
Are you ready? Really ready? Cause here comes the **Adafruit Grand Central** featuring the **Microchip ATSAMD51**. This dev board is so big, it's not named after a Metro train, it's a whole freakin' _station_!

This board is like a freight...

In Stock
[Buy Now](https://www.adafruit.com/product/4064)
[Related Guides to the Product](https://learn.adafruit.com/products/4064/guides)
![Angled Shot of the Adafruit Grand Central M4 Express featuring the SAMD51.](https://cdn-shop.adafruit.com/640x480/4064-05.jpg)

### Membrane 3x4 Matrix Keypad + extras

[Membrane 3x4 Matrix Keypad + extras](https://www.adafruit.com/product/419)
Punch in your secret key into this numeric matrix keypad. This keypad has 12 buttons, arranged in a telephone-line 3x4 grid. It's made of a thin, flexible membrane material with an adhesive backing (just remove the paper) so you can attach it to nearly anything. The keys are connected into...

In Stock
[Buy Now](https://www.adafruit.com/product/419)
[Related Guides to the Product](https://learn.adafruit.com/products/419/guides)
![Finger pressing one key of 3x4 keypad](https://cdn-shop.adafruit.com/640x480/419-05.jpg)

### USB Powered Speakers

[USB Powered Speakers](https://www.adafruit.com/product/1363)
Add some extra boom to your audio project with these powered loudspeakers. We sampled half a dozen different models to find ones with a good frequency response, so you'll get quality audio output for music playback. Simply connect the standard 3.5mm stereo plug into your Raspberry Pi model...

In Stock
[Buy Now](https://www.adafruit.com/product/1363)
[Related Guides to the Product](https://learn.adafruit.com/products/1363/guides)
![Two square-ish USB Powered Speakers](https://cdn-shop.adafruit.com/640x480/1363-07.jpg)

### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
![Group of Small Alligator Clip to Male Jumper Wires](https://cdn-shop.adafruit.com/640x480/3448-00.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

## Power

For a demo project, USB power for the speakers and the Grand Central is perfect. If you really want to take this on the go, an optional a cell phone recharge battery with two USB ports would help.

### USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs

[USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs](https://www.adafruit.com/product/1566)
A large-sized rechargeable battery pack for your [Raspberry Pi](http://www.adafruit.com/raspberrypi) (or [Arduino](http://www.adafruit.com/arduino), or [Propeller](http://www.adafruit.com/category/26), or anything else that uses 5V!). This pack is intended for...

In Stock
[Buy Now](https://www.adafruit.com/product/1566)
[Related Guides to the Product](https://learn.adafruit.com/products/1566/guides)
![Angled shot of white rectangular USB battery pack with 4 dotted lights indicating battery is fully charged. ](https://cdn-shop.adafruit.com/640x480/1566-11.jpg)

or maybe two of these:

# Grand Central Soundboard in Ten Minutes

## Software

![](https://cdn-learn.adafruit.com/assets/assets/000/069/236/medium800/feather_circuitpython_blinka-small.png?1547241464)

The Grand Central comes preloaded with CircuitPython. CircuitPython allows you to program a wide variety of microcontroller boards and single board computers without installing software on your computer. All you need is a plain text editor, found on all computers since before IBM made the PC.

If you would like a Python-friendly editor which has a serial connection to the board, a plotter, and more, Adafruit recommends Mu, a free editor made for ease of use. [See this page on installing Mu](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor) if you like.

## Download Library Files

Plug your Grand Central board into your computer via a USB cable. Please be sure it is a good power+data cable so the computer can talk to the Grand Central board.

A new disk should appear in your computer's file explorer/finder called **CIRCUITPY**. This is the place we'll copy the code, sound files, and code libraries.

Create a new directory on your Grand Central's **CIRCUITPY** drive named **lib**.

Download the latest CircuitPython drivers to your computer using the green button below. Save to your computer's hard drive where you can find it.

[Go to GitHub to get the latest CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/)
With your file explorer/finder, browse to the bundle and open it up. Copy the following file from the library bundle to your **CIRCUITPY**  **lib** directory you made earlier:

- **adafruit\_matrixkeypad.mpy**

All of the other necessary code is baked into CircuitPython!

![](https://cdn-learn.adafruit.com/assets/assets/000/069/230/medium800/circuitpython_library.png?1547240922)

## Download Code and Sounds

Below is the code for this project. To grab the entire package with the sample train sound files, select **Download: Project Zip** to your computer hard drive. This will contain **code.py** and a subdirectory called **sounds** which contains the wav files.

With your computer file explorer/finder, browse to the location where you saved the code zip file, open the zip file, open the folder **Grand\_Central\_Soundboard** &nbsp;directory and copy the files **code.py** and the&nbsp; **sounds** &nbsp;directory to your **CIRCUITPY** drive. The **sounds** directory will contain 8 wav files and a license text file.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Grand_Central_Soundboard/code.py

Coding the project in CircuitPython makes this project truly easy. Copy the code and go! You can see the libraries that facilitate using the Grand Central and the matrix keypad are already coded - the program defines what we're using (keypad, audio), grabs the sound files, then checks to see when you press a key to trigger the appropriate effect.

## Files Double Check

A listing of the **CIRCUITPY** drive in your file explorer/finder should look similar to the one below. The extra files starting with a period (if you see them) are for Mac file handling, you don't need to deal with those. You should just ensure you have **code.py** , a **sounds** directory (containing wav files) and a **lib** directory containing the matrix keypad library.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/231/medium800/circuitpython_all-files.png?1547240993)

On your Grand Central **CIRCUITPY** flash drive, if you are missing the **code.py** , the **lib** directory or the **sounds** directory (with the respective files in the directory files), please go back and download them. They'll all be needed for the final project.

# Grand Central Soundboard in Ten Minutes

## Connections and Operation

This project is built to use a minimum of parts to get started quickly. It can easily be expanded in multiple ways if desired.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/162/medium800/circuitpython_diagram43.png?1547233621)

The matrix keypad from Adafruit comes with some male-male pins allowing the female connector to mate with a female breadboard or circuit board. Place the header onto the keypad connector and plug the pins into the Grand Central pins **1** to **7**. The colored face of the keypad should be up as shown in the diagram.

Place a **black** header male pin to alligator clip from **GND** on the Grand Central to the amplified speaker TRS connector, the **sleeve** closest to the plastic of the plug. Take a **red** jumper, plug into the Grand Central **A0** pin and clip the alligator clip to the **tip** of the speaker plug. This will make a mono channel amplifier connection to one of the speakers of the stereo set.

Ensure the Grand Central is plugged into power, either 9 volts on the barrel connector or maybe connected to the USB port to draw 5 volts (such as a computer connection or a 5V "cell phone recharge" battery.

Power the speakers by placing the speaker USB connector to a suitable 5 volt USB jack.&nbsp;

## Operation

Turn on the power for the speakers if necessary and adjust the volume so sound can be heard when operating.

Press one of the keys on the keypad, from 1 to 8. You should head a sound effect related to trains. Pressing another key will interrupt the playing sound to play the new sound. You can also use the zero (0) key to stop a playing sound.

If the sound cannot be heard, check your speaker volume and connections. Be sure the speakers and Grand Central are powered and that the keypad is plugged in correctly.

Have fun with all the train sounds on your new soundboard!

The attribution for the sounds used are in the file **Sound-licenses.txt** in the **/sounds** directory. Two are public domain, the rest are CC3 attribution.

## Going Further

You are not limited to these 8 train related sounds. You can take any sound, convert it to a wav file, name it from 01.wav to 08.wav and have it triggered. [Use this guide](https://learn.adafruit.com/microcontroller-compatible-audio-file-conversion) to convert a file to the appropriate format for playing on microcontrollers: mono, 16-bit PCM, 22,050 Hz (or less), WAV format.

You may consider many variations on this project. Some code changes and all 12 keys can play sounds. A bigger keypad or multiple keypads would allow selection of more sound effects. With all the input pins on the Grand Central, a very elaborate soundboard could be created. The limiting factor would then be the amount of space on the Grand Central flash drive for sound files. In that case, the SD card slot could read a large SD-micro card with sounds on it, leading to some truly Grand effects.


## Featured Products

### Adafruit Grand Central M4 Express featuring the SAMD51

[Adafruit Grand Central M4 Express featuring the SAMD51](https://www.adafruit.com/product/4064)
Are you ready? Really ready? Cause here comes the **Adafruit Grand Central** featuring the **Microchip ATSAMD51**. This dev board is so big, it's not named after a Metro train, it's a whole freakin' _station_!

This board is like a freight...

In Stock
[Buy Now](https://www.adafruit.com/product/4064)
[Related Guides to the Product](https://learn.adafruit.com/products/4064/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### Membrane 3x4 Matrix Keypad + extras

[Membrane 3x4 Matrix Keypad + extras](https://www.adafruit.com/product/419)
Punch in your secret key into this numeric matrix keypad. This keypad has 12 buttons, arranged in a telephone-line 3x4 grid. It's made of a thin, flexible membrane material with an adhesive backing (just remove the paper) so you can attach it to nearly anything. The keys are connected into...

In Stock
[Buy Now](https://www.adafruit.com/product/419)
[Related Guides to the Product](https://learn.adafruit.com/products/419/guides)
### USB Powered Speakers

[USB Powered Speakers](https://www.adafruit.com/product/1363)
Add some extra boom to your audio project with these powered loudspeakers. We sampled half a dozen different models to find ones with a good frequency response, so you'll get quality audio output for music playback. Simply connect the standard 3.5mm stereo plug into your Raspberry Pi model...

In Stock
[Buy Now](https://www.adafruit.com/product/1363)
[Related Guides to the Product](https://learn.adafruit.com/products/1363/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
### USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs

[USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs](https://www.adafruit.com/product/1566)
A large-sized rechargeable battery pack for your [Raspberry Pi](http://www.adafruit.com/raspberrypi) (or [Arduino](http://www.adafruit.com/arduino), or [Propeller](http://www.adafruit.com/category/26), or anything else that uses 5V!). This pack is intended for...

In Stock
[Buy Now](https://www.adafruit.com/product/1566)
[Related Guides to the Product](https://learn.adafruit.com/products/1566/guides)
### USB Battery Pack - 2200 mAh Capacity - 5V 1A Output

[USB Battery Pack - 2200 mAh Capacity - 5V 1A Output](https://www.adafruit.com/product/1959)
A smaller-sized rechargeable battery pack for your&nbsp;[Raspberry Pi](http://www.adafruit.com/raspberrypi)&nbsp;or [Raspberry Pi B+](https://www.adafruit.com/product/1914)&nbsp;(or&nbsp;[Arduino](http://www.adafruit.com/arduino), or&nbsp;<a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1959)
[Related Guides to the Product](https://learn.adafruit.com/products/1959/guides)

## Related Guides

- [Introducing the Adafruit Grand Central M4 Express](https://learn.adafruit.com/adafruit-grand-central.md)
- [Tilt Controlled Marble Maze](https://learn.adafruit.com/tilt-controlled-marble-maze.md)
- [Circuit Playground Express Spooky Laughing Box](https://learn.adafruit.com/spooky-circuit-playground-express-mystery-box.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [Crawling Animatronic Hand](https://learn.adafruit.com/crawling-hand-with-cpx-and-makecode.md)
- [Pushrod Garage](https://learn.adafruit.com/pushrod-garage.md)
- [CircuitPython 101: State Machines, Two Ways](https://learn.adafruit.com/circuitpython-101-state-machines.md)
- [Snake Charmer Box](https://learn.adafruit.com/snakecharmer.md)
- [Currying in CircuitPython](https://learn.adafruit.com/partials-in-circuitpython.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [Make It Bubble](https://learn.adafruit.com/make-it-bubble.md)
- [BLE Volume Knob with CircuitPython](https://learn.adafruit.com/bluetooth-le-hid-volume-knob-with-circuitpython.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [Color Spinner Camera Ring Light ](https://learn.adafruit.com/camera-ring-light-with-cpx.md)
- [Xenomorph Halloween Candy Bucket](https://learn.adafruit.com/xenomorph-halloween-candy-bucket.md)
