Glowing LED Halloween Candy Bowl

by AGBarber in Circuits > LEDs

1500 Views, 3 Favorites, 0 Comments

Glowing LED Halloween Candy Bowl

Glowing LED Halloween Candy Bowl
PXL_20211023_222122540.jpg
Gif 1.gif
Gif 2.gif
Gif 3.gif
PXL_20211031_231317504.jpg
PXL_20211031_231219086.jpg
PXL_20211023_222130836.jpg
PXL_20211023_222033175.jpg

Looking to make your Halloween candy a bit more spooky and sparkly this year? Well I might have just the thing! While browsing online I stumbled across these LED string lights. It turns out that they use WS2812 addressable LEDs, which can easily be controlled via an Arduino/microcontroller. So you can easily hack the lights to use your own effect/colors. With Halloween being right around the corner I used them to spice up our candy bowl!

The best part about this project is that it's appropriate for pretty much all skill levels. The LED string comes with a controller attached, so if you don't want to get into the hacking and soldering, all you need to do is cut some tape. The default effects are a little basic, but they'll do in a pinch. While on the other side, although I provide the steps on how to make your own controller for the string, you can totally go your own way with a microcontoller of your choosing.

Note that you could also use WS2812 LED strips for this project. They are more expensive per foot/meter, but since most are adhesive-backed, they may be easier to apply to your bowl.

If you haven't worked with WS2812's before, they're pretty straight-forward, but I recommend reading Adafruit's guide for an overview.

If you have any questions at all please post a comment and I'll get back to you! :)

All code/files for the project can be found at my Github: here

Supplies

Basic Stuff:

  • 33ft, 100 LED RGB string light found here, but you might find it cheaper from other Amazon sellers or sources.
  • One large candy bowl. I used the one found here, but any large bowl should work. (Mine is about 11.25" Dia and 6" deep for reference)
  • Some Poly-Fil stuffing found here, you could also probably just use the fake cobweb stuff you can get for Halloween. This is to provide support for candy at the bottom the bowl/add a spooky cauldron feel, so the amount you'll need depends on how much candy you have.
  • Clear Scotch or packing tape.
  • One 5V power bank (unless using a wall adapter, see power below). The LEDs are fairly low powered, so most capacities should keep them up for the evening. I used a ~1000mah one.
  • Clear glass/plastic bowl. Optional, to place inside the candy bowl to separate the candy from the lights and stuffing. The size of the bowl will depend on your candy bow, but for mine, a 2.5L glass bowl fit well.

Custom Controller:

If you'd like to control the LEDs yourself, you'll either need to make your own controller, or use mine. As long as it's Arduino compatible, my code will probably work on it. To make my controller you'll need the following:

My controller uses a Wemos D1 Mini ESP8266 mounted on a custom PCB that I designed. You can find the PCB Gerber file at my Github: here. If you've never ordered a custom PCB before, it's easy. I briefly go over it in Step 2 of one of my other instructables here. As with that instructable, all the ordering defaults should be fine for this project.

If you are interested, you can view the PCB's layout and schematic here.

The controller is designed to fit into a 3D printed box, which you can find: here.

Electronic Parts:

(You might be able to find most of the parts for lower cost at places like Aliexpress, Ebay, Amazon, etc)

  • One Wemos D1 Mini V3. Found here.
  • One 19 x 6 x 13mm Slide Switch (these are pretty common, the actuator should be 4-5mm tall). Found here.
  • One JST-XH 2.5mm 3 Pin Male Connectors. Found here
  • One right angle JST-XH 2.5mm 3-Pin Female Connector. Found here.
  • Three JST-XH crimp terminals (although you should buy spares). Found here.
  • One pair of "waterproof" 3-Pin JST-SM connectors. Found here. (Optional)
  • One DC 3.5mm (1.35mm internal diam.) female connector. Found here.
  • Three 6x6x9mm tactile buttons. Found here.
  • One 74AHCT125 logic level converter. Found here.
  • One 1000uf, 10V electrolytic capacitor. Found here (somewhat optional)
  • Three of each 0805 size 100K resistor, 1K resistor, and 1uf capacitor. Found here, here, and here.
  • Two 4mm M2 screws (optional, for 3D-printed box)
  • Two 8mm M2 screws (optional for bowl grip)
  • Two M2 nuts (optional, for bowl grip)
  • Heat shrink for ~22Ga wire.

For Power:

You can power the controller either via a 5v wall adapter, or via a portable battery bank. The choice will depend on if you need your bowl to be portable or not.

For wall power you'll need One 5v 1A(min) wall adapter. You have a number of options for this. Ideally you'd find one with a 3.5mm DC jack, but those are uncommon. Most have a 2.1mm DC jack (like this one), so you'll need to buy an adapter down to 3.5mm (like these).

For a portable power bank you'll need one USB to 3.5mm DC jack cable, found here, and a power bank of your choosing, make sure it can do at least 1A out. 500-1000+ mah capacity should be fine.

Tools:

  • Scissors.
  • Soldering iron + solder.
  • Hot glue + hot glue gun.
  • Wire cutters and strippers.
  • Tweezers. (For soldering)
  • Crimper for JST terminals. Found here.
  • 3D printer + 1.75mm filament. (for control box, optional)

Adding Lights to the Bowl

PXL_20211021_220437260.jpg
PXL_20211021_220453649.jpg
PXL_20211021_220500065.jpg
PXL_20211021_220520416.jpg
PXL_20211021_220528494.jpg
PXL_20211021_220622503.jpg
PXL_20211021_220631066.jpg

Before you begin, you should unroll the LED string and flatten it out. Mine came with a few tangles, which you don't want to deal with while you're taping.

We want the LED string to spiral out of the bowl so that the USB end ends up on the outside. Begin by taping the end of the LED string to bottom the inside of the bowl. Although I didn't start right at the center bottom, there's more than enough string to do so.

Slowly lead the string around the inside of the bowl, spiraling up and out. Tape the string down as needed. You will need to bend it into shape periodically.

Eventually you'll reach the bowl's upper lip. You can either choose to cut the string short here, spiral the string back into the bowl, or spiral it around the outside. Since I'm going to be leaving my bowl out, I wrapped the remaining string around the outer bottom of the bowl to give it some ambient ground lighting.

Towards the end of the string, there are no lights, and the wires are a lot more flexible. Once you reach this end portion you want to wrap just enough extra wire so that it reaches to the back side of the bowl, to hide the connection.

Once you are satisfied with your wiring and tape, you can add the Poly-Fil stuffing. Lay out clumps in the bottom of the bowl until it's up to the desired level. You want to keep the stuffing somewhat light, so that the LEDs shine through a bit.

If you'd like to keep the candy separate from the lights and stuffing you can put a clear glass/plastic bowl into the candy bowl, and use that to hold your candy. The size will depend on your own bowl, but for my candy bowl, I found a 2.5L glass bowl fit well.

If you're not adding your own controller to the bowl, congratulations, you're finished! Just plug a power bank into the USB controller, and the string should start twinkling. Have a happy Halloween!

If you're make your own controller, please continue.

Adapting the LED String

PXL_20211021_224801695.jpg
PXL_20211021_224911347.jpg
PXL_20211021_225135623.jpg
PXL_20211021_225219145.jpg

Unfortunately, I don't think there's a way to reprogram the USB controller. It uses a pair of un-labeled 8 pin chips. One is probably a microcontroller, with the other being memory for the effects. Re-reprogramming them is not worth the hassle over just adding your own controller imo.

So, to control the LED strip ourselves, we first need to remove the existing USB controller and add a new connector to the string. WS2812's use a three-wire interface: one ground, one data, and one positive. Before we snip the cable, we need to determine which of the wires is ground, positive, and data. Luckily, the positive and ground are labeled as L+and L- on the USB controller. If you're controller has a clear case like mine you may be able to see the markings from the outside, if not, you'll have to open the case. It is glued, so you'll have to a bit of force, and possibly cut it open with wire cutters. Be careful!

Once you can see the markings, use a sharpy/pen to mark the ground wire, then cut the trio of wires from the controller.

Next, solder on a male JST-SH connector, as pictured. Make sure the wires are in the correct order! White is ground, red is positive and green is data on the JST connector. Don't forget to add heat shrink to protect the connections!

Note that I'm using a JST-SH connector because they are often used on outdoor WS2812 strings. I have some WS2812 strings, and wanted to keep the connections consistent. You can use another 3-pin connector if you like, but you will have to adapt it to JST-XH for the controller later (see Step 9). You could also use a JST-XH connector directly, but it is not waterproof.

At this point you are free to add your own controller, or you can follow along an use mine. To see the code, skip to the Code step.

Making the Controller Part 1

IMG_20201024_161235.jpg
IMG_20201127_152708.jpg

To begin, grab the controller's PCB. Please note that your PCB will look slightly different from mine, with an extra row set of pins inside the TP4056 outline. These are for mounting a 74AHCT125 logic level converter. I added this after assembling a prototype of the PCB, I have tested your version, but did not do a full assembly. I will go over the converter in the next step.

On the top of the PCB (the side with the TP4056 outline), solder the SMD resistors and capacitors in place as pictured. Their values are indicated on the PCB. These are for a debouncing the push buttons.

Making the Controller Part 2

IMG_20201127_152833.jpg
Extra board.PNG

Logic Level Shifting:

WS2812 LEDs are 5V devices, while the Wemos is a 3.3V device. This technically means that the signal put out by the Wemos will not be able to be read by the LEDs. Spec-wise, WS2812's accept voltages down to ~3.5V. This is the voltage needed to register a digital "high" signal (0.7 * (input voltage) as per the WS2812 datasheet). This is still outside the Wemos's range, buuuut, sometimes the voltage drop between the controller's output and the LEDs on the string is large enough to bridge the data gap. In my experience, you can generally drive WS2812B's with a 3.3V device without any intervening hardware.

However, to be safe, you should you add a 74AHCT125 logic level converter. This translates the 3.3V data signals to 5V, and should fix any issues. To control board as a place for the converter.

The 74AHCT125 is soldered in place of the TP4056 LiPo charger as pictured above. Make sure that the "LLC Bypass" pads near the D8 pin are not connected (they force the data to skip the LLC).

Making the Controller Part 3

PXL_20211021_173443436.jpg
PXL_20211021_173452091.jpg
IMG_20201024_161236.jpg

Next we will solder the DC jack connector and 3-Pin JST-XH connector to the PCB. The DC jack provides power input, while the JST connector provides power and data to the bowl.

As it happens, the pitch of the pins on a common 3.5mm DC jack connector (linked in the supplies) happen to closely match the pitch of the JST-XH connectors. This allows us to use the two connectors interchangeably on the PCB as long as we pay attention to the pin polarities, so that positive goes to VCC, and ground to GND. I have designed the PCB to accommodate the 3 pins on the DC jack. For a center positive connector (the most common type), the outer pins will be ground, and the inner positive. Solder the DC jack in place of the 2-Pin JST connector, as pictured.

Make sure you confirm that your USB to 3.5mm jack cable (the one you'll connect to the power bank, see Step 11) is center positive. Most should be.

Finally, solder a right angled 3-pin JST-XH connector and to the PCB as pictured.

Making the Controller Part 4

IMG_20201105_155441.jpg
IMG_20201106_153433.jpg

Now we'll add the Wemos D1 Mini.

Before you do this, you should confirm that you can program the Wemos, and that it's working correctly.

Begin by following the instructions here to install the ESP8266 core for the Arduino IDE.

This allows you to program the Wemos as if it was an Arduino. Once installed, open the IDE and connect the Wemos to your computer using a micro-USB cable. Under tools->board, select "LOLIN(WEMOS) D1 R2 & Mini". Also under tools, select the port that the Wemos is connected to. Try uploading blink (or your own favorite test program). If everything's OK, the Wemos's LED should start blinking once a second.

Flip he controller PCB over and solder 2.54mm male header rows to the Wemos D1 Mini area as pictured.

Next, push the D1 mini onto the headers, and solder it in place.

Making the Controller Part 5

IMG_20201106_154259.jpg
IMG_20201106_155129.jpg

Next, solder the slide switch and tactile push-buttons in place as pictured. You'll probably need to trim the side tabs off the switch. Make sure that the switch body isn't shorting out any of the pads underneath. You may have to add a small strip of tape over the pads.

You may want add a 1000uf electrolytic capacitor to the board. This protects the LEDs from current surges on start-up. It isn't shown in the images above, but you can add it using the through-holes next to the "1000uf" silkscreen label. Electrolytic capacitors do have a polarity preference, so make sure you match positive to "+" and ground to "-". To keep the board compact, you should lay the capacitor on its side before inserting and soldering the leads.

If you aren't 3D-printing my box for the controller, you're finished! You can head to the code section.

If you are going to 3D-print my enclosure for the controller, you should print out one copy of "Switch Cap.stl" and three copies of "Button Cap.stl". You can find all the files here.

As pictured, push the switch and button caps onto the slide switch and buttons.

  • The slide switch cap is square and will probably need a bit of glue to stick to the switch lever.
  • The button caps are round. They should be a friction fit onto the buttons.


Making the Controller Part 6

PXL_20211029_175011169.jpg
PXL_20211029_175027695.jpg
PXL_20211029_175254328.jpg
PXL_20211029_175330679.jpg
PXL_20211029_175936506.jpg
PXL_20211029_180334891.jpg
PXL_20211029_180340252.jpg

If you are 3D-printing my control box enclosure, you should print out one "Box.stl" and one "Lid.stl" and one "Adjustable Grip.stl". The files can be found here.

To begin, attach the lid to the box at the hinge. You can use a section of 1.75mm filament as the hinge pin.

Then insert two M2 nuts in the back of the bottom side of the controller as pictured. Secure them with glue. These are for the controller's adjustable grip. This lets you hang the controller from the side of your bowl.

Once you insert the control board, the grip nuts become inaccesible, so you should test the grip first. It mounts to the back of the controller using two 8mm M2 screws as pictured. You can slide the grip to accomodate different sized bowls.

Next, insert the control board as pictured. The DC jack, JST-XH connector, slide switch, and push-buttons should all align with cutouts in the box and/or lid. Secure the controller with hot glue.

After closing the lid, you can optionally secure it using two 4-5mm M2 screws.

Connecting the Controller to the String

PXL_20211022_175636459.jpg
PXL_20211022_175649497.jpg
PXL_20211029_212717055.jpg
PXL_20211029_212403455.jpg

At this point you may have noticed that the string connector on the controller and the one on the string are not the same. As I mentioned in Step 2, this was to keep the string waterproof in case I reuse it in the future. For the candy bowl/controller, being waterproof isn't important (no one wants wet candy), so we need to make a short adapter between the controller and the string.

Take a female 3 Pin JST-SH connector (black) and attach a 3 pin JST-XH (white) to is using crimp connectors.

Make sure the pin order matches the pictures above!

Using the connector, you can connect the string to the controller as pictured.

Code

I've written code for the bowl that includes 10 different effects.

You can find the code here.

If you'd like to change the colors, you should change them in the halloweenPallet.

My code doesn't currently support WiFi, but I hope to add it in the future. In the meanwhile, if you would like to take advantage of the Wemos's WiFi capabilities you could look into using WLED, which has it's own set of effects.

Before you can upload the code to the Wemos, you'll need three libraries:

  • My "PixelStrip" library
  • The Adafruit "Neopixel" library
  • The "TimerOne" library by Paul Stoffregen (only needed for Arduino code version, should already be installed by default in the IDE)

You can download the PixelStrip library from here. Download all the files and place them in a folder named "PixelStrip" in the libraries folder of your Arduino install directory.

You can install the Adafruit Neopixel and TimerOne libraries using the Arduino IDE's library manager.

Once you've installed both libraries you can upload the code.

The code supports button inputs and EEPROM saving. EEPROM is used to save the effect number, brightness, and effect rotation settings when the controller is off. By default both of these features are turned off. You can turn them on by setting the "BUTTONS_ENABLE" and "EEPROM_ENABLE" flags at the top of the code to true. The code is fully commented, but let me know if you have any questions!

The button usage is explained below:

Wemos/ESP Button Usage:

  • Button 1: Next Effect (or restarts current effect if effect rotation is off)
  • Button 2: Effect Rotation on/off. This makes the current effect repeat indefinitely
  • Button 3: Brightness cycle. You can adjust the increments by changing the "brightnessLevels" array in my code.

Finally, please note that different strings may use different RGB orders for the pixels. This will mess up the colors. If you think this is happening you can set RGBCOLORTEST to true. This will fade the string through the colors in the Halloween pallet. The first color should be purple. If it isn't, you need to change the stripType from NEO_RGB to NEO_GRB.

Finishing Up

PXL_20211029_212533199.jpg
PXL_20211029_181046489.jpg
PXL_20211029_181052069.jpg
PXL_20211023_222005529.jpg

With the code uploaded, if you connect your bowl and the power bank to the controller it should start up. You'll have to decide where you want to store the controller and power bank. I'm just putting my bowl out on a chair this year, so I'm keeping the controller separate. If you want a mobile bowl, you can hang the controller off it using the adjustable grip. Since your power bank is probably different than mine, you'll have to figure out how to mount it yourself, but using some sticky-backed Velcro may be a good option.

If you've made it this far, thanks for reading! I hope you found this Instructable useful. If you have any questions, please leave a comment, and I'll get back to you.

And finally, happy Halloween to you all! :)