Step 18[Appendix] Areas for Improvement
Sure enough, while working on this project all sorts of neat ideas and whizbang features popped into my head. However, due to time constraints and my resolution to finish the project, some of them had to be abandoned on the drawing board. In this section I record some of my thoughts for improvement on the project, in case someone else wants to take it upon themselves to make it better. A number of these have already been brought up by other users in the comments, and I wanted to comment on those a little.
Light Detection
Probably more than any other feature, this is the one I regret having to have dropped the most, as it would have been quite cool (at least how I was intending on doing it).
The basic idea I was going to use was to take advantage of a little-known property of LED's, namely that if you shine light on them, they will generate a tiny voltage. I.e. they work as little photocells. In fact I've seen someone build an extremely inexpensive solar tracker (used to keep solar panels facing the sun all day) using this effect (brilliant, I thought). Anyways, it was my intention to use this effect as well, along with the analog to digital (ADC) feature of the ATTiny45 to detect the ambient light level in a room and automatically turn off if it got too bright.
I prototyped this out, using ADC1 (PIN_D), and setting up the ADC to compare the voltage on this pin to the internal reference voltage of 1.1, and it *worked*. I was able to get results that went up as high as about 30 in quite bright light (next to a 100watt bulb). So I was reading a range of 0-30 or so, which should at least be enough to make some sort of decision as to how bright the room was. So I indeed believe it's possible to do this entirely in software without making a hardware change. How cool is that?
I did run into some caveats however. For instance, without any extra components, the values I was reading back tended to be extremely noisy, almost to the point of being useless. I'd see huge swings in the values I was reading off and, while indeed I'd see the average bias of those swings change with the amount of light, the signal to noise ratio was just too extreme. I found that by adding a small capacitor between PIN_D and GND tended to clean this up and it was when I was using the capacitor that I got the most reliable values. I think a 4.7uF cap gave me pretty good results. However, I didn't get so far as to investigating whether or not having the capacitor installed would significantly interfere with playback or make it impossible to program the chip on the board. That investigation I leave up to you.
The biggest issue that prevented me from going through with this was that of calibration. I was planning to give these out as christmas gifts to my family and friends and I had no idea how bright the room they were going to place them in would be. So how do I, as the fireflies, determine when to turn on and when to turn off without risking being "always off" or "always on" simply due to the choice of where I was placed? This was the technical obstacle, that of calibration, that ultimately forced me to abandon the idea.
Solar Power
I considered putting a little solar cell on the lid of the jar and using that to charge a rechargable battery instead of using the lithium coin cell. Also, this could be used as a means of detecting the ambient light level in the room and turning off it its too bright.
I think I stopped looking into the idea when I saw how much it would cost to buy solar cells that were small enough and yet could put out greater than 3 volts. Also, I'm not so solid in the raw electronics that working out the battery charging part of the circuit is something I can do easily (i'm still mostly a software guy).
It's certainly doable, I'm sure.
For the reference of anybody looking into this, here are the estimated average current values for the firefly circuit, depending on whether you're using the song1 pattern or song2 (song2 is default)
song1 = 0.159mA
song2 = 0.405mA
This is average.
Also, I considered possibly using a solar cell coupled with a supercap instead of a battery, but calculated you'd need a freakishly large one (2F or greater) to get any reasonable sort of runtime out of it. It still may be possible however and I wouldn't discourage someone from looking into it.
Motor
The idea is to make the fireflies move somehow to increase the realism. I didn't consider this one long since adding any kind of motor is going to have a disasterous impact on the battery life and also I couldn't figure out how I'd get the motor to move the fireflies in any way that looked remotely realistic. Just having a motor agitate the strings would result in fireflies that quickly swung back and forth like tiny little pendulums, and I couldn't imagine firefiles moving like that even after a half-dozen vodka martinis.
More LED strings (10 strings)
My original design was to have 10 LED strings charlieplexed in such a way that I could still play two songs at the same time. I worked out the logical connections, however I don't remember if I fully checked out that they would work 100%. Anyways, I've provided the last drawing I made of that idea before I abandoned it for the 6 strings idea (chiefly because I found that making the strings was a pain in the ass). It's up to you to figure out if it's workable or not.
| « Previous Step | Download PDFView All Steps | Next Step » |
9
comments
|
Add Comment
|
![]() |
Add Comment
|





























![[Appendix] Areas for Improvement](/image/FPA6Z2UPZOEWT14K84/Appendix-Areas-for-Improvement.jpg)































