I'm doing a charger from a solar panel for a Cubesat project for my university.

I made the buck converter from a 20 V solar panel in order to charge the battery. This works well with Arduino, where I can limit the current to the battery.

My question is now how to connect the solar panel and the battery to my load. There are four different situations:

  1. If the battery isn't charged, the solar panel has to charge the battery and also power supply the load.
  2. If the battery isn't charged and the solar panel cant get solar radiation (eclipse zone) the system will go to sleep until the solar panel can generate energy.
  3. If the battery is charged and the solar panel is "ON", the solar panel will power supply the load.
  4. If the battery is charged and the solar panel is "OFF" (eclipse zone), the battery will power supply the load.

I thought about a relay system (or toggle switch, MOSFET, BJT...) for this issue, but my question is:

When the system is in No.1 situation, how many amps will go to the battery if I have several ohms (10-20) as load? More specifically, how can I limit the current towards the load so that I can charge the battery with the current value specified in the Arduino code. Using an adjustable LM317?

I'm using a 20 V solar panel with 1.5 A maximum, and also a 7.4 V 910 mAh LiPo battery 2S.

If you need more specifications, just tell me. Thanks in advance!

Edit with schematic idea: Schematic Idea

  • \$\begingroup\$ Welcome! Please draw a block diagram of what you have and how it's currently connected. \$\endgroup\$
    – winny
    Nov 22, 2021 at 15:16
  • \$\begingroup\$ have you looked at off the shelf Cubesat power systems? \$\endgroup\$
    – user16324
    Nov 22, 2021 at 15:21
  • 4
    \$\begingroup\$ Your description sounds overly complicated. Why can't the load always be powered by the battery, and why can't the solar charger simply charge the battery whenever sunlight is available and the battery is at less than 100%? Battery chargers with which I am familiar (including several that I personally own) have no problem with something drawing power from the battery at the same time that the charger is trying to charge the battery. \$\endgroup\$ Nov 22, 2021 at 16:02
  • 2
    \$\begingroup\$ It is common practice to connect a charging source, battery, and load in parallel - cars are wired this way. If the charger can supply more current that the load requires, the excess will be used to charge the battery. If the charger supplies less current than the load requires, the battery will discharge into the load. The system will switch between charge and discharge automagically as the current available from the charger and current required by the load vary. \$\endgroup\$ Nov 22, 2021 at 16:33
  • 1
    \$\begingroup\$ ” Because you cant charge the battery and at the same time discharge to suppy power to the load” Sure you can. It’s being done every day in millions of devices being plugged in yet have a battery inside them. Moreover, relays in a satellite? Last time I checked they were banned. \$\endgroup\$
    – winny
    Nov 22, 2021 at 18:05

1 Answer 1


Using an adjustable LM317?

No. Just no. There's a lot of reasons, but the top two are power consumption and it wouldn't work anyway.

First, the LM317 is a linear regulator, and linear regulators work by burning up power in the output transistor (dig up a schematic and look -- the output current is always a bit less than the input current, and has to be). So you're taking all that valuable energy you're getting from the solar panels and just burning it up.

Second, loads don't work that way. If everything in the satellite is powered with switching supplies (see "First", above) then they will draw roughly constant power from the power rail, until there's not enough voltage. Drop the voltage, and the current will go up, not down.

Here's a suggested approach:

  • Run the satellite off of the battery power rail. Then you don't have to worry about switching. When you're charging, current goes into the rail from the solar cell controller and comes out of the rail to the battery and the satellite peripherals, and everyone's happy.
  • Manage the solar cells with an maximum power point tracker (MPPT) to get the most energy out of them, unless the batteries are fully charged and the satellite is running full blast -- then just take as much power as you need.
  • Charge the batteries opportunistically -- i.e., take as much current as you can after the satellite has gotten what it wants, unless the cell voltage is at 4.2V, in which case regulate the charge current down to maintain a good charge on the batteries.
  • If the batteries are depleted, or there's otherwise reason to conserve power, shed load by turning off bits of the satellite -- this is what you're trying to do with the LM317, but it's a more deliberate and intentional process, where you tell peripherals to shut themselves down.

Finally -- this is a solved problem. There's commercial solutions out there (if you have tens of thousands of dollars lying around), and there's at least one open-source rocketry and satellite initiative. Check out https://www.oresat.org/ -- they haven't flown a satellite yet, but there's one in pre-launch as I write this (November 2021).

They already have the battery management system figured out. Even if you don't use any of their actual designs, there's a bazzilion design details that have been thought of and documented, so you can read up on what they did and why, and use that to guide your design (or, just use the design because it's open source).

  • \$\begingroup\$ Did you mean voltage instead of current for "the output current is always a bit less than the input current, and has to be"? While the statement is true, I'm not sure what the relevance is (the ground current for LDOs these days is often measured in single digit uA). The output transistor would be burning up power regardless of ground current, because its dropping voltage across it in relation to the output current, which will be far larger than the ground current. \$\endgroup\$
    – BeB00
    Nov 22, 2021 at 16:27
  • \$\begingroup\$ Thank you very much for your explaination Tim. Did you saw my schematic? What do you think about it? \$\endgroup\$ Nov 22, 2021 at 16:29
  • 1
    \$\begingroup\$ Nope. It is a three-terminal device, it needs to take some of the power coming into the input terminal to power its electronics, the output transistor cannot multiply current because it is not a switching supply, so the input current must be at least slightly larger than the output current. \$\endgroup\$
    – TimWescott
    Nov 22, 2021 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.