Glowing Slime Lunchbox
2018-08-24 | By Adafruit Industries
License: See Original Project Circuit Playground
Courtesy of Adafruit
Guide by Ruiz Brothers
DIY Slime for Science!
This classic do it yourself project is a great little science experiment that promotes STEM and STEAM education. This project has gain lots of traction and seems to be an ever growing trend. There's hundreds of videos and tutorials showing how to make different variants from majestic unicorn poop to cosmic galaxy glitter. This might be only one with LEDs!
DIY Slime for Science!
You've heard of glow-in-the-dark slime, but what about Light Up NeoPixel slime! The florescent colors of slim combined with an ultra violet light source can make for some interesting effects. It's also (somewhat) conductive so it can be used to make projects with capacitive touch!
Tools & Supplies
Most of the ingredients to make slime can be found at your local shopping market but maybe you have some on hand! The original recipe calls for a mixture of baking soda and contact fluid but Elmer's now has a pre-made solution called Magic Liquid that is specially made to make slime.
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.
These are some handy things to have when mixing and handing slime.
- Mixing Bowl
- Paper Towels
- Ziplock Bags
- Decorations: glitter, sequins, beads or confetti
- 3xAAA Batteries
Circuit Playground Express is the next step towards a perfect introduction to electronics and programming.
3 x AAA Battery Holder with On/Off Switch and 2-Pin JST
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects.
Your eyes do not deceive you – this is absolutely an AdaBot lunchbox!
Adafruit NeoPixel LED Strip w/ Alligator Clips - 60 LED/m
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow!
Adafruit NeoPixel LED Strip w/ Alligator Clips - 30 LEDs/meter
Adding glowy color to your projects has never been easier: no more soldering or stripping wires, clip 'em on and glow!
Adafruit NeoPixel UV LED Strip with 32 LED/m
What new iteration of NeoPixel strip is this? Roll out the black light and disco ball!
Small Alligator Clip Test Lead (set of 12)
Connect this to that without soldering using these handy mini alligator clip test leads. 15" cables with alligator clip on each end, color coded.
Circuit Diagram
Click on link to see larger above image
Circuit Diagram
This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. The NeoPixel strip features alligator clips that connect directly to the pads on the Circuit Playground Express.
Power Pack
The 3xAAA battery pack can supply ~4.5 V which is suffice to power the Circuit Playground Express and 30 count NeoPixel strip. The battery plugs directs into the JST connector. Optionally power over 5 V USB hub like computer or charger from mobile devices.
Wired Connections
The following connections are setup for the program in MakeCode. The data input from the NeoPixel can be switched to any available pins (except for A0 but OK on A1-A7 ) on the Circuit Playground.
- GND from NeoPixel strip to GND on Circuit Playground Express
- DIN from NeoPixel strip to A1 on Circuit Playground Express
- 5V from NeoPixel strip to VOUT on Circuit Playground Express
Made in Fritzing
You can download the diagram and modify the connections or repurpose the components to make new diagrams! This was made in Fritzing, it's open source software designed to make electronics design easy, check it out. http://fritzing.org/download/
MakeCode
Setup Circuit Playground Express for MakeCode
MakeCode is a block based language that makes it easy to program the Circuit Playground Express. You can drag and drop code blocks to make things light up. 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.
Lauch Adafruit MakeCode Website
Click on link to see larger image above
LunchBox with Motion Activated NeoPixels
When the lunchbox is opened, a strip of NeoPixel flash on/off and a Power Up sound effect is triggered. Then, the NeoPixels on the Circuit Playground Express sparkle after the NeoPixel strip flashes.
How's does this work?
The accelerometer on the Circuit Playground Express can detect when it's facing up and down. In the code, we can tell the NeoPixel LEDs to flash on and off when the Circuit Playground is facing up. We can also add sound effects and animate the on-board NeoPixels.
LunchBox Code
The full program is available to download and modify. Click the Adafruit flower logo in the top left to open in a new window. There you can play with the Circuit Playground simulator, modify code blocks and upload code.
Below the code embed is a step by step breakdown of the program. Read through it to get an idea of how to build this program, block by block. If you get stuck, re-read the steps and reference the guide.
Click to open up the MakeCode editor with code for this project!
How To Connect NeoPixel Strip to Circuit Playground Express
We need to setup the neopixel strip by assigning it to a pin on the Circuit Playground. We can do this by creating a variable, setting up a strip and configuring which pin it's on and how many pixels are in the strip.
- Drag and drop an On Start block from the Loops menu onto the canvas.
- Create a variable called "strip" using the "Make Variable" button in the Variables menu.
- Click on the "Light" menu and click the "NeoPixel" submenu.
- Drag the "Set [strip] to create strip" block into the On Start block.
- Click the plus( ) button and select A1
- Click the plus( ) button again and type in 30 (the number of pixels in our strip)
- Drag and drop a Strip Set Brightness block from the NeoPixel submenu to the bottom of the Set Strip block. Type in desired brightness (255 is max).
Click on link to see larger image above
Click on link to see larger image above
Click on link to see larger image above
Making Things Light Up
Now that we have our external neopixel strip setup, we can start programming events to trigger animations and sound effects. Let's think about how we can do this. In this project, we placed the Circuit Playground inside the lid of the lunchbox. So when the cover is open, the board is facing up and when it's closed, it's facing down.
- Drag and drop "On Shake" block from the Input menu onto the canvas.
- Click the "Shake" option to open the dropdown and choose "Face Up".
- Drag and drop "[Strip] set all pixels to [color]" into the "On Face Up" block.
- Choose a color by clicking on the color box and picking from the swatches.
- Drag and drop "play sound [power up]" into the "On face up" block.
- Choose a sound effect by clicking on the dropdown picker.
- Download code and test!
When the board is facing up, it should light up the strip of neopixels and play a sound. That's great, but how do we get the lights to flash on and off?
Click on link to see larger image above
Click on link to see larger image above
Click on link to see larger image above
Using Loops for Flashing Lights
In order to flash the NeoPixels on and off, we'll need to create a repeat block and loop between turning the pixels black and white (or in this case, on and off).
- Drag and drop "repeat [4] times" block from the "Loops" menu onto the canvas.
- Insert a "[strip] set all pixels to color" block into the "repeat [4] times" block.
- Choose the color black
- Drag and drop "pause [100]ms" block from the "Loops" menu below the "strip set all pixels" block.
- Type in or choose the value "100".
- Right click on the "[strip] set all pixels to color" block and choose duplicate.
- Place below the "pause" block
- Change the color to something other than black.
- Add another "pause" block to the bottom of the second "strip set all pixels" block.
And now we have a repeat block that we can insert into our "Face Up" block. You'll want to replace the first "strip set all pixels" block with our "repeat" block.
Click on link to see larger image above
Click on link to see larger image above
Click on link to see larger image above
Adjust, Remix and Modify
You easily change up the options in the various blocks to make new events and triggers! Why not change on face up to on shake? Now you can shake the launch box to make lights or sounds! Add an on face down block to make it do other things when the lunchbox is closed! The options and combinations are enormous so start experimenting!
Make Slime
Magicial Liquid
Now let's move on to making a batch of slime! We found the easiest recipe use's Elmer's Magical Liquid.
This mixture is a combination of contact lens solution and backing soda. This makes it easier to make slime without having to worry about measuring several ingredients. Less mess too!
The bottle has measuring markers on side so you can reference how much to use in a given batch.
Mix Glue
The instructions listed on the bottle state the use of 4oz, 5oz, and 6oz glue bottles can make a single batch using 1/4 cup of magical liquid. Take your bottle of glue and dump the contents into the mixing bowl. You can tap the bottom of the bottle if you squeezing doesn't get it all out. Then, slowly pour the magical liquid into the glue a little at a time. Use your fingers to mix them together. Swirling the contents together help with blending.
Take the slime out of the mixing bowl and knead with both hands. You'll want to do this until the slime has a stretchy consistency.
If it's too sticky, you can add a small amount of magical liquid to even it out. Continue to knead the mixture with both hands but a third hand is very helpful if you get stuck!
Be mindful with the magical liquid. If you add too much, it the slime slightly hardens, becomes more tough and less stretchy. Our ideal mixture is slightly sticky, very goopy and stretchy.
Continue to knead until it reaches your desired consistency.
Add bedazzle
To make our slime more colorful and textured, you can toss in decorations like beads, glitter, sequins and other bedazzles.
Try to avoid adding things that might be pointy and sharp. We added these little star flakes to our mix and didn't realize they were actually kinda sharp. It won't cut but might scrape a finger or two!
If you more slime that's fluffy and more "airy", try adding some shaving cream. Store Slime
To extend the life of you slime, we'll want to store our slime in an air tight container or ziplock bags. Slime will dry if left out after a day.
Store Slime
To extend the life of your slime, we'll want to store your slime in an air tight container or ziplock bags.
Setup Lunchbox
Dividers
We designed these 2 x 3 dividers to be cut out of chipboard material. Our SVG files can be used on a laser cutter, cutting machine (like Cricut or Silhouette) or even 3D printed. Use a medium weight chipboard, it's about 1.6 mm thick.
If you use a different material, make sure to measure the thickness. You may need to update the "slits" in the dividers to accommodate the materials thickness. The slits should be the same size as the material.
Bottom Liners
The bottom of the lunchbox is lined with a chipboard cutout that covers up the bottom. This helps keep the lunchbox clean in case things spill over. We used the same material as the dividers. You can also cutout the design out of foil card stock or patterned scrapbooking paper.
Download Design - Fusion 360 source
Install NeoPixel Strip
A NeoPixel strip can be lined along the inside of the lunchbox. Place the strip down with the LEDs facing inwards. Spread the strip so it's right up against the walls of the lunchbox. The strip is insulated with a silicone sheathing that proves grip so it holds together.
Secure Circuit Playground
Use a bit of mounting tack to stick the circuit playground onto the inside of the cover. It looks great in the center of adabot's chest.
Install Battery Pack
Use another piece of mounting tack to secure the battery pack holder next to the circuit playground. Make sure the switch is facing up and accessible.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum