Maker.io main logo

Crickit Powered Dancin' Snowman!

2018-12-20 | By Maker.io Staff

License: See Original Project Circuit Playground

How about getting into the holiday season creating a snowman that dances to holiday music? This snowman does not require any snow and will dance with just the touch of his magic hat. You will also need some parts, Microsoft MakeCode, and instructions from our friends at Adafruit.

Courtesy of Adafruit

Guide by Isaac Wellish

Overview

We don't need any snow to build this awesome snowman.

We just need some foam balls, stiff wire, festive decorations, a Circuit Playground Express (CPX) with CRICKIT, a servo motor and some extra electronic goodies.

To make this snowman dance, just touch the top of his hat! This triggers a servo in his belly that moves his body around.

This guide will show how to program this groovy guy using Microsoft MakeCode, an easy to use block-based programming system.

 

Prerequisite Guides

Reading or at least skimming through these guides before beginning will help you understand this build. You can always refer back to them if you need help.

Adafruit Parts

Optional but recommended:

Tools and Materials

  • 3 white foam balls: roughly sized 13 cm, 10 cm, and 7 cm in diameter (found at craft stores)
  • Thick wire (around 16 gauge - found at craft stores)
  • Medium to large width corrugated cardboard - need at least 1 sheet sized 18 x 18 cm
  • Black foam sheet
  • Orange model magic (for carrot nose)
  • Black rhinestones (for eyes and mouth)
  • Black buttons
  • A couple small twigs
  • Pencil
  • Ruler
  • Scissors
  • Hot glue gun + a couple glue sticks
  • Aluminum foil
  • Glue stick
  • Wire cutter (for cutting and bending wire)

Wiring ElectronicsWiring Electronics

Attach the CPX (Circuit Playground Express) to the Crickit following this guide.

Attach the CPX to the Crickit following this guide

  • Attach an alligator clip to capacitive touch input A3 on the CPX.
  • Plug the servo into input 1 on the servo section on CRICKIT. Orient the leads such that the yellow wire is on the outside edge of CRICKIT.
  • For power use a 5V 2A (2000mA) switching power supply plugged into the 5V DC jack. When you want the project to run, please be sure the tiny on/off switch next to the CRICKIT's DC jack is on.

Programming with MakeCode

What is MakeCode?

MakeCode is a web-based code editor for physical computing made by Microsoft.

What does that mean for you? It means you can program your Circuit Playground Express to do almost anything you can dream up right from a website! You can code with blocks similar to the language Scratch, or you can do more advanced coding with Javascript. We'll be sticking to the block-based programming for this project.

More on MakeCode for Adafruit boards here.

Install the MakeCode CRICKIT Extension

Before we start programming, let's make sure you have the CRICKIT extension installed in MakeCode.

Detailed instructions on how to do that can be found in this guide.

Create a New Project with MakeCode

Head over to https://makecode.adafruit.com/ and create a new project.

Click the link below to access the code for this project.

Open this project's code in MakeCode

Create a New Project with MakeCode

What's going on the code above?

Code

In a forever loop, we set volume level to 140 then play "Deck the Halls" by calling the deckthehalls functions. The "forever" loop means this code block loops forever regardless of other events that happen in the code!

Code

"Deck the Halls" can be separated into 3 parts. The song starts with part 1, then repeats, then goes to parts 2 and 3. Creating functions for these song parts then "calling" the functions later allows us to have much cleaner looking and more organized code. It also allows us to reduce the amount of code needed for the project making the program more efficient!

Code

When capacitive touch input A3 on the CPX is touched, we want to move the servo motor from 0 to 120 degrees, and back, 10 times fast to shake the snowman. Adding the 100ms of pause in between allows the servo to have enough time to move to each position.

Uploading the Code

Now that we have the code for the project, we need to upload it to the CPX.

Let's name our file and download it.

  • Choose a name at the bottom of the page.
  • Then click the pink Download button.

Note MakeCode adds a UF2 extension to the filename.

Follow the directions and connect your CPX to your computer via the USB cable. Click the CPX Reset button once to go into programming mode (all NeoPixels will turn green).

In some cases, you may need to press the reset button twice to get into programming mode.

Next, look for the UF2 file in your downloads folder and drag it onto your CPLAYBOOT drive that should have showed up in your file manager/finder when you plugged in your board and entered programming mode.

You should now see the CPLAYBOOT drive disappear, this means the code is running.

Power up CRICKIT

Connect CRICKIT to power with the 5V DC power cable and be sure the tiny on/off switch next to the black power input jack is on.

The code should now be running so try it out!

  • When the board is powered up, "Deck the Halls" should start playing.
  • When the end of the alligator clip is touched, the servo should quickly move back and forth for 1 - 2 seconds.

If you are having issues getting things to work check out this extended guide here.

Power up CRICKIT

Build the Snowman

Build the Snowman

Carving the foam body:

Carving the foam body:

Cut off about 5 mm from the bottom of the largest ball to give the ball a flat surface to sit up on.

Carving the foam body

Next cut the medium sized ball in half.

Carving the foam body

Then carve out the middle of each side of the medium sized ball.

Carving the foam body

Creating the servo pushing wire mechanism:

Creating the servo pushing wire mechanism

Cut about 36 cm of stiff wire with wire cutters.

Creating the servo pushing wire mechanism

Push bottom and top of medium sized ball through wire so they lie close to the middle.

Creating the servo pushing wire mechanism

Take off the top of the middle ball.

Creating the servo pushing wire mechanism

Place servo next to wire such that one of the arms is right up against the wire. Push the servo firmly into the foam to create an imprint.

Creating the servo pushing wire mechanism

Remove wire and glue servo in place.

Creating the servo pushing wire mechanism

Push wire back in place then use wire cutters or pliers to bend the wire around the servo arm.

Creating the servo pushing wire mechanism

Once the wire is shaped accordingly and there are equal parts wire above and below the servo (slightly more above is better), glue wire in place next to the servo.

Creating the servo pushing wire mechanism

Stick top of ball onto wire. Make sure servo cables are hanging out before glueing top down.

Forming the wire:

Forming the wire:

Bend one end of the wire at the top/bottom of the ball at a 90 degree angle towards the servo cables.

Forming the wire

Bend the same wire back the other way 90 degrees after about 1-2 cm.

Forming the wire

Repeat on other side.

Forming the wire

Stick on top and bottom balls. When putting on the large ball, make sure to orient such that the flat part we cut earlier is directly opposite to where the wire is inserted into.

Forming the wire

Cut a roughly 18 x 18 cm square of cardboard and white paper.

Forming the wire

Glue paper to cardboard.

Forming the wire

Forming the wire

Glue bottom of snowman in center of base.

Testing out the Snowman so far

Plug the servo into CRICKIT, and power up the board. Test out the snowman by touching A3 on the CPX. Quite a dance! I call it the Snowing Man :)

Troubleshooting

If you aren't getting much movement out of the snowman when A3 is touched:

  • Re-open the two halves of the snowman's middle section. Double check that one of the servo arms is right up against the wire and moving towards it.

If the snowman parts are moving around too much or spinning around:

  • Push the parts closer together indenting the wire into the foam.

Bring Him to Life!

Bring Him to Life!

Create the top hat parts:

Create the top hat parts

To create the hat top, on a sheet of black foam, draw two perpendicular lines 3 cm long going through the center of each other.

Create the top hat parts

Draw a circle around the plus sign.

Create the top hat parts

Next, to create the brim, draw a line 5 cm long. On this line, mark points at 0, 1, 2.5, 4, and 5 cm.

Create an identical line perpendicular to this one and running through its center.

Create the top hat parts

Draw a circle around the 0 and 5 cm points and 1 and 4 cm points.

To create the hat's base we must know the circumference of the hat top. Circumference = 2πr = 2 * (3.14) * 3 cm = 9.42 cm.

Create the top hat parts

Draw a rectangle 9.4 cm long and 4 cm high.

Cut out all components

Cut out all components.

*Hat created based off a 5cm diameter head. May need to modify measurements if head larger or smaller in size.

Assemble the hat:

Assemble the hat

Bend the base into a cylinder and glue ends together slightly overlapping.

Assemble the hat

Assemble the hat

Glue the brim to the base.

Assemble the hat

Glue on the top.

Assemble the hat

Cut off excess wire from top of snowman so hat fits just over the wire. The wire should be reaching just barely under the hat top.

Assemble the hat

Adding the snowman body and facial features:

Adding the snowman body and facial features

Mold the model magic into a carrot shape and glue onto snowman.

Adding the snowman body and facial features

Place 2 larger rhinestones onto snowman to make eyes.

Adding the snowman body and facial features

Place 5 smaller rhinestones onto snowman to make mouth.

Adding the snowman body and facial features

Glue 4 buttons onto snowman's chest and torso.

Adding the snowman body and facial features

Stick twigs into sides.

Adding the snowman body and facial features

Cut about 20 cm of ribbon for scarf and tie around neck.

Capacitive touch cap:

Capacitive touch cap

Cut 36 cm of copper tape.

Capacitive touch cap

Turn snowman around. Slowly peel off backing and stick onto snowman starting on the top of the hat, creasing down hat's base and brim and ending at the bottom of the snowman.

Capacitive touch cap

One a piece of aluminum foil, draw a circle with a 3 cm diameter.

Capacitive touch cap

Cut out circle.

Capacitive touch cap

Glue on hat top.

Add a shorter piece of copper tape on top of foil down onto the previous piece of copper tape along just the hat's length.

Capacitive touch cap

Use two pieces of copper tape to tape one end of the alligator clip to the bottom of the snowman. Be sure to tape the alligator clip on top of the first piece of tape.

Attach other end of alligator clip to A3 on CPX.

Plug servo into CRICKIT.

Power up CRICKIT, touch the top of his hat and watch him groooooooove!

Crickit Powered Dancin

Happy Holidays!!!

制造商零件编号 3333
CIRCUIT PLAYGROUND EXPRESS
Adafruit Industries LLC
¥203.09
Details
制造商零件编号 3093
CRICKIT CIRCUIT PLAYGROUND EXP
Adafruit Industries LLC
¥252.33
Details
制造商零件编号 169
SERVOMOTOR RC 5V TOWERPRO
Adafruit Industries LLC
¥53.52
Details
制造商零件编号 1008
TEST LEAD GATOR TO GATOR 15"
Adafruit Industries LLC
¥32.15
Details
制造商零件编号 276
AC/DC WALL MOUNT ADAPTER 5V 10W
Adafruit Industries LLC
¥64.71
Details
制造商零件编号 3025030-03
CBL USB2.0 A PLUG-MCR B PLUG 3'
Qualtek
¥32.64
Details
制造商零件编号 1128
RF EMI SHIELD TAPE 49.21'X0.236"
Adafruit Industries LLC
¥50.13
Details
制造商零件编号 3929
CANARY STAINLESS STEEL NON-STICK
Adafruit Industries LLC
¥107.47
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum