Using MakeCode and Circuit Playground Express you can make interactive projects using lights and sound. In this project we'll build a custom PCB for the CPX and use capacitive touch to make a playable mini synth instrument.
MakeCode is this programming editor that runs in the Google Chrome web browser. It’s has an intuitive interface that’s both block based and text editor.
It works with Adafruit Circuit Playground Express so you can make interactive projects with the on-board sensors and components. You can drag & drop blocks to make interactive programs using lights and sounds without having to solder or learning a new syntax.
You can alternatively upload code directly to the Circuit Playground Express with WebUSB, follow this guide if you'd like to try that option.
To get started, we'll need to head over to the Adafruit MakeCode website and follow the steps below.
- Plug in your Circuit Playground Express with a USB Cable
- Press the RESET button. Green light means you're ready to MakeCode
- Download the UF2 file and drop it onto CPLAYBOOT.
Once you have your CPX setup with the makecode UF2, try testing it out by uploading the code to the board. Click the link below to open up the program in makecode. Click on the pnik edit icon near the top of the title to open the code. This will create a project in MakeCode and allow you to edit, modify and upload the code to the board.
Let's break down the project and walk through setting it up one block at a time. We'll start with using the interface. On the far left side is an image of the CPX board. This is the CPX simulator. You can use it to test your code. It's interactive, try clicking on the buttons and pads. Right next to it is a menu with colored blocks. Each is section that contains several functions that are associated with the sections title. For example, the "LIGHT" blue color menu has all things pertaining to the RBG NeoPixel LEDs.
We've created basic momentary inputs that trigger both sounds and lights. This behavior should feel familiar. Think about how an electric piano works, as you hold down a key, the note keeps playing and stops as soon as the key is released. There's similar functionality in buttons from gamepads and keyboards. Now you can change the on block from "Button A" to any of the pads (A1 – A7). These pads are capacitive touch enabled, so you can touch them to trigger sounds and lights. Attach alligator clips to them and plug them into any electrically conductive material such as fruit, play doh, copper tape or aluminum foil.
Designing in Eagle CAD
I started with downloading the Circuit Playground Express board file from github. Using Autodesk Eagle software, you can open the design and inspect components, traces and the pin layout. From there I referenced the size and positions of the pads. I then created a simple layout with the exact same pin layout.
If you're new to eagle, I suggest watching a few tutorials on youtube to get familiar with the user interface and features.
Bantam Tools software features a material profile preset for singled sided FR-1 boards. Select the Single-Sided FR-1 option from the material drop down. The size is already configured for the PCB blanks purchased from Bantam Tools. Under the placement dropdown, you'll need to input a value for the Z axis. This should be the thickness of the tape. We're using double-sided permanent scotch tape, which is 0.08mm. Type or paste that value into the input field.
Vacuum & Clean
Once the milling is complete, you'll need to use a vacuum to clean up all of the dust and excess material. It may be difficult to get behind the spoil board, so I tend to use the move commands, Re-Home, Origin, and Loading. Click these will move the spoil board.
Scotch Brite Pad
The edges of the traces might have burrs. I like to use a scotch brite pad and lightly sand the top surface of the PCB. A few passes for a minute will smooth out the edges and make the cooper look shine and clean. This will introduce new dust, so you may need to use the vacuum again.
Next up we can work on removing the PCBs from the spoil board. The adhesive in the double-sided tape is fairly tough, so I do not recommend prying the PCB off. That could bend the PCB or damage the board. So I use a squeeze bottle with alcohol and pour it onto the edges of the PCB. This will soften the adhesive and make removal easier.
Let the alcohol soak underneath the PCB for a moment. Then, use a thin spatula or palette knife to get in between the PCB and spoil board. Be very careful not to scratch either surface. I try to get in between the strips of tape. Once under the PCB, slowly begin to lift to remove the PCB. Apply more alcohol is needed.
With the PCB blank removed from the spoil board, we'll need to remove the PCBs from the FR-1 blank. I suggest doing this over a waste bit so it can catch dust and debris. If the board outline wasn't cut all the way through the material, you'll need to use a knife, blade or similar to cut it out of the blank. Dust tends to accumulate in the board outline. Use a scotch brite pad to smooth out the edges. Use a pair of tweezers or needle to poke out the holes.
Thoroughly inspect the traces and holes. Make sure all of the burrs and dust has been removed from the traces and holes. Bare copper will eventually oxidize and begin to rust. You can protect the surface with UV curable solder mask or similar. We have a learn guide on that topic, as it is not covered in this project.
Not to worry! You can use a 3D printing service such as 3DHubs or MakeXYZ to have a local 3D printer operator 3D print and ship you parts to you. This is a great way to get your parts 3D printed by local makers. You could also try checking out your local Library or search for a Maker Space.
You'll need an STL file to 3D print the mount for the circuit playground express. Click the button below to download the STL from your choice of repo site.
The enclosure assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, SAT and more. Electronic components like the board, displays, connectors and more can be downloaded from our Fusion 360 CAD parts github repo.