I want to design a circuit for a rechargeable battery (or batteries) that can be charged by both a solar panel and a generator. I am working on the same project as described here, but my focus is on the actual switching between the two sources of power generation (rather than how much power the generator will produce).

Here's a rough description of the system:

2 sources of power:

  • solar panel that supplies continuous power while system is idle
  • generator that supplies a burst of power when system is active momentarily (< 5 seconds)

2 or more batteries:

  • a "primary" battery that acts as the voltage supply for the rest of the system
  • a "backup" battery that is continuously being charged by the solar panel
  • a "secondary backup" battery that will be charged in bursts by the generator

The idea is to have the primary battery dedicated to supplying power for the system, and switch this with the backup battery when the voltage of the backup exceeds the primary (using an analog comparator perhaps), or when the voltage of the primary depletes below a certain amount.

The context of this project is essentially a fingerprint authenticated door lock system that is powered by the two sources mentioned. The handle

Here are some of my thoughts and questions:

  • Do I need three batteries to be charged separately? Or should I only have a primary battery and one backup battery? What's the best type of battery for this?
  • The latter option would require switching between the solar panel and generator whenever the generator is activated, i.e. stop the charging from the solar panel and allow a burst of charge from the generator, then resume charging from the solar panel.
  • Thus, I would have to figure out if the power generated by the generator in the amount of time it takes to turn the handle is greater than the power "lost" by not charging through the solar panels for that period of time.

The circuit I've come up with so far looks like this:


simulate this circuit – Schematic created using CircuitLab

It is more of a general idea than a real circuit schematic.

The solar panel and generator are switched using a PNP transistor. When the generator is outputting a voltage at the base of the PNP, the current from the solar panel stops flowing. When the generator is not outputting a voltage, the current from the solar panel is let through the PNP from emitter to collector.

Now the next part does not make sense schematically. The comparator is meant to compare the voltage of the two batteries. The one that has less voltage should be charged by either the generator or solar panel. This is called the back up battery.

The next comparator again (redundantly?) compares the voltage of the same two batteries. The one that has greater voltage will become the primary battery, which supplies power to the rest of the system.

Does this idea seem reasonable? How can I efficiently switch between the batteries based on their relative voltage? (Low power consumption is a huge consideration here.)

Thank you for taking the time to read over my ideas. I would really appreciate any help with this!

  • \$\begingroup\$ You are still in the system definition stage and it is hard to give definitive answers since they would depend on the system requirements and details of the components. But in general, my approach would probably be using a uC as the controller. It would have a number of ADC channels for monitoring the voltage levels. The actual switching would be simple MOSFET circuits. \$\endgroup\$
    – rioraxe
    Jan 30, 2015 at 22:11
  • \$\begingroup\$ The system needs 10.86 Wh, but 10 Wh are due to having a fingerprint reader that is continuously on. If we can switch that component off and on then we need less than 1Wh of power. We are using a PIC24 microcontroller with 10-bit ADC so your suggestion for battery monitoring is a good idea. However, my question then is do I need to switch between batteries in this manner or can I just switch charging on and off for one battery? \$\endgroup\$
    – Christina
    Jan 31, 2015 at 3:23
  • \$\begingroup\$ If you are using 9V batteries, then connecting them both to the system with schottky diodes of say 0.5V drop does not result in a lot of loss. So that could be one way and is simple. And if one battery is rechargeable and the other is not, that is a possible configuration. But ultimately, it really depends on your requirements. \$\endgroup\$
    – rioraxe
    Jan 31, 2015 at 22:26
  • \$\begingroup\$ A 9V battery would unfortunately not be an option because it is a small system and thus has a size constraint. I was looking at AAA batteries, but they just need to be smaller than about 100 mm x 80 mm (they must fit inside a small enclosure behind a 1 W solar panel). \$\endgroup\$
    – Christina
    Feb 1, 2015 at 6:17
  • \$\begingroup\$ I took the 9V batteries from your diagram. It shows why it is hard to give good relevant answers when the scope is still wide open. \$\endgroup\$
    – rioraxe
    Feb 1, 2015 at 7:42

1 Answer 1


I think that a very good option is to take advantage of the PIC uC that you already have in your design and its analog (ADC) input ports for monitoring the batteries voltage and to drive the switching between those batteries using MOSFETs instead of BJT transistors. Using the uC you should not need the two comparators that you show in the picture and you will have a more intelligent charging/monitoring battery circuit that could lead to improve the batteries duration. This uC could stay in sleep mode (or low power mode as second option) all the time using interrupts to read the ADC channels. You should run the uC from its internal RC oscillator operating at the lowest frequency as possible to decrease the power consumption.

I also recommend you using Schottky diodes instead of 1N4148 and to put a small bulk capacitor at the output of the power selector circuit (or switching circuit). Those Schottky diodes will drop less voltage than the 4148.

If you decide to use the uC for the battery voltage level monitoring, try to use the internal fixed voltage thresholds that the uC provides for the internal comparators, because if you don't do that you could have some problems reading wrong analog values because those batteries are used to power the uC too (you will have ratiometric voltages).

I hope this help.


Your Answer

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

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