Firefly jar v1
From Harford Hackerspace
Contents |
Firefly Jar (version 1.0)
The purpose of this project was to see what fireflies in a jar using LEDs would look like. It turned out to be pretty cool and a version 2 is planned. Version 1 is still pretty cool, but there are a few things I would like to improve on:- You cannot see inside the jar, this was to hide the electronics easily. It would be nice to have it look a little more natural during the day time.
- There is a giant switch on the top. Maybe something more discrete would be more visually appealing.
- The jar I used is waaay small and everything just _barely_ fits, this makes wires tug when changing the batteries.
This is a very easy project, should only take about an hour to put together, almost any part can be swapped out, even the micro since we are using software PWM. I didn't use any resistors since the duty on the pwm is pretty low and the current is sourced from the micro its generally not going to burn out the led's, besides we aren't trying to waste battery power =]
Updates
7/11/2010 - Added source + hex to use a pic16f676 instead of a 628a.
Pics / Vids
The finished jar, in daylight.
Mostly assembled, battery pack, ic.
Almost assembled
Just the switch mounted on the lid, its offset so the battery pack can go next to it.
Materials Used
Glass Jar - Baby food jar, I had one laying around. - You can use anything I guess
8 x Green LED's (3v, 12ma) - Green makes the most sense, but you could use whatever. Low power ones are good to since we are sourcing our current from the micro.
Battery Holder - I used a 4 x AAA holder, only because it was the only one I had that would fit in the jar. The batteries are 1.2v rechargables so I'm still under max current. 2 or 3 aaa's would be best, especially if you are using alkaline.
Rechargable Batteries - 4 x AAA's, 1.2 volt Low Self Discharge - eneloop style
Wire - Wire is good
Toggle Switch - I used a DPDT because I had one...
Double Sided Tape - To hold the micro to the battery holder
White Spray Paint - Used to diffuse the jar
PIC16F628a - Microchip Pic Micro.... I'm using software pwm so, essentially you could use pretty much any pic... 4 mhz internal osc
Build Instructions
First thing to do is take the jar, and lightly paint the inside white to diffuse the jar.
While the paint is drying, program the pic.
I chose to leave an ICSP header on mine to make updates, but thats up to you if you want to tweak the code.
Then drill a hole on the lid and mount the switch.
Attach the battery pack to the lid using double sided tape.
Connect the pic to the side of the battery pack using double sided tape, with its back towards the battery pack.
Bend the leads of the pic out.
Start making leds with short pieces of wire attached.
Connect the leds to the pic, dead bug style (free floating, no pcb or proto board, just wires).
Connect the battery pack to the switch, and to power the pic.
Power it on.
Code / Schematic
Download Source Here (pic16f628a)
Source + hex for using a pic16f676
If using a pic16f676 use the following pins for leds:
C0 - C5 and A4, A5

