Overview

Dreidel is a traditional game played by families every year during the Jewish holiday of Hanukkah. The dreidel itself is a four-sided top with a Hebrew letter on each side. The game is similar to dice. You spin the dreidel, and the letter on the side facing up tells you whether you get to take game pieces out of the pot, or have to put pieces in. You can play for any kind of small tokens, but at my house we always use chocolate gelt, or foil-wrapped coins.

This Mystery Dreidel has a Circuit Playground Express (CPX) inside to add even more suspense! The sides are unmarked, so you won't know what letters are spinning by until it stops. Then the accelerometer built into the CPX microcontroller board senses which way it's pointing, plays appropriate music, and flashes lights through the cut-out letters on the sides to show which face is up. To make it extra festive, when you first turn it on, the CPX plays the chorus of the Dreidel Song. (You can make it play again by turning the dreidel upside down.)

The dreidel is easy to build from cereal box cardboard, and the programming is a snap using MakeCode. This guide includes a PDF template to help you cut out cardboard pieces and sample code so you can get up and running in no time.

Parts List -- Electronics

The Circuit Playground Express is the only electronic part in this project, along with the things you need to make it run, like a USB cable and a battery pack. If your battery pack has a belt clip (like the one that comes in the CPX base kit), you can make a slot in the cardboard CPX holder instead of gluing it on.

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

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

3 x AAA Battery Holder with On/Off Switch and 2-Pin JST

PRODUCT ID: 727
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects. We spec'd these out because the box is slim, and 3 AAA's add up to about...
$1.95
IN STOCK

Materials List -- Household and Crafts Supplies

Other supplies you will need include:

  • thin sturdy cardboard, about 8 1/2 by 11 inches (see Make the Dreidel for how to cut the parts)
  • push pin
  • pencil or pen
  • clear tape (packing tape is extra strong)
  • sturdy drinking straw, preferably white (fat plastic milkshake straws work well)
  • adhesive dots -- extra strength is best
  • peel-and-stick Velcro dots
  • hot glue gun
  • white copy paper
  • glue stick or spray-on glue

Make the Dreidel

Cut Out the Cardboard Parts

You'll need to cut out three cardboard parts to make the dreidel: the body, the lid, and the separate CPX holder. You can measure and cut them freehand, or print out the PDF template below onto copy paper and trace it onto some stiff cardboard. You can also adapt the template to use with a programmable cutter, if you have one.

Make the Body

The body of the dreidel is made up of a cube around the middle and an upside-down square pyramid on the bottom. The cube is 2 1/2 inches on each side (the length of the battery case, so it fits snugly inside). The pyramid is 2 1/8 inch high. If you are tracing the template onto your cardboard, cut around the shapes shown in gray, then skip down to the directions for cutting the letters out of the sides.

Measuring and Cutting the Body Freehand

If you want to make the dreidel freehand, measure and cut the whole body out of a piece of cardboard 10 1/4 inches wide (the width of the four squares that make up the middle, plus a little extra for a tab) and 4 5/8 inches high.

In the photo at the top of the page, I lined up the fold line between the cube and the pyramid with a fold in the cereal box cardboard. Next, I drew lines to show the edges between the cubes (not visible in the photo). Then I made marks along the bottom, in the center of each cube, to show the point of each triangle that makes up the pyramid and drew lines to connect the point to the edges of the cubes.

Make the Cut-Out Letters

The Hebrew letters nun, gimel, hey, and shin on the side of the dreidel stand for the Yiddish words that tell the player what to do. Here is what they look like and what they signify in the game:

The letter Nun stands for nisht or “nothing.” Player does nothing.

 

Gimel stands for gantz or “everything.” Player gets everything in the pot.

 

Hey means halb or “half.” Player gets half the pot (rounding up if there's an odd number).

 

Shin is for shtel ayn or “put in.” Player adds a game piece to the pot.

You need to cut the letters out of the sides of the dreidel to let the CPX lights inside shine through.

Draw or trace the letters on the sides of the dreidel in the order shown on the template above.

An easy way to cut them out by hand is to poke holes with a push pin all along the line.

 

Then use a pen or pencil to punch out the letters until the openings are wide enough to let light through.

Fold and Close Up the Body

Fold the middle of the body along the dotted lines between each square, as shown on the template. The blank side of the cardboard faces out. Fold each triangle along the bottom of each square in the same direction.

 

To make the pyramid bottom, match up the sides of the first and second triangles and tape them together. Continue all the way around. The tabs go inside the dreidel.

Use extra layers of tape if needed to seal up any cracks between the edges.

Make the Lid and Handle

The lid is a 2 1/2 inch square with tabs around three sides. In the center is a hole for the straw which acts as a handle.

Fold up the tabs on the sides of the lids. (Unlike my prototype, you should keep the blank side of the cardboard on the outside.)

Use the template to locate the hole for the straw, or draw two lines connecting opposite corners of the square lid to find the center.

Use a pen or pencil to poke a hole for the straw. Make it just big enough for your straw to fit through.

Cut a piece of straw about 3 inches long. Make four short snips around the bottom. Fold out the resulting tabs.

Insert the straw through the hole so the tabs are on the underside of the lid. Tape the tabs securely to the lid.

Attach the Lid

Use generous amounts of tape to attach the lid firmly to the body of the dreidel.

Then attach peel-and-stick Velcro dots around the outside of the tabs, and the inside of the body, to keep the lid closed when you are spinning it.

Important: Attach the lid to the Hey side of the dreidel.

Finish the Body

All that's left for the dreidel build is to reinforce the tip and cover the letters.

The CPX and battery pack adds a lot of weight to the dreidel, so beef up the tip by filling it with hot glue. Just squirt some glue as far down as you can reach and let it harden. I used about one small-sized stick of glue.

 

To make a cover for the dreidel to hide the letter cut-outs, cut a strip of plain white paper 2 1/2 inches high and about 10 1/4 inches long. Fold it in half, then fold each half in half so the edges meet in the middle.

 

Use a glue stick or spray-on glue to attach the paper to the dreidel. Wrap the strip of paper around the middle, keeping it as smooth as possible.

Add the Electronics

The electronics for the Mystery Dreidel are attached to a separate cardboard CPX holder. The holder is the length of two squares, the same size as the sides of the cube section of the dreidel body. One half has a window cut out of it to allow the lights to shine through that side of the dreidel. It also serves as a handle so you can slide the electronics in and out of the dreidel easily.

To assemble the electronics, plug the battery pack into CPX.

 

Stick an adhesive dot on the back of the CPX. Attach it to the top of the battery pack (the side with the On/Off switch).

 

Use another adhesive dot to glue the battery pack to the bottom of the CPX holder. Make sure it is centered!

To keep the dreidel balanced as it spins, you may want to add some weight to either side of the battery pack. I used additional adhesive dots to attach a battery to each side.

 

Hold the back flap like a handle and insert the CPX holder into the dreidel. It should sit level on the bottom of the middle cube portion of the body.

 

Also check that you can see the cut-out letter (Hey) through the window in the back of the CPX holder.

Note: You should be able to slide open the battery case to change the batteries without detaching it from the CPX holder.

Program It in MakeCode

You're ready to program your dreidel with Microsoft MakeCode! If you're new to using MakeCode with the CPX, you can download the sample program below to get started. Look it over as you read through the description below to see how it was put together.

Then, when you get the hang of it, you can personalize the code to make a unique Mystery Dreidel.

To find out more, check out the Adafruit MakeCode Guide.

Breaking Down the Code

It may look like there's a lot of stuff on the screen, but don't let it scare you. There are only a few different things happening:

  • A stack of code runs as soon as you start the CPX up that sets the volume and the brightness of the lights, runs a light animation, and plays the Dreidel Song (the part that goes "Dreidel, dreidel, dreidel/I made it out of clay/And when it's dry and ready/Then dreidel I will play").
  • For each of the four directions the CPX can tilt -- up, down, left, or right -- there is a stack of code that tells the lights on that side to flash in a different color, and play a different pre-made sound.
  • A separate stack of code lets you play the Dreidel Song and a different light animation by turning the dreidel upside down (so the CPX is face down).
  • Two pieces of code let you turn the sound off (so just the light animations run) when the slide switch on the CPX is pushed to the left and turn it back on by pushing the switch to the right.

Here's a little more detail and a few helpful tips:

Adjust the Settings

To adjust the default settings on the CPX, grab a set volume block from the MUSIC menu and a set brightness block from the LIGHT Menu.

Mouse over the white ovals to open up a slider that lets you set them where you like.

Since the CPX is hidden inside the dreidel, you'll probably want to raise them both.

Create Your Own Light Animations

Designing your own lighting effects is easy. Just grab a show ring block from the LIGHT Menu, click on the color you want, and then click on the pixel you want to turn on (or grey to turn the light off). Stack the blocks to make the lights change. 

 

For the dreidel program, to flash the lights closest to the side facing up, turn on only the lights on that half of the CPX.

In other words, for the on tilt down block, the lights on the bottom of the CPX will flash blue, then white, then blue again. The clear block turns all the lights off so the CPX is ready for the next spin.

Add Comments

With so much going on, it's hard to see which stack of code goes with each section of the dreidel. Keep track by sticking a comment on your code.

 

Just right click on any stack of code and click "Add Comment" on the list that pulls down. Then type your notes in the pop-up box so you know what's what.

Write Strings of Musical Notes

You may have created your own short tunes by stacking up a few play tone at blocks. They are handy because mousing over the white oval opens up a keyboard with three octaves of notes (Low, Middle, and High).

However, there's a shortcut called a string that lets you write out notes by name. It's a lot quicker and takes up less space.

To create a string of notes, start with a regular play sound [  ] until done block from the MUSIC menu. You will replace the oval that has the pull-down menu of pre-made melodies with a blank oval you can type in.

To do that, first you need to click on the Advanced label and several additional categories of menus will appear. Then click on TEXT and grab an empty text oval. Drag it over the existing oval in the play sound [  ] until done block and it should click in. 

Then type in your notes. They are written in the format [name of note] : [number of beats]. The notes are in the Middle Octave unless you add "Low" or "High" in between. So a half-note in Middle C (two beats) is written C:2. And a High D whole note (four beats) is D:High:4.

Play Lights and Music at the Same Time

When you spin the dreidel and it lands on one side, you want the dreidel to light up and play music at the same time. If you just stack up the light and music blocks, the CPX will do one before it starts the next.

 

To tell the CPX to do both simultaneously, you can use a run in parallel block from the CONTROL menu. (Also found by clicking Advanced in the list of menus.)

 

In these examples, I've put the light blocks inside the "mouth" of the run in parallel block. Then it will flash the lights while also playing the music blocks that come after it.

Have Fun!

There are some advanced concepts used in this program, but you don't need to get fancy with MakeCode to create awesome effects. And you don't need to limit your ideas to the Mystery Dreidel. See what other spinning CPX ideas you can come up with!

This guide was first published on Dec 03, 2018. It was last updated on Dec 03, 2018.