So, I know that Halloween is well behind us at this point, but the New Year makes you reflect back over the previous twelve months, and think about what worked in your life and what didn’t. And, it just so happens that I managed to learn a few important lessons this Halloween about what doesn’t work when you try to spice up the traditional jack-o’-lantern.
The basic idea I had was to upgrade the tired old “candle inside a pumpkin” methodology for making a jack-o’-lantern. I mean, I’ve got all these flashy LEDs lying around, right? How hard would it be to replace a candle with some blinky lights, and make the pumpkin a little more interesting?
A quick aside on the NeoPixels. I think these things are great, and in fact, they’re what I’m using to light up The Project (see here for more on that). The gist is that you can program your Arduino board to set the color of each LED individually. So, if I’ve got a stick of 8 Pixels, I can tell the program to make Pixel #1 Green and Pixel #2 Red, make them all blink, fade in and out, or pretty much whatever I can imagine.
So, when I saw that my wife had carved one of our pumpkins as a robot, I knew this was the guy who needed to be lit up.
You, in the middle. Step forward.
The programming was pretty easy. I wanted the holes on the side of his head to blink different colors (kinda like the inside of Data’s head), so that was basically just about setting the right pixels to red, blue, and green, pausing briefly, and then changing which ones were red, blue, or green. Pretty straightforward. His eyes took a little bit more work, but eventually I got what I wanted – a purple pixel traveling in a circle (so the eyes would look like they were rolling). Finally, I wanted to give the pumpkin an old-school Cylon mouth (so, red pixels sliding back and forth).
I tested each of these on the computer while hooked up to the USB cable which both transmits the program to the Arduino board and – and this is important – powers the whole setup. The tests worked, everything looked the way I wanted it to, so it was time to put the sucker together.
So, at this point, I should mention that it’s about 10 days before Halloween. I think I’m being awesome and taking care of business well in advance, ensuring I have enough time to respond to problems, and the like. Turns out that I was actually too industrious.
So, the first real difficulty I ran into was that it’s not easy to place LEDs in a pumpkin and have them stay where you want them to. I mean, when you think about it, all you usually do with a pumpkin is drop a candle into the center; as long as the bottom is basically flat, you’re golden. But here, I was trying to get a small circle of LEDs to sit perfectly over each of the pumpkin’s eyes. This was made even more difficult by the wires; each NeoPixel assembly needs three connections in order to work: one for power, one for ground, and one for data (which is the connection the Arduino uses to tell it which colors to turn and when). So, each of my 5 assemblies has three wires sticking out the back, and those wires exert a small amount of pressure on the assemblies themselves. What this meant was that even when I thought I had things well placed, moving a wire (for example, when I was trying to place my second assembly) invariably caused the first to move.
Eventually I solved this problem with toothpicks. A lot of toothpicks.
Like something out of Hellraiser…
Some of the assemblies had tiny little holes that, it turns out, were almost perfectly sized for a toothpick. (I say almost perfectly, because, while one likely never thinks about the tolerances involved in toothpick production, there clearly is some give or take going on there, because some of my toothpicks went through the holes without touching anything, while others got a nice snug hold).
So, I’d finally placed all my Pixels, and used my alligator clips to attach the end of the 15 connections (remember, 5 NeoPixel assemblies x 3 connections each) to the Arduino board. The end result looked like a complete mess from the back.
More like a mess and a half…
But from the front, I have to say, I was pretty pleased.
It’s important to note for later that I was powering this with a 9V battery.
Okay, so all well and good thus far. In fact, my daughter was so impressed with Robo-Pumpkin that she asked if we could add some color to her pumpkin.
For those of you who don’t know, this is Constantine, the world’s most dangerous frog.
I said sure, so I used the other remaining NeoPixel circle assembly and Arduino board and whipped up a short program to have our frog blink green.
It’s not easy being…well, you know.
So, here’s where I made my first mistake, though I didn’t realize it until later. When I tested these two pumpkins, I simply traded out the 9V battery by unplugging it from one and attaching it to the other. This was fine, since I was just testing that they worked as intended, but I failed to realize at the time that I should probably have a second 9V connection ready since they’d both be going simultaneously on Halloween night.
More on that later.
As I mentioned before, Halloween was 10 days away. Now, I don’t know when you usually carve your pumpkins, but I tend to do mine early because I like having them around. Of course, like most people, I leave my pumpkins outside…where it’s colder.
But these pumpkins had roughly $100 worth of electronics inside them. I wasn’t going to put those outside – my second mistake. So, I placed the pumpkins and electronics on our kitchen counter, eager to show them off on Halloween night.
They never saw Halloween night.
Because pumpkins, like most gourds, can last for ages as long as their skin is intact, but can actually rot away pretty quickly once they’ve been breached. How quickly? Well, about two days after my successful lighting tests, I was faced with this:
I managed to salvage all the electronics and wires, which were covered in pumpkin goo but still functional. The pumpkins were toast, however.
Okay, so time for Robo-Pumpkin 2.0. This time, I waited until the night before Halloween to carve the pumpkin. My wife handled Constantine for me, and I figured that it was all smooth sailing now. All I had to do was reconstruct and rewire these pumpkins, and no one would be any the wiser.
So, Halloween afternoon comes, and my wife and I are preparing for a party. Meanwhile, Robo-Pumpkin 2.0 is sitting on the kitchen table, taking up space, as I try to get LEDs more or less positioned the way they had been the first time. By and large, I did okay.
Of course, here’s where things went awry. I noticed at this point that I only had one 9V connector. Now, that left me with two options. I could run to Radio Shack, hope they had another one, break out the soldering iron and wire the whole thing up. Given the amount of time I had left, I didn’t want to do that. The other idea that occurred to me was to use some other power supply, like a wall unit. This meant that I would need to use an extension cord for my pumpkin, but hey, since my yard was already covered with cords anyway – what harm would one more do? I dug through my closet until I found a plug-in power supply that I’d bought for something else a while back and never used.
The problem, at last for me, was that I forgot that there are two power output pins on the Arduino. One is labeled “5V” and supplies, as might be expected, 5 volts. The other is labeled “Vin” and, as I later learned, simply passes along the voltage coming in, whatever its size. My LED stick was plugged into the “Vin” pin, which I then powered with the wall supply. My *120* volt power supply. Into my *5* volt LEDs.
Class, do we know what happens when you try to power 5V LEDs with 120V?…Okay, let’s not always see the same hands.
That’s right – complete failure. The LEDs glowed very brightly for a few seconds, then they started popping off one after the other. I yanked the cord out of the wall in time to save the 8th LED on the strip (out of 8). The others were completely fried.
So much for the Cylon mouth…
In the end, I found an old AA holder that I wasn’t using, plugged it into the Arduino (after making sure to switch the LEDs to the correct power pin), and everything worked just fine. I gathered everything up, set it on the front porch, and went about helping my wife set up for the party. We started getting some trick-or-treaters, and I would check on the pumpkins whenever I could. That’s when I noticed that Robo-Pumpkin 2.0 was acting odd. Some of the lights would work, others wouldn’t. And sometimes, all movement would just stop, like the whole thing was paused.
Turns out that the 9V battery I was using wasn’t up to the task of powering Robo-Pumpkin for very long. Of course, I probably should have used a fresh one, instead of sticking with the one I’d used to help me test everything on Robo-Pumpkin version 1.
So, ultimately, when it comes to fancy, blinky pumpkins – the build was successful, but the implementation was somewhat less so. This Halloween I’ll have to think more carefully about how to power the whole mess. I’m thinking something like this.
1.21 gigawatts should do it…