Overview

Trash Fish is a fun and inventive use of scrap materials, brought to life by Circuit Playground Express!

This glowing mechanical creature is programmed using MakeCode, making it accessible for beginners and easy to adapt. Aside from the electronics, this fish can be created using household materials and requires no soldering.

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

Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m

PRODUCT ID: 3811
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow! This Adafruit NeoPixel LED Strip with Alligator...
$12.50
IN STOCK

Continuous Rotation Micro Servo

PRODUCT ID: 2442
Need to make a tiny robot? This little micro servo rotates 360 degrees fully forward or backwards, instead of moving to a single position. You can use any servo code, hardware...
$7.50
IN STOCK

Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

PRODUCT ID: 3448
When working 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...
OUT OF STOCK

Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh

PRODUCT ID: 3898
Lithium ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery...
$6.95
IN STOCK

JST 2-pin Extension Cable with On/Off Switch - JST PH2

PRODUCT ID: 3064
By popular request - we now have a way you can turn on-and-off Lithium Polymer batteries without unplugging them.This PH2 Female/Male JST 2-pin Extension...
$2.95
IN STOCK

USB cable - USB A to Micro-B

PRODUCT ID: 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...
$2.95
IN STOCK

Adafruit Micro Lipo - USB LiIon/LiPoly charger

PRODUCT ID: 1304
Oh so adorable, this is the tiniest little lipo charger, so handy you can keep it any project box! Its also easy to use. Simply plug in the gold plated contacts into any USB port and a...
$5.95
IN STOCK

Other Materials

MakeCode

Getting Familiar

Microsoft MakeCode for Adafruit is a web-based code editor that provides a block editor, similar to Scratch or Code.org, and also a JavaScript editor for more advanced users.

If you've never used the Circuit Playground Express with MakeCode before, this guide is a good place to start.

Uploading Code to Circuit Playground Express

To upload code to Circuit Playground Express, follow these instructions:

1) Connect your Circuit Playground Express to your computer using a micro USB cable and press the small reset button in the center of the board. All the LEDs will flash red briefly, then turn green. Your computer should now show a removable drive called CPLAYBOOT. 

2) Click the Download button in the code window below to download the .UF2 file to your computer.

3) Now drag and drop the .UF2 file onto the CPLAYBOOT drive in your computer's file explorer or finder.

Once the file is dragged onto CPLAYBOOT the drive will automatically eject itself (your computer may give you a "failed to eject drive correctly" error, you can ignore this). The code is now on your Circuit Playground Express and ready to run!

Note: If you get a drive named CIRCUITPY, no worries! Press the reset button twice to get a flash drive named CPLAYBOOT. The project will not run if copied onto the CIRCUITPY drive as it is for CircuitPython.

Editing the Code

If you'd like to play with this code, click Edit in MakeCode and a new window will open in which you can create your own version.

MakeCode is fun to work with and easy to customize, allowing you to get some great results with just a little trial-and-error.

If you'd like to program your fish to swim faster or slower, you can change the number in the servo write pin A1 block (the further from 90 the faster the servo will spin). You can see in the example below that the fins are programmed to flap quickly when the slide switch on the board is moved right, and move slowly or stop altogether when the switch is moved left.

The rate at which your fish changes color can also be modified by changing the pause value in the forever block.

Circuit Diagram

The circuit for this project is quite simple, just connect the Vout pad on Circuit Playground Express (CPX) to the servo's red wire, the A1 pad to the yellow wire, and the GND pad to the brown wire. 

The alligator clip-to-male jumper wire connectors are great for connecting servo motors to CPX.

Circuit, Simplified

If you'd like to forgo the NeoPixel strip and just create a mechanical swimming fish, you can opt to connect just the servo to your Circuit Playground Express, clipping the alligator clips to pads Vout, A1, and GND.

Powering the Fish

Circuit Playground Express can use a variety of power sources, anywhere between 3V-5V is safe. These compact 400mAh lithium ion polymer batteries are excellent for powering small projects like this. 

A set of 3 AAA batteries also provides ample power, if that option is more convenient. If you're using a AAAx3 battery pack, check that the switch on the battery pack is set to "ON" when you want to power the boat.

Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh

PRODUCT ID: 3898
Lithium ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery...
$6.95
IN STOCK

Adafruit Micro Lipo - USB LiIon/LiPoly charger

PRODUCT ID: 1304
Oh so adorable, this is the tiniest little lipo charger, so handy you can keep it any project box! Its also easy to use. Simply plug in the gold plated contacts into any USB port and a...
$5.95
IN STOCK

Trash Fish Assembly

Create Shell

Wrap a ball in a layer of thin plastic. A large mixing bowl also works if a ball isn't available.

Cover in successive layers of clear masking tape. Build up about 6-7 layers of tape, or until the shell feels thick and sturdy.

Please be careful in using sharp objects to cut items and adults should assist younger makers.

Cut in Half

Use scissors to cut around the middle, creating two halves.

Create your desired shape

Cut the two hemispheres into football shapes by trimming some material off each side along a curved line.

Cut some indents into the top, bottom, and back of the fish shell. These indents will provide openings through which the fins can stick out.

Fisheye Hole

To give your fish a glowing electronic eye, we'll cut a hole in which to install the Circuit Playground Express board.

Trace outline of CPX on the inside of the fish shell.

Use diagonal cutters to cut a hole, staying 1/4" inside the outline. 

Trash Fins

Use pipe cleaners and masking tape to create some fins for your fish.

Sandwich a trimmed array of pipe cleaners between two sheets of masking tape.

Trim around the edges to achieve the desired size and shape.

Set these fins aside, they will be glued onto the the fish in the final steps. 

Fish Frame

Create a frame to hold the fins using a piece of scrap cardboard.

Place a section of a plastic straw over a piece of wooden skewer. Use hot glue to stick this to the frame. 

Hot glue can burn skin and should not be used such that it might create a fire hazard. Please assist younger Makers with this step.

Fin Hinge

Glue a small length of plastic straw onto the hinge.

Next, use hot glue to add some paper fin supports at 90 degrees to the straw attachment.

These paper supports will serve to hold and stiffen the fish's fins when the time comes.

Prep Servo

Unbend a paper clip and create an "L" shape.

Screw the wheel attachment to the servo horn.

Glue the section of the paper clip onto the servo wheel.

Install Servo

Cut a hole for the continuous rotation servo motor and glue it in place.

Poke three straws onto the paper clip. Trim each straw so they extend just an inch or so beyond where they will connect to the fins. 

Final Connections

Cut a small slit down the middle of the straw. Use hot glue to clamp it around the other straw. 

Do this for each fin, then use some hot glue to affix the fins to the paper fin supports that we added earlier.

Your frame should now be ready to install inside the fish shell!

Install Electronics

Use hot glue to tack the Circuit Playground Express in place inside the fish.

Loop your strip of NeoPixels around the inside of the fish shell, holding each end in place with a liberal amount of hot glue.

Finally, bring the two halves of the fish together, enclosing the electronics inside.

Use some large dabs of hot glue around the outside edge to hold the halves together. Glueing a JST extension power switch to the underside of the fish can help make it easy to turn on and off.

Troubleshooting

Problem: My motor doesn't turn!

Solution: Make sure that your Circuit Playground Express is connected to a power source (anywhere between 3V-5V is safe). If you're using a AAAx3 battery pack, check that the switch on the battery pack is set to "ON".

Problem: My Circuit Playground Express doesn't show up as CPLAYBOOT

Solutions:

  • Be sure you have a Circuit Playground Express.  The Classic will not work with MakeCode.
  • Some USB cables are "charge-only" and won't pass data. Try using a different USB cable and try using a different USB port on your computer.  
  • With the Circuit Playground plugged into your computer with a micro USB cable, click the small reset button in the center of the board. The lights should all turn green. If they don't, try double-clicking the reset button.

If things still aren't working, head over to the Intro to Circuit Playground Express guide for more suggestions.

Motor Speed Adjustment

 

If you find your motor doesn't come to a full stop, you can fix this by making tiny adjustments to the potentiometer on the bottom of the motor.

This guide was first published on May 31, 2019. It was last updated on May 31, 2019.