Fire Fly Jar, Arduino
You can easily make your own jar full of Fire Flies or Lightning Bugs with just a few solder joints. The lights flash on and off just like a fire fly and you can change how long they stay on and how long they are dark between flashes. All it takes is an Arduino, 3 LEDs, 3 resistors, a battery, and a Jar.
Materials
- 1 X Arduino (I used a Nano but any model should work)
- 3 X 5mm yellow LED (you can use any color you like but the yellow look pretty much like the real thing)
- 3 X 330ohm resistors
- 1 X quart jar. (I used an old jar I had laying around a mason lid fits so that will make it easier to pretty it up later)
- 1 X 9 volt battery
- 1 X 9 volt battery clip
- 1 X can of Rust-Oleum "Frosted Glass Spray" ( http://www.rustoleum.com/product-catalog/consumer-... )
- some assorted wire, wire cutters, soldering iron, and solder.
Making the Fire Flies
- Find the short leg of your LEDs. This is negative, also known as the cathode. Solder a resistor to this leg, you can cut it short first if you like.
- Solder a wire to the other end (I used solid wire for the negative connection so I can use it to "pose" the fly in the jar.)
- Solder a wire to the positive side, again you can trim the lead if you want (I used stranded wire here to make everything easy)
- Heat shrink the connections and then run another piece of heat shrink over both wires to keep them together in the jar. (I used red tubing for demonstration but black on my actual jar)
Repeat to make 3 "fire flies."
Program Your Arduino
- Download a FireFlyJar .ino file from GitHub . This is the program (or sketch) that lets your Arduino power the Fire Fly Jar.
- FireFlyJar-Continuous-0.1.ino will light your LEDs up as long as you have it powered.
- FireFlyJar-Timeout-0.2.ino allows you to set a timeout for the LEDs. After a set time they will stop flashing and put the Arduino in shutdown mode. It will continue to draw power but MUCH less.
- Download the programming software from Arduino
- Start the Arduino program and open the file you downloaded from GitHub.
- Plug your Arduino into the USB on the computer. The red light should come on.
- Click on the little right arrow in the upper left corner next to the check mark.
- You should get a notice that the software is uploading and the red light on the Arduino should blink.
- You're done. The Arduino is now programmed.
Wire the LEDs to the Arduino
This is the hardest part of the project. You can order Arduinos with no pins but if you already have pins on your Arduino it is best to remove them first. (If you need an Instructable for this let me know, I can probably make one)
- Disconnect the USB cable from the Arduino before soldering!
- Take the positive leads from the LEDs and solder one each into the holes D9, D10, and D11.
- It might be easier to tin the wire first. To do this just twist the wire a little and put a small amount of solder on it.
- Wire the 3 negative lines together and solder one to the hole marked GND on the Arduino.
- If you want to use a battery to light the fire flies instead of your computer now is the time to solder a 9 volt battery clip on. the red wire goes to hole Vin and the black to GND. (As you can see in the photo above there are 2 GND connections, they are both connected to the same place so you can use either or both.)
Putting It All Together
With a battery attached (or the computer) the LEDs should start blinking.
- Spray paint the OUTSIDE of the jar with Window Frost spray
- Tape over (or remove) the red Power LED on the Arduino. You can safely remove the LED it doesn't do anything but tell you when the Arduino has power
- When the paint is dry arrange your LEDs in the jar.
- Mount the battery under the lid and the Arduino on top of the battery. I used double sided foam tape to hold it all together (and prevent the Arduino from shorting out on the battery.) I had to mount the Arduino on top otherwise the battery would hold down the reset button.
- I wrapped it all in electrical tape just for a little extra security.