Hello,
For a project I am working on, I want to drive an RGB LED* with a power source that charges during the day. Can anyone offer advice on what I should look for when it comes to storage and charging components? Advice in general would be greatly appreciated. I have done some simple electronics projects, but nothing complex or related to solar.
Thank you!
For how long do you want the LED to be ‘driven’ ? Just 1 color or all three ? At full intensity or less ? Constant or blinking ? What’s the light source and for how many hours is it guaranteed to be ‘on’ for charging ?
Thank you for getting back to my post.
The LED will need to be on for at least 4 hours in order for this to be worth it. It will be indoors, but the suggestion will be to place it by a sunny window. The idea is that when the room is dark, it will rotate between colors (no blinking) and will charge otherwise. I have not played around with intensity to give you a straight answer, but can say it should be able to cast some light in an unlit space.
So let’s estimate the LED uses 40 mA on average as it’s cycling through it’s colors. Lets add another 10 mA for a controller of some sort. Let’s run this off a nominal 5v. So that’s 0.05 x 5 = 0.25 W for 4 hrs, a battery that has 1W-hr of storage. That’s pretty small, a single AA rechargable might have a 2000 mah rating. At 1.25 V, that’s 3 W-hr of capacity.
Can you find a solar cell that’ll recharge that 1 W-hr of energy in some reasonable period ? Sure, even this guy should do the job.
https://www.sparkfun.com/products/7845
So now it’s a job of controlling the charging process, matching/changing voltages and controlling the LED. There are ICs for the former, SFE might even have a Break-out Board (BoB). And I’ll guess Adafruit’s Trinket would do the later (assuming you don’t care to deal w/naked parts).
The simplest thing I can envision is a battery holder like this …
https://www.sparkfun.com/products/552
plus 4 AA NiMH batteries. Connect the above solar cell to the pack, but through a Schottky diode. Connect the pack through an on/off switch to the 5 V output of the Trinket (bypassing it’s voltage regulator). I’d advise using the 5 V Trinket but setting it’s clock to 8 MHz. I’d even remove the regulator.
http://www.adafruit.com/products/1500#Description
Connect your LED leads, through the appropriate dropping resistors, to the Trinket’s PWM pins. The common cathode goes to ground. I think you should be able to connect the solarcell output, via a resistor divider, to the Trinket’s analog pin. This way you can gauge darkness and do some timing to turn on/off the LED.
Given the solarcell output of 5 V the batteries will never be fully charged but they should last the 4 hours. And the NiMH batt’s should tolerate the trickle charge well, no need for fancy circuitry.
Thank you for the response. I found it quite informative and helpful.
Why go with the 5V Trinket and not the 3.3V one?
When selecting a Schottky diode, which I be looking for in ratings?
I want to stop the effect automatically (not via a manual switch) when the environment is bright. My first thought is to handle this in the Trinket’s logic, using a photoresistor for input. However, this means the Trinket has to constantly be on, thus constantly consuming power. Is there a way to toggle power to the Trinket itself? For example, when the current coming from the cell falls bellow a threshold (i.e. it’s dark out), turn the Trinket on and when the current exceeds that threshold (i.e. it’s light out), turn it off.
Edit: I’d still want an overriding off switch, but that seems simple enough.
Also, wont 4 AA in serial not produce enough voltage (4 * 1.2V = 4.8V) for the Trinket 5V (recommended 5.5V+)?
timsharoo:
Why go with the 5V Trinket and not the 3.3V one?
Because you'll be driving the LEDs directly from the Trinket and 3.3v isn't enough for the G and B LEDs. Also using a 3.3v Trinket means keeping it's 3.3v regulator running. What I propose is that you bypass the 5v regulator (remove it even!) and run directly off the battery pack. The "brain" of a Trinket is an ATtiny85, which will happily run off of anything btw 2.7v to 5.5v, just at lower clock speeds for the lower voltages. A 3.3v Trinket has the same ATtiny85 as a 5v one, just at 3.3v and 8Mhz (vs 16). Hence my recommendation that you run at 8 MHz, a simple software selection from what I've read.
timsharoo:
When selecting a Schottky diode, which I be looking for in ratings?
Nothing special. The peak forward current might be 200 mA, the average < 100. A reverse breakdown voltage enough to stop the charged 6v battery pack, so a spec of 9v or larger.
timsharoo:
Is there a way to toggle power to the Trinket itself?
I know the ATtiny85 has a number of power saving and sleep modes. I'm sure it could be put to sleep for 10 mins at a time, waking up for 1 sec to measure stuff and decide what to do. That's a common thing for microcontrollers to do. What I'm very dubious of is that it can drive the LEDs when sleeping. Moreover I will guess the LEDs are 70% of the power consumption. Reducing the 30% to even 0 won't make a critical difference. But I'll see what might be done.
Thanks again for the helpful response! I feel like I am narrowing in on a solution.
Mee_n_Mac:
Also using a 3.3v Trinket means keeping it’s 3.3v regulator running.
I get not being able to drive green and blue, but what's wrong with having a regulator?
Mee_n_Mac:
I’d even remove the regulator.
Same question as above.
Mee_n_Mac:
What I’m very dubious of is that it can drive the LEDs when sleeping.
The point is to have it off when I don't need to drive the LED and on when I do, essentially. Sorry if I was unclear.
timsharoo:
Thanks again for the helpful response! I feel like I am narrowing in on a solution.
Mee_n_Mac:
Also using a 3.3v Trinket means keeping it’s 3.3v regulator running.
I get not being able to drive green and blue, but what's wrong with having a regulator?
Mee_n_Mac:
I’d even remove the regulator.
Same question as above.
Power saving. A regulator uses some power to run itself as well as providing regulated voltage. If your battery is well regulated, why waste the power ?
timsharoo:
Mee_n_Mac:
What I’m very dubious of is that it can drive the LEDs when sleeping.
The point is to have it off when I don't need to drive the LED and on when I do, essentially. Sorry if I was unclear.
Having the Trinket sleep while it's sunny and charging, waking up for a sec every some mins to see if it's "LED time" should be doable.
Also, is there any reason to use a Trinket instead of the attiny85 directly? There is documentation on programming them with an Arduino Uno (which I have) and it seems trivial. Asides for a voltage regulator (which I am bypassing) and a USB programmer (which I can replace with an Uno), does the Trinket bring anything else to the table?
Sparkfun has one here https://www.sparkfun.com/products/9378
timsharoo:
Also, is there any reason to use a Trinket instead of the attiny85 directly?
Nope, other than my assumption up front ..."(assuming you don't care to deal w/naked parts)". I don't know how breadboarding or PCB making fits into your skill set.
Mee_n_Mac:
timsharoo:
Also, is there any reason to use a Trinket instead of the attiny85 directly?
Nope, other than my assumption up front ..."(assuming you don't care to deal w/naked parts)". I don't know how breadboarding or PCB making fits into your skill set.
Breadboarding is fine and dandy. PCB making... If the PCB is already made, then sure! I have no trouble putting together kits, but when it comes to universal PCBs, I'm a mess. Mounds of solder everywhere and wires leading off to nowhere convenient. I'll get better if I practice.
Does that information change any of your suggestions? I have already learned a lot.
As you know, with the Trinket there’s one with an operating logic voltage of 5v and another with 3.3v. How does operating logic voltage factor in with the ATTiny85? Do I just put out roughly what I get in?
timsharoo:
As you know, with the Trinket there’s one with an operating logic voltage of 5v and another with 3.3v. How does operating logic voltage factor in with the ATTiny85? Do I just put out roughly what I get in?
Sorry, I don't understand the question. If you mean that when you command a digital pin to a logic high output state, you get either 3.3 or 5 volts out, depending on the supply voltage, then yes ... you get out roughly what you put in. So to drive 20 mA through an LED that drops ~3.4v @ 20mA, you output ~5v through a (5-3.4)/0.02 = 80 ohm resistor to the LED. A higher resistance for the R channel as it drops less voltage.