# Mason Jar Snow Globe

## Shiny Snow Globe!

https://youtu.be/sYFIDvd1HEE

It's the holidays and you need a colorful snowglobe to cheer up. No worries, MakeCode and Adafruit Circuit Playground Express are here to cheer you up.

In this project, we will use the 10 NeoPixels of the Circuit Playground Express to light up a DIY snowglobe. For the body of the globe we'll use an every day mason jar, you can find these in your hardware or grocery store. 

Sounds simple? Let's do it.

## Materials

Pick a jar and an **extra lid** to build the snow globe. The extra lid should be large enough to hold the Circuit Playground Express. You will also need a tool to cut into the lid and a glue gun.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/243/medium800/makecode_IMG_7347.jpg?1513122887)

## Building the base

Place the Circuit Playground Express inside the lid and mark both sides for the JST and USB connectors. Cut out openings and make sure you can squeeze the cables in. The lid will sit **under** the jar which will keep the CPX nicely away from the water.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/244/medium800/makecode_IMG_7348.jpg?1513123125)

## Connect the globe

Build your favorite snow globe using one of the gazillion tutorial online. I just used water, gliceryn and glitter. When you're done, use glue to secure the lib to the bottom.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/245/medium800/makecode_IMG_7350.jpg?1513123184)

## Unplugging...

Once the glue is solidified, you can carefully "unplug" it from the lid. It is now molded/casted to the lid and easily sits on it. Since water and electronics don't work well together, it's easier to keep the Circuit Playground Express while working on the liquid part of the globe...

## Pro tip: Automatic stirring

Dip a Playmobil underwater motor in your globe to keep these glitter particles moving!


https://youtu.be/dws_x2oKeq0

# Mason Jar Snow Globe

## Light show

An easy way to get started is to run a bunch of animation in a forever loop. Go to https://makecode.adafruit.com and drag various animations from the **LIGHT** drawer. Download the code to your board and voila!

https://makecode.com/_MEcd9eJuW5dd

# Mason Jar Snow Globe

## Clap clap

We would like to be able to turn on and off the light easily. The board is tucked under the globe so buttons or gestures are not really doable... which leaves us with the microphone!!!

Using the **on loud sound**, we switch the animation on and off. We use a variable **on** to keep track of the animation state (true = on, false = off).

When the variable **on** turns false, we cancel the current animation and clear the LEDs. The **forever** loop keeps running in the background but only animations when **on** is true.

https://makecode.com/_2kb0b4bpFg8K


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/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 made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Circuit Playground Express - Base Kit

[Circuit Playground Express - Base Kit](https://www.adafruit.com/product/3517)
It's the **Circuit Playground Express Base Kit!** &nbsp;It provides&nbsp;the few things you'll need to get started with the new [Circuit Playground Express](https://www.adafruit.com/product/3333).&nbsp;This version of Circuit Playground is super powered, and will...

In Stock
[Buy Now](https://www.adafruit.com/product/3517)
[Related Guides to the Product](https://learn.adafruit.com/products/3517/guides)
### DIY Snow Globe Kit

[DIY Snow Globe Kit](https://www.adafruit.com/product/3722)
Not merely a snow globe, but a _show_ globe! This custom container is durable, clear and round, with a large flat screw-on top and a press-fit rubber stopper. The stopper makes a nice seal, and is also _hollow_ which means you can put (you guessed it...) electronics inside! This...

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

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [NYE Circuit Playground Drop](https://learn.adafruit.com/nye-circuit-playground-drop.md)
- [MicroBlocks Circuit Playground Express Ornament](https://learn.adafruit.com/microblocks-circuitplayground-express-ornament.md)
- [CPX Glowing Disembodied Hand](https://learn.adafruit.com/cpx-glowing-disembodied-hand.md)
- [Glowing Slime Lunchbox](https://learn.adafruit.com/glowing-slime-lunchbox.md)
- [Datalogging and File Storage in MakeCode](https://learn.adafruit.com/data-logging-and-file-storage-in-makecode.md)
- [Compost Friend!](https://learn.adafruit.com/compost-optimization-machine.md)
- [3D Printed Dragon Lamp](https://learn.adafruit.com/dragon-lamp.md)
- [AdaBox 006](https://learn.adafruit.com/adabox006.md)
- [Using MCP23008 & MCP23017 with CircuitPython](https://learn.adafruit.com/using-mcp23008-mcp23017-with-circuitpython.md)
- [Cartoon Network MakeCode: Garnet's Gauntlets from Steven Universe](https://learn.adafruit.com/cartoon-network-makecode-garnets-gauntlets-from-steven-universe.md)
- [Pushrod Garage](https://learn.adafruit.com/pushrod-garage.md)
- [Make It Switch](https://learn.adafruit.com/make-it-switch.md)
- [Fireflies with MakeCode](https://learn.adafruit.com/circuit-playground-fireflies-makecode.md)
- [Magical Cardboard Craft Obsidian Sword](https://learn.adafruit.com/cardboard-obsidian-sword.md)
- [UART Communication Between Two CircuitPython Boards](https://learn.adafruit.com/uart-communication-between-two-circuitpython-boards.md)
