Arduino Powered Jack-O'-Lantern

<p>One of the standard happenings at Halloween is to carve a pumpkin into a Jack-O&rsquo;-Lantern. If you have carved a pumpkin before you will know that it is quite the messy job and having kids near knives with mess is never a good thing. This year I thought I&rsquo;d take a more technological approach to the boring old Jack-O&rsquo;-Lantern and turn it into something that is safe for kids to make and play with.</p>
<p>Instead of using a pumpkin for the head I opted to use something that is much easier to work with, cardboard. A Jatz biscuit box just so happens to be the perfect size, the bonus being you get to eat all the Jatz biscuits first. Simply draw the face onto the box and cut it out with a pair of scissors or a hobby knife.</p>
<p>Instead of using a candle to light the inside of the head I thought that using a couple of LED&rsquo;s and an Arduino I could replicate the flickering candle effect. I did this by using Arduino&rsquo;s analogWrite function. Basically there are special pins on the Arduino that can output a PWM wave. We can set the duty cycle of the PWM wave using a value from 0-255, being 0-100% duty cycle. To get the flickering candle effect I made a variable that was assigned a random value from 0-255 and then set that to the LED, repeating that for the other LED. To add to the flickering candle effect I added a delay at the end of the loop that was also assigned a random value. To soften the glow of the LED&rsquo;s I covered the front face of the head in baking paper.</p>
<p>The effect turned out pretty good as you can see in the video below.</p>
<!-- LeadPlayer video embed code start [ video: 5250C202252E8 ] --><div><script type="text/javascript" src="//s3.amazonaws.com/cdn.leadbrite.com/leadplayer/r0038/js/leadplayer.js"></script></div><div id="leadplayer_video_element_5250C202252E8" style="width:528px;height:297px"></div><div><script type="text/javascript">jQLeadBrite("#leadplayer_video_element_5250C202252E8").leadplayer(false, "eyJnYSI6ZmFsc2UsIm92ZXJsYXkiOmZhbHNlLCJwb3dlcmVkX2J5IjpmYWxzZSwicG93ZXJlZF9ieV9saW5rIjoiaHR0cDpcL1wvd3d3LmxlYWRwbGF5ZXIuY29tXC8iLCJjb2xvcjEiOiIjRjVCQjBDIiwiY29sb3IyIjoiIzE3OThDRCIsImNvbG9yMyI6IiNGNUJCMEMiLCJ0eHRfc3VibWl0IjoiU1VCTUlUIiwidHh0X3BsYXkiOiJQTEFZIiwidHh0X2VtbCI6IllvdXIgRW1haWwgQWRkcmVzcyIsInR4dF9uYW1lIjoiWW91ciBOYW1lIiwidHh0X2ludmFsaWRfZW1sIjoiUGxlYXNlIGVudGVyIGEgdmFsaWQgZW1haWwiLCJ0eHRfaW52YWxpZF9uYW1lIjoiUGxlYXNlIGVudGVyIHlvdXIgbmFtZSIsImxwX3NvdXJjZSI6IldQIFBsdWdpbiAxLjQuMS45IFVubGltaXRlZCIsImlkIjoiNTI1MEMyMDIyNTJFOCIsIndpZHRoIjo1MjgsImhlaWdodCI6Mjk3LCJ0aHVtYm5haWwiOiIiLCJ0aXRsZSI6IkhhbGxvd2VlbiBTcGVjaWFsIFBhcnQgMiAtIEFyZHVpbm8gUG93ZXJlZCBKYWNrLU8nLWxhbnRlcm4iLCJkZXNjcmlwdGlvbiI6Ikluc3RlYWQgb2YgZ2V0dGluZyBhbGwgbWVzc3kgY2FydmluZyB1cCBhIHB1bXBraW4sIGhvdyBhYm91dCB3ZSB0YWtlIGEgdGVjaG5vbG9naWNhbCBhcHByb2FjaCB0byBhbiBvbGQgZmF2b3VyaXRlIGhhbGxvd2VlbiB0cmFkaXRpb24uIiwiYXV0b3BsYXkiOmZhbHNlLCJzaG93X3RpbWVsaW5lIjp0cnVlLCJlbmFibGVfaGQiOmZhbHNlLCJvcHQiOmZhbHNlLCJjdGEiOnsidGltZSI6MjAsImJ0ZXh0IjoiR2V0IGhhY2thbGljaW91cyBwcm9qZWN0cyBhbmQgZGlzY291bnRzIC0gam9pbiBvdXIgbmV3c2xldHRlciB0b2RheSEiLCJ1cmwiOiJodHRwczpcL1wvY29yZS1lbGVjdHJvbmljcy5jb20uYXVcL3N0b3JlXC9uZXdzbGV0dGVyIiwiYXV0b19mb2xsb3ciOmZhbHNlLCJuZXdfd2luZG93Ijp0cnVlfSwieW0iOiJCSnR6aS0yc1FoZyJ9");</script></div><!-- LeadPlayer video embed code end [ video: 5250C202252E8 ] -->
<p><br><br>If you would like to make an Arduino powered Jack-O&rsquo;-Lantern of your own be sure to pick up these components in the Store:</p>
<ul>
<li><a href="https://core-electronics.com.au/index.php/leds/5mm-leds/5mm-leds-50-pcs-pack-10x-red-green-blue-yellow-white.html">LED&rsquo;s</a></li>
<li><a href="https://core-electronics.com.au/index.php/other-components/resistors/600-pack-of-1-4-watt-1-resistors-30-values-20-of-each.html">Resistors</a></li>
<li><a href="https://core-electronics.com.au/index.php/development-tools/arduino/arduino-uno-r3.html">Arduino Uno</a></li>
<li><a href="https://core-electronics.com.au/index.php/development-tools/arduino-derivatives/prototyping/protoshield-mini-breadboard-for-arduino.html">Prototyping Shield</a></li>
</ul>
<p>If you would like more information on exactly how it works you can do so <a href="http://www.duino-robotics.com/jack-o-lantern.html">here</a>.</p>