Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Lord Stimperor
Jun 13, 2018

I'm a lovable meme.

Hello everyone,

I want to build something for my dad. He has a large model lighthouse in his window that needs a light. I want to make that for him. I have very little understanding of electrics and electronics, but I have build a couple of game controllers and keyboards using off-the-shelve switches and programmable micro-controllers. I should be able to follow instructions if they’re simple enough.

Here’s what I need to build:

1. An LED light that blinks
2. During nighttime, the light is powered through a battery (cannot use power outlet)
3. That battery charges during the day with a small solar panel

My idea was to do this with an Arduino micro pro: put a couple of lights on the controller and have the controller run a blinking lights program. This would also allow you to cycle through modes with a button. This is the easy part that I can do myself.

The difficult part is to power everything. I essentially want there to be a battery which is charged through a solar panel*. Further, during daytime, the flow from the battery to the Arduino should be interrupted. Essentially, I’m looking to build a small, solar-powered powerbank that stops putting out power when it’s charging. This is a schematic of what I want to build, and it’s the grey part that I need help with:




Here are my questions:
• Can you point me to instructions how to build a safe "solar-powered power bank" for this?
• How can I interrupt power output when it’s charging (receiving sunlight)?


*My father has an LED gadget that does this but there’s not any kind of protection for the battery, and the entire thing runs at 1,2V, too low for an Arduino.

Adbot
ADBOT LOVES YOU

AgentCow007
May 20, 2004
TITLE TEXT
So you probably want to get a small lipo with a pre-made charging/protection unit: https://www.adafruit.com/?q=lipo%20charger They usually have solder pads for power input; just find a panel that matches the voltage input range.

Of course, dont let the lipo sit in the sun.

Dairy Days
Dec 26, 2007

NIMH rechargeable batteries are forgiving enough you can directly wire a solar panel to a few of them connected in series if you match the charged voltage of your battery pack and the solar cell voltage. If you are dead set on the arduino you could put a diode in between the solar panel and the batteries and sense the solar panel voltage with the arduino to see if it is sunny, but to be honest this sounds like a problem that can be solved with 4 transistors.

Dairy Days fucked around with this message at 00:42 on Oct 10, 2019

Lord Stimperor
Jun 13, 2018

I'm a lovable meme.

AgentCow007 posted:

So you probably want to get a small lipo with a pre-made charging/protection unit: https://www.adafruit.com/?q=lipo%20charger They usually have solder pads for power input; just find a panel that matches the voltage input range.

Of course, dont let the lipo sit in the sun.

I had considered one of these units. There are tutorials on YouTube where people build power banks with pre-built units that come with charge management and battery protection. But maybe this is a little overblown. I wouldn't let a battery sit in the sun directly, but it should be fine to let it sit in a case that's exposed to sun, right?


Dairy Days posted:

NIMH rechargeable batteries are forgiving enough you can directly wire a solar panel to a few of them connected in series if you match the charged voltage of your battery pack and the solar cell voltage. If you are dead set on the arduino you could put a diode in between the solar panel and the batteries and sense the solar panel voltage with the arduino to see if it is sunny, but to be honest this sounds like a problem that can be solved with 4 transistors.

I didn't know that NiMH batteries were easier to work with. I guess then it makes sense that the gadget we have has wires going straight from the solar panel to the battery. A few questions:

* To get the 5,5V I want to put a few batteries in series. Do I then need a solar panel that can put out 5,5/6V in order to charge them? How wide are the tolerances typically?
* I want to go with the 4 transistors. But what do I do specifically? I think I want the transistors to go between the battery pack and the arduino, with a further connection to the solar panel. If the solar panel voltage goes below a certain (to be determined) threshold, the transistor should close the circuit between the batter pack and the arduino so that the arduino turns on. Is there a name for this thing so that I could look for some examples?

Dairy Days
Dec 26, 2007

Lord Stimperor posted:

I didn't know that NiMH batteries were easier to work with. I guess then it makes sense that the gadget we have has wires going straight from the solar panel to the battery. A few questions:

* To get the 5,5V I want to put a few batteries in series. Do I then need a solar panel that can put out 5,5/6V in order to charge them? How wide are the tolerances typically?
* I want to go with the 4 transistors. But what do I do specifically? I think I want the transistors to go between the battery pack and the arduino, with a further connection to the solar panel. If the solar panel voltage goes below a certain (to be determined) threshold, the transistor should close the circuit between the batter pack and the arduino so that the arduino turns on. Is there a name for this thing so that I could look for some examples?

To get around 5.5v you would put 4 NIMH batteries in series, for a total charged voltage of 6v that will rapidly drop to about 5 for most of the capacity followed with lowering to around 4v when they are nearly flat, and you would charge them with a 6v panel or some combination of series panels totaling 6 volts. According to google, the regulator on the arduino pro micro in your image will regulate any input voltage less than or equal to 12v on the raw pin down to 3.3v or 5v depending on which version you have, but note that if you want to use the 5v version then you should use more batteries in series to make sure the regulator doesn't drop out at half charge. Also your solar panel can be rated slightly below but never above the charged pack voltage, unless you like replacing batteries.

The 4 transistors reference is not a solar switching thing, but an observation that the entire desired effect could be produced with something like 4 transistors and no arduino, maybe like this

There are probably 100 ways to tackle this. I think you could get it down to 2 transistors if you had time to mess around with reverse breakdown. This circuit would give a nice transition between on and off instead of a hard blink, but you would want to play around with values to get it to suit your tastes, and if you wanted to, a low voltage cutoff to protect the batteries could be added with a zener or voltage reference and another transistor.

If you don't have parts on hand and/or it seems a little over your head I would recommend you do something like this

Make sure your diode is rated with a continuous current at or above the maximum current the panel can put out, but if you are just using AA NIMH batteries something standard like a 1n4001 or 1n5817 should be fine because you really shouldn't be trying to stuff more than half an amp down that size battery anyway. In your code just check the panel voltage with the ADC periodically. When its obvious the sun is up, you can put the arduino into sleep mode with a watchdog timer to check if the sun has gone down every few minutes or something, it shouldn't draw enough power in the shutdown state to run your batteries down, even if its too cloudy to charge for a few days, as long as your LED is just a standard tiny 20 milliamp job. if your LED is something larger you might want to get some NIMH D cells or something, obviously with a panel that is realistically capable of supplying enough charge during the day time. I'm not sure if the arduino ADC has a built in reference, but something else you might also want to do is sense the pack voltage and not blink the led at night if the batteries don't have enough charge to support it, because the batteries will also be damaged if they are over discharged.

Slack3r
Feb 20, 2004
Easiest way is order a $6 LM3909 from eBay. Follow the extremely simple schematics on the internet and use a few "D" cells. If I remember right, a 6V lantern battery will run a single LED on an LM3909 for 5 years or more. It has a CRAZY low draw. I think the "D" cells would last for almost a year. Just replace the 2 D cells every year or two.

Lord Stimperor
Jun 13, 2018

I'm a lovable meme.

Slack3r posted:

Easiest way is order a $6 LM3909 from eBay. Follow the extremely simple schematics on the internet and use a few "D" cells. If I remember right, a 6V lantern battery will run a single LED on an LM3909 for 5 years or more. It has a CRAZY low draw. I think the "D" cells would last for almost a year. Just replace the 2 D cells every year or two.

This is a very interesting idea, thank you for it! It's probably the economical one. I have looked at a few examples, but I think I'm not feeling comfortable with the LM3909. There's a bit of a learning curve that I haven't climbed there. I think I'll gently caress this up when I try to build this.



Dairy Days posted:


To get around 5.5v you would put 4 NIMH batteries in series, for a total charged voltage of 6v that will rapidly drop to about 5 for most of the capacity followed with lowering to around 4v when they are nearly flat, and you would charge them with a 6v panel or some combination of series panels totaling 6 volts. According to google, the regulator on the arduino pro micro in your image will regulate any input voltage less than or equal to 12v on the raw pin down to 3.3v or 5v depending on which version you have, but note that if you want to use the 5v version then you should use more batteries in series to make sure the regulator doesn't drop out at half charge. Also your solar panel can be rated slightly below but never above the charged pack voltage, unless you like replacing batteries.

The 4 transistors reference is not a solar switching thing, but an observation that the entire desired effect could be produced with something like 4 transistors and no arduino, maybe like this

There are probably 100 ways to tackle this. I think you could get it down to 2 transistors if you had time to mess around with reverse breakdown. This circuit would give a nice transition between on and off instead of a hard blink, but you would want to play around with values to get it to suit your tastes, and if you wanted to, a low voltage cutoff to protect the batteries could be added with a zener or voltage reference and another transistor.

If you don't have parts on hand and/or it seems a little over your head I would recommend you do something like this

Make sure your diode is rated with a continuous current at or above the maximum current the panel can put out, but if you are just using AA NIMH batteries something standard like a 1n4001 or 1n5817 should be fine because you really shouldn't be trying to stuff more than half an amp down that size battery anyway. In your code just check the panel voltage with the ADC periodically. When its obvious the sun is up, you can put the arduino into sleep mode with a watchdog timer to check if the sun has gone down every few minutes or something, it shouldn't draw enough power in the shutdown state to run your batteries down, even if its too cloudy to charge for a few days, as long as your LED is just a standard tiny 20 milliamp job. if your LED is something larger you might want to get some NIMH D cells or something, obviously with a panel that is realistically capable of supplying enough charge during the day time. I'm not sure if the arduino ADC has a built in reference, but something else you might also want to do is sense the pack voltage and not blink the led at night if the batteries don't have enough charge to support it, because the batteries will also be damaged if they are over discharged.


Sorry for the late reply, I was quite busy (still am :( ). My micro pros are the 16 Mhz/5V ones, so I got around making a shopping list with a 6V battery pack and 4,5V solar panel. There are some spares/alternatives/packs in there to be safe. Does this sound good?

Adbot
ADBOT LOVES YOU

Dairy Days
Dec 26, 2007

Lord Stimperor posted:

My micro pros are the 16 Mhz/5V ones
According to the datasheet of the regulator (micrel 5219) on the arduino micro pro, assuming you are running all 3 LEDs at maximum brightness, it will cut out at around 5.2 volts on the raw pin. You should go with at least 6 cells so you don't have drop outs in a partially discharged (but still safe) state. The regulator on that board is a simple LDO, so while it can lower any input voltage from around 5 - 12 volts to the vcc voltage of 5 it has no ability to raise voltages, therefore you will want to have more batteries otherwise it will be forced to power off for the majority of the charge. Additionally a 4.5v panel won't do anything as far as your arduino is concerned for this same reason, the batteries will just drop below 5 - 5.2 volts and be considered dead by the regulator even though they are being maintained at 4.5v, unless the panel you're talking about has an open circuit voltage higher than that and it's just a rating based on some arbitrary load (usually cheap solar cells don't have datasheets). Refer to the battery charge chart i posted, the peak multiplied by the number of cells in series will be your 100% charge voltage, while the large plateau in the middle will be the voltage the pack operates under for the majority of its not absolutely full charge state. You will need a solar cell to match the charged pack voltage, but when I said you can have a panel rated slightly below it was more of a statement about 100 or so millivolts not a volt and a half. You might be better off buying some of those cheap pre epoxied cells that are rated 1.2-1.5v and wiring them in series to match your pack, so that you can test the no load voltage.
I've also seen that the arduino pro micro does in fact have a an internal reference for its ADC which means you can check the pack voltage reliably and enter sleep mode when you don't have enough capacity to run the lights if it's been cloudy for a while, which will be important if you are planning to run this off AAA size cells. You should set this level to be around 1.15 - 1.1 multiplied by the number of cells, and measure it through a resistor divider similar to the one I drew in that crappy schematic because most ADCs are incapable of reading voltages very near to or above their supply voltage properly, and because the ADC power comes from the regulator it will always be below the battery pack voltage.
But I think you should really consider ordering some lm3903s and lantern batteries, because it is one of the most easy to work with ICs and what I am describing above is a skill level beyond implementing it. Order several and if you blow one up, you can analyze the circuit you constructed and learn why it was wrong.

Dairy Days fucked around with this message at 01:02 on Oct 21, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply