Fluid Edge Themes

Halloween Jack-o-Lantern

Halloween Pumpkin Carving – Best on the Block

I went to a pumpkin patch with my family last weekend and this large pumpkin spoke to me. It was 16” tall but it sat up perfectly on flat ground and leaned back a little bit, giving the perfect viewing angle for any passerby. It had to be this one. I spotted it within 1 minute and proceeded to drag it around while the rest of the entourage took another 20 minutes to find just the right one. With every step the cart got harder to pull through loose dirt. A real first-world problem. Once I got it back, I knew I wanted to do something special with it.

I decided to jazz it up with electronics, but as the big day was very near I did not have enough time to ship a bunch of components, so I decided to limit myself to my closet of random components. Focusing on the box of lighting materials, a few candidates spoke to me: A smart light bulb, so many LED strips, sticks, and panels. Then I came across the electroluminescent wire, tape, and panels. A quick googling returned many results for pumpkins made with EL Wire, but EL panels and EL tape were much harder to find, so I decided those two would make the most unique project. For some reason I seemed to have the most “blue” EL things, so that made my decision about what color to use. I have an EL Shield for an Arduino that has 4 outputs, so I grab 3 panels and 1 tape. EL tape makes a great soft glow, but it doesn’t make sharp turns as one typically finds in a Jack-O-Lantern, so I wanted to think of a different way to use the tape. Back in the components box I also found some 4” samples of an acrylic mirror and “two-way” mirror. These can combine to make an infinity mirror. (https://www.google.com/search?q=infinity+mirror). On a small pumpkin, this might make a great mouth like a Sarlacc, but my I also wanted to up the creepiness/coolness by making some part moving. Inspired by these animated eyes (https://learn.adafruit.com/animated-electronic-eyes-using-teensy-3-1), I decided to use an Amulet display module (MK-043C-HP).
Here are all the parts I used:

1 large (~16″ tall) pumpkin – components alone need ~12″ of space, plus base and lid
Eyes: Amulet STK-043-HP
Controller: Arduino Uno
EL Shield: http://www.seeedstudio.com/EL-Shield-p-1287.html
EL Inerter: http://www.seeedstudio.com/Robust-EL-Inverter-For-EL-Shield-p-1289.html
Mouth: EL Panel x3
Nose Infinity mirror:
EL Tape

http://www.seeedstudio.com/EL-Tape-Red-1m-p-1181.html

Two-way Mirror (4″ sample)

http://www.tapplastics.com/product/plastics/cut_to_size_plastic/two_way_mirrored_acrylic/558

Mirror: (4″ sample)

http://www.tapplastics.com/product/plastics/cut_to_size_plastic/acrylic_sheets_mirror_clear/521

spare carboard

electrical tape

Power: Extra Apple phone chargers: Two 5V/1A power supplies with USB Mini-B connector

Misc:

T-pins for mounting inside the pumpkin

tool for putting design onto pumpkin. Dry erase marker, pushpin holes

blade for cutting cardboard (leatherman, hobby knife, etc)

pumkpin carving tools

Software:

Arduino IDE w/Simple EL Shield Demo

GEMstudio Pro w/Halloween Eyes Demo


Since programming the hardware isn’t ideal once the Jack-O-Lantern is fully assembled, lets start with the software. The EL Shield has a wiki page (http://wiki.seeedstudio.com/EL_Shield/) which gives a simple example of how to use it. It takes output pins 4, 5, 6 and 7 to control the output on each EL connector. The example code shifts the input by 3, I guess in an attempt to make it simpler, so the “setEL” function is called with inputs 1, 2, 3, or 4. The sample code actually turns off all of the EL channels before turning on the channel requested. When I tried to go around this and just turn on all for (or even just 2) channels at the same time, I found that my EL inverter didn’t have enough juice for the task. I tried to use a POV attack and just round robin each output for a couple of milliseconds, but it ended up just being too dim. I decided to limit myself to one at a time, and to blink them randomly for a random but short length of time. Here’s that code:

<code>

void setup() {

  for (int i = 4; i < 8; i++)

  {

    pinMode(i, OUTPUT);

  }

}

void setEL(int ch) // set a certain EL on

{

  for (int i = 4; i < 8; i++) // all off

    digitalWrite(i, LOW);

  digitalWrite(ch + 3, HIGH); // ch on

}

void loop()

{

  setEL(random(1,5));

  delay(random(200));

}

</code>

Once this is programmed into your Arduino, attach the shield, inverter, and then test all of the EL outputs to make sure they all work.

Now lets look at the eyes. Taking inspiration from the Adafruit Animated Eyes project, I created a mask for both eyes:

This would be an overlay on top of the eye image. For that, I thought a bloodshot eye would give a good effect. Now I really, really have a problem looking at real eyeballs. It churns my stomach when someone touches their eye, so looking for gross eye pictures that would be perfect was just not going to happen. So I created my own. Finding the iris was okay. I layered that on a white background. Then I saw that eye veins kind of resembled lightning, so I found some free lightning clip art, colorized it red using GIMP, and layered it all around the iris.

There is only one eye in this image. Even though it would be possible make both eyes in the same image, I wanted the ability to do some silly things with eyes going different ways. In GEMstudio, this is implemented with two ImageScroller widgets. Making the highlighted changed to the default imageScroller widget, including adding the “scrollerImage” and removing the “sequence” parameters:

Then duplicate the imageScroller, place the mask image on top of those, and change the page BG color to black:

Next we need some code to move the eyes around. They are both using InternlRAM.byte(0) to move. I wanted them to move around randomly, but if it is purely random jumping around it isn’t nearly as creepy as a fluid movement, so I added a filter to make it ease into the new random position.

<code>

//first timer puts a random value into InternalRAM.byte(1) every 0.5 seconds

<META HTTP-EQUIV=”REFRESH” CONTENT=”0.5; ONVAR=Amulet:math.randomByte.value();VALUE=Amulet:InternalRAM.byte(1)”>

//second timer calls the function that filters the new value for fluid movement

<META HTTP-EQUIV=”REFRESH” CONTENT=”0.05; URL=GEMscript.eyeMover()”>

<SCRIPT>

            public eyeMover()

            {

                        new curr =InternalRAM.byte(0)

                        new dest = InternalRAM.byte(1)

                        InternalRAM.byte(0) = (curr + dest)/2

                        document.MyImageScroller_2.forceUpdate()

                        document.MyImageScroller_3.forceUpdate()

            }

</SCRIPT>

</code>

Simulate the project to see that the eyes do indeed move around creepily and you’re ready to program into the display. That is all for software, so its time to gather all the components and start assembly.

After gathering all the components, my next step is to assemble the infinity mirror (link) that mill make up the nose. I chose cardboard to create the sides and back of the mirror.

  1. Cut a 4×4” square of cardboard.  My EL Tape is 0.5”, so cut a 0.5″ x 16.5″ strip of cardboard. This should wrap around a 4×4″ square, so 16″ plus a little extra for the bends, erring on the longer side. I used a square to get the lines as straight as possible, but not critical since we will seal the device with opaque tape. Shape the cardboard around the 4×4” square and tape closed.

Now you can assemble the device. Starting with the frame laying flat, place the mirror facing down and then the cardboard square on top. Secure this with tape and flip over. Inside that frame place rolled up EL tape. Now that the tape is fit perfectly, pinch it firmly as to not let it slide and pull it back out. Use some clear tape to make the tip of the EL Tape stay put, otherwise it may bulge a little. Also, cut a notch in the frame for the wires to exit. Continue assembly, reinsterting the EL Tape, making the wires exit at the notch, then place the two-way mirror on top with the film facing DOWN, inside the box. This is important because the reflective film comes off fairly easily and just removing the tape can bring the film with it. Starting with the corners, since they don’t cover the circle of EL Tape inside, tape the box

2. Planning the pumpkin’s teeth. To figure out my limits I drew a rectangle the size of my 3 EL Panels, then cut out the teeth within that rectangle. Keeping the cut-out in one piece makes a handy way to secure the 3 panels together, and then the larger piece can be used as a stencil on the pumkpin, as well as a way to see if you like the prototype. My pumpkin is going to have a big, funny-looking nose so I wasn’t terribly concerned with making the teeth extra scary.

Stacking all the pieces together, I am hopeful that it wont be a complete failure. That looks a little close to the top:

Now its time to carve! I’m doing this a full week before the big night, and I want it to last, so I’m taking some extra precautions. Decay is the main enemy here. I cant do much about the warm weather (highs in the low 70s) encouraging decay, but I can sterilize the inside of the pumpkin with a bleach solution after cleaning it out. Petroleum jelly on the cuts may help it retain some moisture. Cutting out the back of the pumpkin instead of the top is supposed to be better since the stem isn’t cut off. On top of that, I have a pretty large pumpkin, so I’m hoping that the thicker walls will help it hold up through seven days. However, that might be just extra weight crushing it towards the ground when it does begin to decay. Anyways, Onward!

My first mistake was the shape of the cutout. I didn’t give enough thought to the angle of my cut, so the back just falls inside. I’ll fix this with some supports later. I read that superglue works great, so maybe ill use that for the big day. But I do think cutting the back off was a good idea because it allowed me to work with the electronics laying down flat. I was happy that without much shaping and scraping inside, all of my components fit nicely. I wrapped them in clear plastic bags so that the pumpkin juice doesn’t let the  magic smoke out.

The next step was to cut out the mouth. I used T-pins to push through from the inside of the pumpkin to the front to mark some features in the teeth, then I was able to hang the cardboard mask right onto the T-pins and trace the outline in dry-erase marker. This is where the 2” walls inside the pumpkin made it extra difficult. My “power” saw powered by 4 AA batteries was not up to this task. I drilled some starter holes and got to work with the saw from my pumpkin carving kit. 20 minutes later and an embarrassing amount of sweat later, I was happy with the result.

Now for the nose, I wanted it perfectly round, and I was not up to that task by hand. The adjustable hole saw saves that day. The hardest part here was locating the hole since the electronics inside the pumpkin are basically touching. Putting all the electronics back inside and measuring it exactly was my best bet, and then the hole saw made QUICK work of this pumpkin. Within 10 seconds it came right out. Marking the location for the eyes was a similar process, except for the cutting. I wanted to maintain that bridge between the eyes as pumpkin flesh, so the cuts had to be parallel instead of toward the center of the pumpkin.

After test fitting all the pieces inside, it was clear that a little more pumpkin needed to be shaved out to get the flat surfaces flush with the rounded flesh inside. I started by marking the inside of the pumpkin along the display and infinity mirrors edges, then slowly cutting out the flesh. The process involved a lot of guess and check until I was satisfied with how flush the components got.

Finally it was time to mount the electronics inside the pumpkin. My plan was to use T-pins. The bezel around the display has some mounting brackets. I had the display turned on so that I could see get it in the perfect position, then holding it in place I rocked the pumpkin onto its front. Then I used 3 T-pins to hold the display in place.

The infinity mirror nose didn’t have a mounting brackets (idea for next year!) but it is pretty light and well protected from moisture by the vinyl tape + plastic bag, so I actually used the plastic bag as the mounting bracket and pushed a few T-pins right through it. The EL tape’s connector (double black wires) comes out the corner of the plastic bag and you can see it connected to the inverter shield cable in the top left.

The EL panels that make up the mouth section didn’t actually need any mounting because they fit snugly into the very bottom of the pumpkin. I covered them in plastic wrap because my gallon plastic bags were just slightly too small, but the panels themselves are already sealed from water from the manufacturer and because I didn’t cut them up they stayed sealed. The 3 sets of EL Panel wires come out and go into another plastic bag holding the Arduino UNO and EL inverter. Pushing all of the wires to one corner of the bag I just try to get it as closed as possible.

Applying power to the pumpkin, everything works! Because the EL inverter wasn’t powerful enough to drive all 3 panels and the tape at the same time, I decided to flicker them one at a time, so a still picture only shows one on at a time. Here is all 4 in the daytime.

Wrapping things up, literally, the last step was to put the back of the pumpkin back on which was a challenge due to the shape of my cut allowing the back piece to fall straight through. I put several T-pins on the inside, facing up, to “catch” the lid as it is inserted, then I “locked” it closed with a few more on the outside. This will probably be the first thing to fail, but it shouldn’t be seen so I’m okay with that.

Here it is lit up at night. There are a few weird sounds in the video. First, the EL panels themselves make an audible tone because they are driven with AC voltage at an audible frequency. Second is my dog clomping around on the floor. I really need to trim her nails!