# RGB Matrix Dreidel Game

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/106/505/medium800/led_matrices_edited_P1310837.png?1636990163)

In this project, you can build your own electronic dreidel game, complete with a servo motor and festive music, to celebrate Hanukkah. To play, drop chocolate coins into the slot at the top of the matrix. The RGB matrix will spin the dreidel while playing the classic dreidel song. If you roll gimel, you win! All of the chocolate coins will spill out for you.

An IR breakbeam sensor is located at the top of the matrix to detect when a chocolate coin is dropped. This triggers the dreidel to spin.

![led_matrices_edited_P1310842.png](https://cdn-learn.adafruit.com/assets/assets/000/106/506/medium640/led_matrices_edited_P1310842.png?1636990221)

A servo motor is attached to the chocolate coin cup. The servo tilts the cup when the dreidel sprite sheet lands on gimel.

![led_matrices_edited_P1310845.png](https://cdn-learn.adafruit.com/assets/assets/000/106/537/medium640/led_matrices_edited_P1310845.png?1637069274)

A STEMMA speaker plays the dreidel song while the RGB matrix spins the dreidel.

![led_matrices_edited_P1310839.png](https://cdn-learn.adafruit.com/assets/assets/000/106/507/medium640/led_matrices_edited_P1310839.png?1636990257)

If you've ever played dreidel before, you'll note that this version is slightly modified since it doesn't account for rolling hei to get half of the pot. A servo dumping out the entire pot when you roll gimel should hopefully make up for that though.

## Parts

This project has a couple of different way to wire up the audio depending on the microcontroller that you are using.

Featured
### Adafruit Matrix Portal - CircuitPython Powered Internet Display

[Adafruit Matrix Portal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4745)
Folks love our [wide selection of RGB matrices](https://www.adafruit.com/category/327) and accessories, for making custom colorful LED displays... and our RGB Matrix Shields and FeatherWings can be quickly soldered together to make the wiring much easier. But what if we made it...

In Stock
[Buy Now](https://www.adafruit.com/product/4745)
[Related Guides to the Product](https://learn.adafruit.com/products/4745/guides)
![Video of a person rotating an LED matrix panel with animation resembling falling colored sand.](https://cdn-shop.adafruit.com/product-videos/640x480/4745-05.jpg)

Featured
### 32x32 RGB LED Matrix Panel - 5mm Pitch

[32x32 RGB LED Matrix Panel - 5mm Pitch](https://www.adafruit.com/product/2026)
Bring a little bit of Times Square into your home with this sweet 32 x 32 square RGB LED matrix panel. These panels are normally used to make video walls, here in New York we see them on the sides of busses and bus stops, to display animations or short video clips. We thought they looked...

In Stock
[Buy Now](https://www.adafruit.com/product/2026)
[Related Guides to the Product](https://learn.adafruit.com/products/2026/guides)
![Video of assembled and powered on 32x32 RGB LED Matrix Panel - 5mm pitch. The matrix displays swirling, psychedelic rainbow colors.](https://cdn-shop.adafruit.com/product-videos/640x480/2026-04.jpg)

Featured
### IR Break Beam Sensor with Premium Wire Header Ends - 5mm LEDs

[IR Break Beam Sensor with Premium Wire Header Ends - 5mm LEDs](https://www.adafruit.com/product/2168)
Infrared (IR) break-beam sensors are a simple way to detect motion. They work by having an emitter side that sends out a beam of human-invisible IR light, then a receiver across the way which is sensitive to that same light. When something passes between the two, and its not transparent to IR,...

In Stock
[Buy Now](https://www.adafruit.com/product/2168)
[Related Guides to the Product](https://learn.adafruit.com/products/2168/guides)
![Two wired modules with LEDs and mounting holes](https://cdn-shop.adafruit.com/640x480/2168-04.jpg)

Featured
### Micro Servo with 3-pin JST PH 2mm Cable - TowerPro SG92R

[Micro Servo with 3-pin JST PH 2mm Cable - TowerPro SG92R](https://www.adafruit.com/product/4326)
This tiny little servo can rotate approximately 180 degrees (90 in each direction), and works just like the standard kinds you're used to but&nbsp;_smaller_. You can use any servo code, hardware or library to control these servos. Good for beginners who want to make stuff move...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4326)
[Related Guides to the Product](https://learn.adafruit.com/products/4326/guides)
![Angled shot of a micro servo with a JST cable.](https://cdn-shop.adafruit.com/640x480/4326-00.jpg)

Featured
### JST PH 2mm 3-Pin Socket to Color Coded Cable - 200mm

[JST PH 2mm 3-Pin Socket to Color Coded Cable - 200mm](https://www.adafruit.com/product/4046)
This cable will let you turn a JST PH 3-pin cable _socket_ into 3 individual tinned wires. These are great to match up with our JST 3-PH cables, for extending and connecting sensors or LEDs, and the wires are even color coded!

[We...](https://www.adafruit.com/product/3893)

In Stock
[Buy Now](https://www.adafruit.com/product/4046)
[Related Guides to the Product](https://learn.adafruit.com/products/4046/guides)
![Angled shot of JST PH 3-Pin Socket to Color Coded Cable - 200mm](https://cdn-shop.adafruit.com/640x480/4046-02.jpg)

Featured
### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
![LED RGB matrix 10.2" x 5.1" with "Adafruit Industries LED Matrix" text showing, and LED acrylic slowly covering to make it nicely diffused](https://cdn-shop.adafruit.com/product-videos/640x480/4749-02.jpg)

Featured
### Official Raspberry Pi Power Supply 5.1V 3A with USB C

[Official Raspberry Pi Power Supply 5.1V 3A with USB C](https://www.adafruit.com/product/4298)
The official Raspberry Pi USB-C power supply is here! And of course, we have 'em in classic Adafruit black! Superfast with just the right amount of cable length to get your Pi 4 projects up and running!

Best for use with Pi 4 series, [Pi...](https://www.adafruit.com/product/5814)

Out of Stock
[Buy Now](https://www.adafruit.com/product/4298)
[Related Guides to the Product](https://learn.adafruit.com/products/4298/guides)
![Angled shot of Official Raspberry Pi Power Supply 5.1V 3A with USB C with Power plug facing down. ](https://cdn-shop.adafruit.com/640x480/4298-04.jpg)

Featured
### Black Nylon Machine Screw and Stand-off Set – M3 Thread

[Black Nylon Machine Screw and Stand-off Set – M3 Thread](https://www.adafruit.com/product/4685)
Totaling **420 pieces** , this **M3 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M3 size screws fit a number of&nbsp;Adafruit breakout/dev board...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4685)
[Related Guides to the Product](https://learn.adafruit.com/products/4685/guides)
![Opened box showing many nylon screws](https://cdn-shop.adafruit.com/640x480/4685-01.jpg)

### Part: M2 Screws
quantity: 1
M2 hardware
[M2 Screws](https://www.amazon.com/Hilitchi-300-Piece-Phillips-Assortment-stainless/dp/B01NBOD98K/)

### Part: Package of chocolate coins
quantity: 1
Chocolate coins aka gelt to play dreidel
[Package of chocolate coins](https://www.target.com/p/palmer-gifts-of-hanukkah-milk-chocolate-coins-1-5oz/-/A-80021401)

### Audio Amplifier Version

This version of the project uses the STEMMA Speaker, making it easy to hook up and is suitable for use with the MatrixPortal M4.

Featured
### Adafruit STEMMA Speaker - Plug and Play Audio Amplifier

[Adafruit STEMMA Speaker - Plug and Play Audio Amplifier](https://www.adafruit.com/product/3885)
Hey, have you heard the good news? With Adafruit STEMMA boards you can easily and safely plug sensors and devices together, like this **Adafruit STEMMA Speaker - Plug and Play Audio Amplifier**. Like the name implies, it's got a class D audio amplifier on board, and our...

In Stock
[Buy Now](https://www.adafruit.com/product/3885)
[Related Guides to the Product](https://learn.adafruit.com/products/3885/guides)
![Top view of a black speaker breakout board connected to a round microcontroller via alligator clips. A music note animation emits from the speaker.](https://cdn-shop.adafruit.com/product-videos/640x480/3885-05.jpg)

Featured
### JST PH 2mm 3-pin Plug-Plug Cable - 100mm long

[JST PH 2mm 3-pin Plug-Plug Cable - 100mm long](https://www.adafruit.com/product/4336)
This cable is a little over 100mm / 4" long&nbsp;and fitted with JST-PH 3-pin connectors on either end.&nbsp;

We dig the solid and compact nature of these connectors and the latch that keeps the cable from coming apart easily. We're carrying these to <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4336)
[Related Guides to the Product](https://learn.adafruit.com/products/4336/guides)
![Angled shot of JST PH 3-pin Plug-Plug Cable - 100mm long.](https://cdn-shop.adafruit.com/640x480/4336-01.jpg)

### I2S Audio Version

This version of the project uses the MAX98357 and a speaker and is suitable for use with the microcontrollers with only I2S audio such as the ESP32-based boards.

Featured
### Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A

[Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A](https://www.adafruit.com/product/3006)
Listen to this good news - we now have an all in one digital audio amp breakout board that works incredibly well with the&nbsp;[Raspberry Pi](https://www.adafruit.com/category/105)! If you're looking for an easy and low cost way to get your digital sound files...

In Stock
[Buy Now](https://www.adafruit.com/product/3006)
[Related Guides to the Product](https://learn.adafruit.com/products/3006/guides)
![Angled shot of blue, square-shaped, amplifier breakout with a pre-soldered terminal block.](https://cdn-shop.adafruit.com/640x480/3006-04.jpg)

Featured
### Mini Oval Speaker - 8 Ohm 1 Watt

[Mini Oval Speaker - 8 Ohm 1 Watt](https://www.adafruit.com/product/3923)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

In Stock
[Buy Now](https://www.adafruit.com/product/3923)
[Related Guides to the Product](https://learn.adafruit.com/products/3923/guides)
![Small, black, oval speaker with Pico Blade connector.](https://cdn-shop.adafruit.com/640x480/3923-06.jpg)

Featured
### Premium Male/Male Jumper Wires - 20 x 12" (300mm)

[Premium Male/Male Jumper Wires - 20 x 12" (300mm)](https://www.adafruit.com/product/1955)
These Male/Male Jumper Wires are handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 12" (300mm) long and come in a 'strip' of 20 (2 pieces of each of ten rainbow colors). They have 0.1" male header contacts on either end...

In Stock
[Buy Now](https://www.adafruit.com/product/1955)
[Related Guides to the Product](https://learn.adafruit.com/products/1955/guides)
![Premium Male/Male Jumper Wires - 20 x 12 (300mm) folded over](https://cdn-shop.adafruit.com/640x480/1955-02.jpg)

- [Next Page](https://learn.adafruit.com/rgb-matrix-dreidel-game/circuit-diagram.md)

## Guide Products

### Adafruit Matrix Portal - CircuitPython Powered Internet Display

[Adafruit Matrix Portal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4745)
Folks love our [wide selection of RGB matrices](https://www.adafruit.com/category/327) and accessories, for making custom colorful LED displays... and our RGB Matrix Shields and FeatherWings can be quickly soldered together to make the wiring much easier. But what if we made it...

In Stock
[Buy Now](https://www.adafruit.com/product/4745)
[Related Guides to the Product](https://learn.adafruit.com/products/4745/guides)
### 32x32 RGB LED Matrix Panel - 5mm Pitch

[32x32 RGB LED Matrix Panel - 5mm Pitch](https://www.adafruit.com/product/2026)
Bring a little bit of Times Square into your home with this sweet 32 x 32 square RGB LED matrix panel. These panels are normally used to make video walls, here in New York we see them on the sides of busses and bus stops, to display animations or short video clips. We thought they looked...

In Stock
[Buy Now](https://www.adafruit.com/product/2026)
[Related Guides to the Product](https://learn.adafruit.com/products/2026/guides)
### IR Break Beam Sensor with Premium Wire Header Ends - 5mm LEDs

[IR Break Beam Sensor with Premium Wire Header Ends - 5mm LEDs](https://www.adafruit.com/product/2168)
Infrared (IR) break-beam sensors are a simple way to detect motion. They work by having an emitter side that sends out a beam of human-invisible IR light, then a receiver across the way which is sensitive to that same light. When something passes between the two, and its not transparent to IR,...

In Stock
[Buy Now](https://www.adafruit.com/product/2168)
[Related Guides to the Product](https://learn.adafruit.com/products/2168/guides)
### Micro Servo with 3-pin JST PH 2mm Cable - TowerPro SG92R

[Micro Servo with 3-pin JST PH 2mm Cable - TowerPro SG92R](https://www.adafruit.com/product/4326)
This tiny little servo can rotate approximately 180 degrees (90 in each direction), and works just like the standard kinds you're used to but&nbsp;_smaller_. You can use any servo code, hardware or library to control these servos. Good for beginners who want to make stuff move...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4326)
[Related Guides to the Product](https://learn.adafruit.com/products/4326/guides)
### JST PH 2mm 3-Pin Socket to Color Coded Cable - 200mm

[JST PH 2mm 3-Pin Socket to Color Coded Cable - 200mm](https://www.adafruit.com/product/4046)
This cable will let you turn a JST PH 3-pin cable _socket_ into 3 individual tinned wires. These are great to match up with our JST 3-PH cables, for extending and connecting sensors or LEDs, and the wires are even color coded!

[We...](https://www.adafruit.com/product/3893)

In Stock
[Buy Now](https://www.adafruit.com/product/4046)
[Related Guides to the Product](https://learn.adafruit.com/products/4046/guides)
### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
### Official Raspberry Pi Power Supply 5.1V 3A with USB C

[Official Raspberry Pi Power Supply 5.1V 3A with USB C](https://www.adafruit.com/product/4298)
The official Raspberry Pi USB-C power supply is here! And of course, we have 'em in classic Adafruit black! Superfast with just the right amount of cable length to get your Pi 4 projects up and running!

Best for use with Pi 4 series, [Pi...](https://www.adafruit.com/product/5814)

Out of Stock
[Buy Now](https://www.adafruit.com/product/4298)
[Related Guides to the Product](https://learn.adafruit.com/products/4298/guides)
### Black Nylon Machine Screw and Stand-off Set – M3 Thread

[Black Nylon Machine Screw and Stand-off Set – M3 Thread](https://www.adafruit.com/product/4685)
Totaling **420 pieces** , this **M3 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M3 size screws fit a number of&nbsp;Adafruit breakout/dev board...

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

## Related Guides

- [Adafruit MAX98357 I2S Class-D Amps - Stereo and Mono](https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp.md)
- [Adafruit STEMMA Speaker](https://learn.adafruit.com/adafruit-stemma-speaker.md)
- [Adafruit MatrixPortal M4](https://learn.adafruit.com/adafruit-matrixportal-m4.md)
- [Walkmp3rson: Personal MP3 'Tape' Player](https://learn.adafruit.com/walkmp3rson-personal-mp3-tape-player.md)
- [Matrix Portal Stained Glass with WLED](https://learn.adafruit.com/matrix-portal-stained-glass-with-wled.md)
- [MEMENTO Wireless Remote with TouchOSC](https://learn.adafruit.com/memento-wireless-remote.md)
- [Raspberry Pi Thermal Camera](https://learn.adafruit.com/raspberry-pi-thermal-camera.md)
- [LED Rocket Lamp](https://learn.adafruit.com/led-rocket-lamp.md)
- [FunHouse 3D Printed Stand](https://learn.adafruit.com/funhouse-3d-printed-stand.md)
- [Adafruit Voice Bonnet](https://learn.adafruit.com/adafruit-voice-bonnet.md)
- [TRON DISC](https://learn.adafruit.com/trondisc.md)
- [Square NeoPixel Display with Black LED Acrylic](https://learn.adafruit.com/sqaure-neopixel-display-with-black-led-acrylic.md)
- [LED Matrix Wall Arcade for Pico-8](https://learn.adafruit.com/led-matrix-wall-arcade.md)
- [IoT Bird Feeder with Camera](https://learn.adafruit.com/iot-window-bird-feeder-with-camera.md)
- [Creating MatrixPortal Projects with CircuitPython](https://learn.adafruit.com/creating-projects-with-the-circuitpython-matrixportal-library.md)
- [Lightsaber Prop-Maker RP2040](https://learn.adafruit.com/lightsaber-rp2040.md)
- [Image Correction for RGB LED Matrices](https://learn.adafruit.com/image-correction-for-rgb-led-matrices.md)
- [USB Host to BLE Keyboard Adapter](https://learn.adafruit.com/esp32-s3-usb-to-ble-keyboard-adapter.md)
