I'm going to be building a remote data logger powered by an atmega32u4 with a USB interface (for data transfer after acquiring the data) and powered by a solar panel in the field. The root of the problem is that I need to run at a much faster clock speed than I want to so I can support the USB. My operational voltage range is 4.5v to 5.5v. I was just going to use a large capacitor between Vcc and Gnd to smooth out the power and to keep it powered while shadows move over it briefly. I was going to use a 6v 2W solar panel. My first question is what do I need to do to ensure I don't ever get more than 5.5v to the MCU? The difference is too small for voltage regulators and such. I was thinking just a small resistor in series. Are there better ways to handle such small differences? The datasheet does given an absolute max. Vcc of 6v, but I'd rather not push it.
My second question is will shadows on the panel be enough to drop the voltage below 4.5v or would it have to get pretty dark? This is my first solar project and really don't know what to expect. I don't have any panels, yet. I would like to avoid using a battery if at all possible, but would if necessary. Will the power be stable enough for A/D conversions?
Thank you in advance for your help!
Solar Powered AVR
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 178
- Joined: Mon Sep 03, 2007 4:50 pm
Re: Solar Powered AVR
What do you do at night?
I haven't used any solar panels for powering a project so far but because of the question above,
I think I'd always use one to charge a rechargeable and not to power a project directly..
I haven't used any solar panels for powering a project so far but because of the question above,
I think I'd always use one to charge a rechargeable and not to power a project directly..
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
I don't care about the night. The data is irrelevant without the sunlight. That's why I was looking at directly powering the thing.
- adafruit_support_bill
- Posts: 88149
- Joined: Sat Feb 07, 2009 10:11 am
Re: Solar Powered AVR
A couple of issues:
1) The output will vary considerably between dawn & noon & dusk. It will vary further depending on cloud cover. Even just a passing cloud can have a sizeable effect.
2) If you are bypassing the voltage regulators, the varying input voltage (even if it is within specs for the MCU) will change your analog reference voltage and affect on your analog readings.
You could use a low-dropout regulator to keep the voltage under 5.5v, but there is nothing to guarantee it won't drop under 4.5.
Something like the Solar MintyBoost projectshould suit your requirements.
1) The output will vary considerably between dawn & noon & dusk. It will vary further depending on cloud cover. Even just a passing cloud can have a sizeable effect.
2) If you are bypassing the voltage regulators, the varying input voltage (even if it is within specs for the MCU) will change your analog reference voltage and affect on your analog readings.
You could use a low-dropout regulator to keep the voltage under 5.5v, but there is nothing to guarantee it won't drop under 4.5.
Something like the Solar MintyBoost projectshould suit your requirements.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
I'm also new to the ATmega32u4 (though not new to other AVR's) and I've just been reading up on the datasheet when I came across Page 34. Here's a quote:
"6.7 Clock Switch
The ATmega16U4/ATmega32U4 product includes a Clock Switch controller, that allows user to
switch from one clock source to another one by software, in order to control application power
and execution time with more accuracy."
It looks like I can adjust the clock source from software. Perhaps I could start the firmware with the internal RC at a low clock speed and switch to the external oscillator if it detects it is running at 5v (e.g. plugged into the USB)? Then I can use a 3v regulator for when it is self-powered and remain on the internal oscillator. That should increase my operational voltage range by a little. Is it enough? I'll have to wait for parts to come in so I can do some testing...
Thank you!
"6.7 Clock Switch
The ATmega16U4/ATmega32U4 product includes a Clock Switch controller, that allows user to
switch from one clock source to another one by software, in order to control application power
and execution time with more accuracy."
It looks like I can adjust the clock source from software. Perhaps I could start the firmware with the internal RC at a low clock speed and switch to the external oscillator if it detects it is running at 5v (e.g. plugged into the USB)? Then I can use a 3v regulator for when it is self-powered and remain on the internal oscillator. That should increase my operational voltage range by a little. Is it enough? I'll have to wait for parts to come in so I can do some testing...
Thank you!
-
- Posts: 114
- Joined: Tue Jan 25, 2011 6:09 pm
Re: Solar Powered AVR
While I agree with uhe for using a battery, and night time is not a problem for you. A small rechargeable LiPo battery would give you a steady power source to suffice unpredictable cloud shades and sun positions throughout the day.
Also I think getting a solar panel with higher voltage (9v maybe?), regulated to 5 volts would save you from voltage drop, say when that solar panel is receiving less sun light, you would still have like 6v then regulated to 5v, versus a 6v panel receiving less light that it drops to 4.5v.
I'm still suggesting you use a small rechargeable, or coin cell battery for this. As my previous topic was about AVR's resetting on voltage drop. You might get inaccurate data when that happens.
Also I think getting a solar panel with higher voltage (9v maybe?), regulated to 5 volts would save you from voltage drop, say when that solar panel is receiving less sun light, you would still have like 6v then regulated to 5v, versus a 6v panel receiving less light that it drops to 4.5v.
I'm still suggesting you use a small rechargeable, or coin cell battery for this. As my previous topic was about AVR's resetting on voltage drop. You might get inaccurate data when that happens.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
I was really trying to avoid using a Li-ion battery because the main part of the project is a basic circuit and I'd really need to introduce a much more complicated circuit to handle the Li-ion charging (if I make it or buy it). I was hoping a 1F or 1.5F capacitor could smooth things out enough. I would be more apt to use NiMH than Li-ion, just to keep the circuit simple. I'm just trying to keep the part count low and the size of the project small.
-
- Posts: 114
- Joined: Tue Jan 25, 2011 6:09 pm
Re: Solar Powered AVR
It's always up to you. I'm just suggesting what might save you from probable hassles in the future. Low part count vs. reliability, I'm gonna go for reliability for the long run. As weather/climate changes overtime, a small backup battery is not so bad.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
I appreciate that, which is why I asked in the first place. Would a NiMH not be as reliable as Li-ion? The NiMH probably wouldn't like the trickle charge, would it? I guess I could try Maxim's MAX8934G: http://www.maxim-ic.com/datasheet/index.mvp/id/6822. Might be a good excuse to try it out. Ever use one before?
-
- Posts: 178
- Joined: Mon Sep 03, 2007 4:50 pm
Re: Solar Powered AVR
Btw. how fast do you have to run?cyberpenguin wrote:The root of the problem is that I need to run at a much faster clock speed than I want to so I can support the USB.
The only comment I've seen in the datasheet is "For USB full-speed operation only external crystal oscillator or external source clock can be used." but nothing about the clock rate.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
Off the USB (in the field) 1MHz would be more than fast enough. I only need a higher clock rate to support USB.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
I wanted to update this thread on a couple fronts, since I have received and played around with the necessary hardware.
The solar panel produces a lot more voltage than I thought. I've seen voltages almost to 8v in the sunlight and 5v in the shade (haven't tested dawn or dusk sunlight, yet). The problem is more on the high side then the low side. It isn't enough to drive a voltage regulator in the shade but too much to connect a microcontroller to it in the direct sunlight. A 3v regulator may do the trick, but a more complicated power supply is probably in order.
Switching the clock from one to the other on the atmega32u4 works great (without the bootloader... I'll explain). Programming with a programmer and not using USB-aware firmware I was able to switch between the external and internal oscillators just fine (complete with powering down the one not currently used). The datasheet shows a 32u4 can operate at 2.7v at 8MHz. It works as advertised. I tried both with the fuses set to external and switching in firmware to internal and vice-verse. The USB firmware and bootloader would need to be rewritten to support booting off the internal oscillator and quickly switch to the external if the voltage is high enough to support it (e.g. attached to USB). I'm not sure if all that can be done before the host OS times out, but I'll give it a shot sometime soon to see. On a side note I didn't have much success in change the prescaler in run-time. I wasn't too concerned with that sense 8MHz supports the voltage range I was interested in.
The solar panel produces a lot more voltage than I thought. I've seen voltages almost to 8v in the sunlight and 5v in the shade (haven't tested dawn or dusk sunlight, yet). The problem is more on the high side then the low side. It isn't enough to drive a voltage regulator in the shade but too much to connect a microcontroller to it in the direct sunlight. A 3v regulator may do the trick, but a more complicated power supply is probably in order.
Switching the clock from one to the other on the atmega32u4 works great (without the bootloader... I'll explain). Programming with a programmer and not using USB-aware firmware I was able to switch between the external and internal oscillators just fine (complete with powering down the one not currently used). The datasheet shows a 32u4 can operate at 2.7v at 8MHz. It works as advertised. I tried both with the fuses set to external and switching in firmware to internal and vice-verse. The USB firmware and bootloader would need to be rewritten to support booting off the internal oscillator and quickly switch to the external if the voltage is high enough to support it (e.g. attached to USB). I'm not sure if all that can be done before the host OS times out, but I'll give it a shot sometime soon to see. On a side note I didn't have much success in change the prescaler in run-time. I wasn't too concerned with that sense 8MHz supports the voltage range I was interested in.
-
- Posts: 114
- Joined: Tue Jan 25, 2011 6:09 pm
Re: Solar Powered AVR
And that would be 12MHz.I only need a higher clock rate to support USB.
Sure you aren't considering adding a back-up power supply? IMHO, regulators are a waste, they remove excess voltage, which you could've use for other purposes. Switching from 5v to 3v regulator does just that more. Though you can record the ranges your solar panel outputs in a normal day (with partial cloud covers from time to time), and if the lowest sunlight can power up your 3v regulator, then you'll be okay.
-
- Posts: 15
- Joined: Wed Feb 09, 2011 2:05 pm
Re: Solar Powered AVR
Yes, I am still considering a backup power supply. More so than ever. I would probably need some sort of switching converter instead of a linear regulator. It's out of my comfort zone, but that's the fun of it all. I'm still looking at the MAX8934G as a possible solution for charging and regulating in one little IC. It's a 28-pin 4mmx4mm TQFN package that could easily fit in my PCB design.
-
- Posts: 114
- Joined: Tue Jan 25, 2011 6:09 pm
Re: Solar Powered AVR
Great! Do tell how it performs after you've done it.Yes, I am still considering a backup power supply. More so than ever. I would probably need some sort of switching converter instead of a linear regulator. It's out of my comfort zone, but that's the fun of it all. I'm still looking at the MAX8934G as a possible solution for charging and regulating in one little IC. It's a 28-pin 4mmx4mm TQFN package that could easily fit in my PCB design.
Please be positive and constructive with your questions and comments.