Introduction: LED Fireflies Prototype
hello all, heres an attempt i made at something like an LED throwie..
the problem (for me) with led throwies is that they just consume their battery, and produce light.. but they could be better at doing both..
first you have to accept the premise that your willing to spend a bit more for the tradeoff..
the inspiration for this came from some of my other projects, and of course the "LED as a sensor" concept as well as the "LED throwie"
so the parts list:
1 common cathode, tri-color (RGB) LED
1 12f683 pic micro
1 coin cell battery holder
(cheap plug) http://www.makenyc.org/
Step 1: So Whats It Do?
the software is designed to use the LED as a light sensor (so as not to waste power during the day)
the led as an entropy source (to make each firefly unique moments after switching it on) to vary blink color, and rate.
and of course to play a flash pattern every so often in a way that seems "organic" and isnt just an "on/off" blink
and of course use as little power as possible!
(apologies for the darkness of the video, but the light had to be dim enough not to trip the fireflies daylight sensor)
Step 2: Pic Code and Assembly Instructions,
c code
assembler
hex
assembly is straight forward, the common cathod of your RGB led gets soldered to pin 2 of the pic, R-G-B pins get soldered to 7-6-5 and the pic power and ground go straight to the battery power and ground.
to put the whole thing together i just put the pic upside down on top of the battery casing, with a small dot of hot glue, bent the power and grond pins to reach over to the battery leads and attached the LED and hot glue a magnet and i was ready to go, total construction time was about 1.5 minutes.
Step 3: Suggestions
so for my second or third test, really my first worth posting.. the results are pretty good..
battery life is hard to estimate on this one, but... during the day the pic will consume ~25-30 microamps of current.. thats... microscopic.. at night, depending on the blink patterns generated.
sparkfun claims their coin cell has 250mAh of battery life, which, if the pic were the only thing on there would last well over a year, with the LEDs and of cours other factors like phantom drain from the battery..
i would estimate a couple weeks of random firefly like goodness..
some other ideas being thrown around are to maybe use infared to communicate between fireflies to some interesting effect.. but let me know what you think!
34 Comments
12 years ago on Introduction
cool, awesome, wow
15 years ago on Step 2
I like the idea, I'm working my own version of this with what I have, and was wondering was there anything in your firefly.h file? Thanks YaZug
15 years ago on Step 1
what in the name of santa's ballsack was that?
Reply 15 years ago on Step 1
so, assuming you mean the video, it was the firefly in operation, you'll see a quick red flash just before the color pattern appears.. this is the begining of the light sensing cycle.. too bad the video is so dark, but then, what firefly lights up during the day?
15 years ago on Introduction
This is so cool! I'd been thinking about how to prolong the battery life of standard throwies but I have no skill with ICs and my attempts all ended in failure. It's nice to see that someone succeeded!
Reply 15 years ago on Introduction
yeah the pics are sort of nice here, ive used them on other projects as super lower power switches. theyre all big on their "nano-watt technology" and, if your willing to bear with a 37250hz system clock, you can do some cool things for almost no power.. in the project code you'll see i set oscon to 0x00 to bring the clock down to its internal rc oscillator but when i want to use pwm for the color fades i speed the clock up to 8mhz on a side note, "led as a sensor" worked pretty well at 37khz.
Reply 15 years ago on Introduction
an lm 3090 osc ic or a smd 555 is better than a pic
Reply 15 years ago on Introduction
you.. don't have a clue do you?
Reply 15 years ago on Introduction
i do but
Reply 15 years ago on Introduction
er.. what i mean is.. according to national semi.. for the luxury of a single blinking led the way you suggest.. i would consume power at typical 10mA compared to the pic running actual code at 25uA which would significantly cut my battery life.. as well as remove all the cool features like RGB led's and environmental sampling an a lot of aestetic value.. ideas and questions are always welcome but dont comment without at least reading..
15 years ago on Step 3
i would like to see an irfra red led that hit tv on off codes as full spectrum as possible. imagine tossing it up high in a bar you dont like. they would think there tvs were haunted.
Reply 15 years ago on Step 3
Uhm.. like this thing?
http://www.tvbgone.com/cfe_tvbg_main.php
Basically just have to mod it a little and put a magnet on it
Reply 15 years ago on Introduction
i'd do it as a request, but i dont own a tv, and i'm not sure where id get a list of universal "off" code..
im also not sure if *every* tv remote operates at 40khz
another question would be if the "led as a sensor" with an ifared LED (the black ones) would also work as an infared sensor..
i'm still trying to figure out if i can use the RGB led as a color sensor
Reply 15 years ago on Introduction
Hello Phar, How would you use an LED(even a standard LED) as a light sensor? Is there some current flow through the semi-conductor when light is applied into the lens? I have never heard of using an LED as a light sensor before (only photo-cells or solar cells). I also have done some work with PICs, specifically the bigger 16c628, but I have a 12f675 that is looking for a nice use :). I was thinking that you could use an IR LED and photo-transistor in a PIC program to syncronize the firefly's behaviors. One example might be: have a master firefly send an omni-directional message to other nearby fireflies (via IR communication), who flash their pattern, wait a bit (oh, say 1/10th of a second), and then re-transmit the message to other neighboring fireflies who do the same - resulting in a cool wave effect. You might have to include some logic in the program to keep one firefly from signaling itself or its neighbor more than once in a given time period. Also, I was curious, did you write your own PWM algorithm or are you using the on PIC PWM facilities. I am interested because I wrote my own (havent figured out the on-board PWM yet) and I noticed from the video that your PWM is very fast. My home-made algorithm is fairly slow, even on an 8 MHz clock... Do you have the source code for your PIC? I would be interested in looking at it and maybe making my own :). Thank you much, Tek
Reply 15 years ago on Introduction
Hey have you seen this instructable?
https://www.instructables.com/id/Synchronizing-Fireflies/
might help with the synchronizing effect you're looking for...
Reply 15 years ago on Introduction
yeah i ended up seeing this after i posted mine (ended up as a "related" instructable)... the only thing is that i think with a bit more code i can do something like this without adding any extra parts, and if there are any more parts, those parts are focused on power usage. unfortunatly work has be a bit busy, my weekend is going to be spent with two servers, and a lanforge satellite simulator, i'll try to get a new version out next week.
Reply 15 years ago on Introduction
Oh, I just found this instructable too...
https://www.instructables.com/id/Programmable-LED/
same-same, but different
always good to read around a topic
Reply 15 years ago on Introduction
last things first, all of the code is linked from the instructable c and asm. next up, led as a sensor, i'm not sure who thought of this, but its a clever trick using some of the other principles of electronics.. with the whole "lumped matter dicipline" sometimes you forget that components have other properties.. for example LED's are just tiny solar panels.. or LED's can be tiny capacitors.. with "led as a sensor" your using both of those non-light-making" properties, your timing how long it takes the depletion region of the diode (functionally a tiny capacitor) to disipate when ambiant light is affecting the discharge rate (since the voltage generated by the light creates slight bias on the diode).. once you start thinking about things that way, why cant i do serial communications between two fireflies without adding parts? i can modulate a signal at 40khz just like a remote control..
Reply 15 years ago on Introduction
well would it be possible to take apart a universal remote to get the codes? especially the "learning" type remotes
Reply 15 years ago on Introduction
http://www.thinkgeek.com/gadgets/electronic/755e/ maybe something like this.