Overview

In this project we’ll show you how to light up your marble run and motorize it with an Adafruit Crickit.

 

The tracks are fully 3d printed and designed by Tulio Laanen – It uses a worm style elevator to lift ball bearings up the the top of the tracks.

 

This impressive design is 3D printed in a single part. We design a base to fit the electronics and components! 

The Adafruit Crickit drives a gearbox DC motor to turn the elevator, while the LED strips illuminate the tracks and animate different effects.

 

You can also use the on-board sensors to trigger other components like additional servos, solenoids or even electromagnets. We can it interactive using sound, temperature and more!

 

 

Prerequisite Guides

There's resources in these guides that go beyond what's covered in this tutorial. MakeCode guide is all about setting up your Circuit Playground Express board. TheCircuit Playground Express introduction guide walks you through all of the pinouts, sensors and everything you need to know.

Parts

You can find the list of all parts used to make this project linked below!

 

Adafruit CRICKIT for Circuit Playground Express

PRODUCT ID: 3093
Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into slaves always ends up in a robot rebellion. Why even go down that...
$29.95
IN STOCK

Circuit Playground Express

PRODUCT ID: 3333
Circuit Playground Express is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and...
$24.95
IN STOCK

TT Motor All-Metal Gearbox - 1:90 Gear Ratio

PRODUCT ID: 3802
These durable (but affordable!) gearbox motors (also known as 'TT' motors) are an easy, low-cost way to get your projects moving. This is a TT DC All-Metal Gearbox...
OUT OF STOCK

3 x AA Battery Holder with 2.1mm Plug

PRODUCT ID: 3842
Here's another addition to our growing family of AA battery holders. A holder for three (3) AA batteries!...
OUT OF STOCK

Adafruit NeoPixel UV LED Strip with 32 LED/m

PRODUCT ID: 3851
What new iteration of NeoPixel strip is this? Roll out the black light and disco ball! It's an Adafruit...
$24.95
IN STOCK

Premium Male/Male Jumper Wires - 40 x 3" (75mm)

PRODUCT ID: 759
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 3" (75mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow...
$3.95
IN STOCK

Panel Mount Extension USB Cable - Micro B Male to Micro B Female

PRODUCT ID: 3258
Check out this handy MicroUSB extension cable, which will make it easy for you to enclose a device that has a B type (micro USB host) port. Great if you need to extend the USB...
$4.95
IN STOCK

Breadboard-friendly SPDT Slide Switch

PRODUCT ID: 805
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch...
$0.95
IN STOCK

Ultimaker 3 - 3D Printer

PRODUCT ID: 3300
The Ultimaker 3 is one of our favorite 3D printers on the market. It's a well-built open-source compact machine with an excellent UX. Every inch of the...
OUT OF STOCK

Filament for 3D Printers in Various Colors and Types

PRODUCT ID: 2080
Having a 3D printer without filament is sort of like having a regular printer without paper or ink.  And while a lot of printers come with some filament there's a good chance...
OUT OF STOCK
3 x M3 x 6mm
Crickit enclosure mount screws
2 x M3 x 25mm
TT motor Screws

Prerequisite Guides

If you're new to Adafruit CRICKIT, Circuit Python and soldering, take a moment to walk through the following guides to get you started.

Circuit Diagram

Take a moment to review the components in the circuit diagram. This illustration is meant for referencing wired connections - The length of wire, position and size of components are not exact.

Connections:

Motor Terminal: 

Black and Red wires will connect to either side of the 1 or 2 labeled terminals 

The 3xAA battery case connects to the Power input on the Crickit.

NeoPixel:

The UV NeoPixel strip connects to the NeoPixel terminal. Din on the NeoPixel strip connects to the arrow icon on the terminal on the Crickit on the Crickit. GND connects to GND and 5V to 5V.

MakeCode

MakeCode for CRICKIT // Circuit Playground Express

 

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's CRICKIT and 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 upload code directly to the Circuit Playground Express with WebUSB, amazing!

Setup Circuit Playground Express for MakeCode

To get started, we'll need to head over to the Adafruit MakeCode website and follow the steps below.

  1. Plug in your Circuit Playground Express with a USB Cable
  2. Press the RESET button. Green light means you're ready to MakeCode
  3. Download the UF2 file and drop it onto CPLAYBOOT.

Install CRICKIT Extension for MakeCode

 

On the makecode site, click on New Project. In the list of blocks, select ADVANCED and then EXTENSIONS. Click on the Crickit block that shows up and install Crickit support! You will now have a new CRICKIT bin of blocks you can use! Continue on to learn how to use these blocks. Read the full guide here for more info.

Upload and Test Code

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. 

WebUSB

 

Makecode can also pair with your Circuit Playground Express through a chrome web browser - see this guide page on how to set it up.

 

This means code edit will upload directly to the Circuit Playground Express without the need to drag and drop file onto it!

 

Follow the instruction to set up your board and you'll be able to quickly send code to Circuit Playground Express! 

3D Printing

What If I Don't Have A 3D Printer?

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.

Marble Run Design

The tracks are fully 3d printed and designed by Tulio Laanen – It uses a worm style elevator to lift ball bearings up the tracks. This marble run is an impressive design that is 3D printed in a single part.  We design a base to fit the electronics and components. The marble run design can be downloaded from the thingiverse page. Use the links below to download the enclosure 3D files.

***Use two top parts from the original design (The "lock cap" and "turn cap").***

Slice Settings

 

These settings are for a 0.4mm and 0.8mm nozzle profiles using CURA 3.4.1. Optimized for the Ultimaker 2/3. 

  • Nozzle .4mm or 8.mm
  • Layer Height .2mm or 0.3mm
  • Line Width .38 or 0.77mm
  • Print Speed 70mm/s or 50mm/s 
  • Retraction 6.5mm
  • Build plate adhesion type – skirt
  • Bed 60c
  • Motor Bracket requires supports

Supports

 

The motor bracket will require supports because of the way the standoffs mount to the Circuit Playground Express and the Crickit. 

 

We recommend adding a interface layer to decrease supports from fusing to the part. Breakaway filament is very handy in this application, since it will not fuse and won't distort our part. 

Fusion 360 files 

Below are links to modify the design of the enclosure, noodle size and motor parts to fine tune them to adjust to your printer tolerances.

Design Source Files

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.

Assemble

Battery Slide Switch

 

To start, we'll first modify our 3xAA battery holder and wire up an slide switch inline with the power.

 

First, we'll carefully cut one of the wires and then extend each side   with a 50mm long wire. Next, we'll connect these two wires to each pin on our slide switch as shown in the picture. 

 

Remember to add heat shrink to each wire connection and the slide switch pins, before soldering!  

Motor wires

 

The slower but stronger motors will require us to solder on their wires. We used male to male jumper cables to make them easy to attach to the terminal block on the Crickit. 

 

Position the motor as shown and then solder the left wire pointing the right side of the motor as shown. This will make it easier to route wires while mounting inside the enclosure. 

Motor bracket

 

The motor will mount on top of the Circuit Playground Express by way of our 3d printed bracket.

 

We used two 25mm long screws to reach from the top of the motor body into our bracket.

 

Align the mounting tab on the motor the center pin on the bracket and then fasten both screws.

 

CPX Brass standoffs

 

First we'll need to fasten the included brass standoffs onto the bottom of the Circuit Playground Express. Attach to the standoffs to the SDA, SCL, END, VOUT, A0 and A1 pads. 

 

Mount Motor to CPX

 

With our motor mounted to the bracket, we'll align the wires on the motor to the opposite side of the USB port on the Circuit Playground Express as shown. 

 

Use four M3x6mm long screws to secure the bracket to the top of the Circuit Playground Express. 

 

 

Mount CPX to Crickit

 

The Crickit secures the CPX by fastening the included screws into the six standoffs on the CPX. Insert the screws from the bottom of the Crickit into the standoffs on the CPX. 

 

 

Motor Terminal 

 

We'll need a screw driver to loosen and then tighten the terminal slot to secure each motor wire. Insert one wire into each of the motor terminals. We used terminal number two.

 

Mount Crickit to enclosure

 

Now we can go ahead a mount the Crickit, CPX and motor assembly into the printed enclosure! Align the mounting holes on the Crickit to the standoffs on the case and use M3x4mm screws to attach.

 

USB panel 

 

Fasten the include screws into the two mounting holes on the outside of the case. Align the USB panel and fasten both screws to mount the panle. Route the cable around the Crickit as shown in the picture. 

 

 

 

 

Note the motor can easily be removed when you need to press the rest button to enter into MakeCode mode. The mounting holes are just large enough to easily pull the motor out without a screw driver.

Slide switch

 

The slide switch mounts to the port opening on the side of the case. Carefully bend back the two metal tabs on the slide switch to help increase or decrease the tolerance fit when mounting inside the port opening.  

 

Battery pack

 

Insert three AA batteries into the pack. Route the cable around the board edges and plug into the Crickit's power input.

USB Cable

 

Now we can plug our USB panel cable into our Circuit Playground Express USB port.   

 

NeoPixel Strip

 

We can optionally add our UV NeoPixel strip after all of the components are mounted. We laid the strip with the LEDs facing towards the inside of the case. This will help evenly illuminate the tracks.

Attach Track

 

Finally we can attach the track to the top of the enclosure. Alignment isn't import, so we can rotate the track base until it tightly snap fits into place.

 

Gear Assemble

 

The last step is is to gently attach the gear into the center of the Marble run.

 

Insert the gear with the slot side into the center of the Marble run. We'll then slightly turn the gear until it slips into the motor shaft.

 

Next place the lock cap part on top of the gear and then finally the turn cap on top to complete the build!

And there we have it, a portable motorized Marble run! This track has a 20 ball bearing capacity but can reliably run about 7 ball bearings without any spills.

Big ups to Tulio Laanen for an awesome design, check out his designs! Def post a make if you’ve made one!

This guide was first published on Sep 05, 2018. It was last updated on Sep 05, 2018.