Engineers - Reinvent Your Career with Robotics in the Next 90 Days
Consult with Experts in our Career Advancement Program for the Experienced Engineer & Tech Professional. Gain clarity & community. Apply Now!

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Arduino Hanukkah Menorah (Full Tutorial)

Disclosure: Some of the links below are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase. Learn Robotics is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a way for websites to earn advertising revenues by advertising and linking to Amazon.com.

Liz Miller Learn Robotics

Attention: Engineer Looking for a New Career in Robotics

Liz here 👋, Engineer,  Robotics Expert & founder of this website.

If I offered to help you advance your 6-Figure+ Robotics, Automation, or AI Career with a $10,000 sign-on bonus in the next 90 days or less…

…without wasting time on unnecessary certifications…
…without studying another coding language or tactic…
…without needing to get another degree and wasting years…

…would you take me up on that offer?

LIMITED SPACE: I have 6 more client spots open this week!

Want a spot? Click the button to access my 12-min training below and then apply if it makes sense.

The holiday season is in full swing, and what better way to celebrate than with some robotics and prototyping! Regardless of what religion you believe in, these projects are designed to help you build technical and programming skills. We’ll be creating projects for celebrations around the world, so feel free to send us your holiday idea to info at www.learnrobotics.org.

The first holiday we’re going to celebrate is Hanukkah. Hanukkah is eight days long and starts December 2 through December 10th this year. Hanukkah is a Jewish holiday commemorating the rededication of the Second Temple in Jerusalem at the time of the Maccabean Revolt against the Seleucid Empire. You can read more about the religious celebration of Hanukkah here.

Create your own Arduino Hanukkah Menorah

For this project, you don’t have to know anything about Hanukkah except that we’ll be creating a Menorah. A Hanukkah Menorah is a type of candelabra that holds 9 candles. The center candle is called a Shamash. On either side of the Shamash there are four candles. Also, the Shamash is used to light the other candles. Finally, the candles are lit from right to left.

Why does this matter? We will use this information to develop both the hardware, and the software for the Menorah.

Wire Your Menorah on a Breadboard

First, let’s build the circuit for our Arduino Hanukkah Menorah. Here’s a wiring diagram for reference.

build a Hanukkah menorah using Arduino and LED's

You will need 8 blue LED’s, one white LED, 9 220-ohm resistors, one 10K-ohm resistor, one push button, some jumper wires, a breadboard, and an Arduino. You can pick up an I/O kit and an Arduino Uno, which has everything you need for this project. If you plan on doing additional Arduino projects, I recommend this kit because it includes a lot of modules for the price.

Remember to wire the LED’s with the correct polarity. The curved side will be plugged into a resistor, and the flat side will connect to ground.

If you’ve never wired a breadboard before, I recommend reading this overview first. Also, this tutorial assumes you have some basic experience with Arduino. If not, check out our Four Steps to Writing an Arduino Program before proceeding. We will not be setting up software in this tutorial.

Once your board is wired up, it’s time to write the program.

Write Code for the Arduino Menorah

Ideally, here’s how our Arduino Menorah will work.

When we press the button, the Shamash will light up and the first, right-most LED will turn on. Then as we press the button, subsequent lights will turn on from right to left. Finally, when we’ve reached the very last light (LED #8), and press the button again, the whole menorah will shut off.

We will use pins 2 through 10 to control the LED’s. The Shamash will be on pin 10. The button is connected to pin 12. Define some global variables to represent the pins. Then initialize the LED’s as OUTPUTS and the button as an INPUT. Next, begin the Serial monitor using the following code: Serial.begin(9600);

Now, we’re ready to create functionality for the Menorah. Because we’re using a button to turn on the LED’s, I recommend moving over the debouncing code. Copy the global variables and loop() method from the example Debounce code (File > Examples > Digital > Debounce).

Create a new method called lightMenorah() and paste the contents of loop() inside of it. We’re ready to modify this code. The Debounce code was written to control a single LED when the button is on (HIGH). We’ll change it so that when the button is HIGH, the Shamash is lit and then the first LED turns on. Here’s what the method looks like:

You’ll notice I created a counter so that we can illuminate the correct LED as the button is pressed. The main reason why the LED’s are plugged into consecutive pins, is to take advantage of the digitalWrite(pin, state) method. So, on each button click, we’ll increment the counter and light the “start” pin plus the counter. Then, when the counter hits 8, we’ll reset the counter to zero and shut off all of the LED’s.

We can control all of the LED’s using a digitalWrite(pin, state)inside of a “for” loop. Here’s an example of the allOff() method to shut off all the LED’s.

Lastly, call the lightMenorah() method in loop(), and test it out! Here’s a good reference if you’ve forgotten how to download code to your Arduino. I always recommend trying to write the code yourself, first before taking the answers. But if you’d like to compare your solution to mine, you can download the example code, below.

[pretty-locker id=”339508″]

Download Menorah Code Here (.ino)

If you enjoyed this tutorial, be sure to Share it with a Friend! Tag us in your photos on Facebook & Instagram (@learnrobotics). And, if you’re feeling festive, feel free to Buy us a Coffee for the Holidays!

 

Liz Miller Learn Robotics

Attention: Engineer Looking for a New Career in Robotics

Liz here 👋, Engineer,  Robotics Expert & founder of this website.

If I offered to help you advance your 6-Figure+ Robotics, Automation, or AI Career with a $10,000 sign-on bonus in the next 90 days or less…

…without wasting time on unnecessary certifications…
…without studying another coding language or tactic…
…without needing to get another degree and wasting years…

…would you take me up on that offer?

LIMITED SPACE: I have 6 more client spots open this week!

Want a spot? Click the button to access my 12-min training below and then apply if it makes sense.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Did this content help you? 🤖
...say thanks and send us a coffee!

Experience Engineers & Tech Pro’s:

Gain personalized guidance and direct mentorship from Liz in her Robotics Mentorship Program.

This 12-week professional advancement program will help you soar to the next level in your engineering career. My clients earn $100k+ with a $10k+ sign on bonus.

You’ll uncover strategies they *don’t* teach you in engineering school to help you earn more and live a meaningful life, all while working in high-impact robotics, automation, and AI roles.

Are you next? Check out the 12-min training I put together and then apply if it makes sense.

WHAT IS LEARN ROBOTICS?

Learn Robotics helps self-starters, hobbyists, and tech professionals get started in the robotics industry. 

We leverage a simple formula to make it easy to gain highly marketable and high-value 6-figure robotics & automation skills. 

Learn Robotics was founded by Robotics Engineer, Liz Miller, and leverages the Robotics Success Equation, our unique methodology that helps people learn to build robots while enhancing their careers for the future.

liz's featured robotics PROJECT ON YOUTUBE

Learn Robotics Botly Favicon

MORE LEARN ROBOTICS ARTICLES

glowing ghosts project using circuits STEM education electronics halloween diy
Liz Miller

Glowing Ghost Project for Halloween (DIY)

BOOOOOO! Scare your friends with this Glowing Ghost project using electronics and circuits. Using an electrical schematic, we’ll create a circuit that automatically lights up the ghost when it’s dark. Build yours today. Limited Glowing Ghost kits are available!

Read More »

Apply to Work with Liz in her Robotics Mentorship Program for Tech Professionals

Liz Miller Learn Robotics