1

I am building a RC car with a Raspberry Pi 3, and I would like to power the Raspberry with a battery. However, when the Raspberry is off, I would like to switch from the battery powering the Raspberry, to the battery being powered by a photovoltaic cell.

The battery has only two wires through which you can charge or discharge it. In this case, I cannot charge the battery while it is discharging.

Considering that even when shut down, Raspberry Pi draws some current, how could I determine that the Raspberry has turned off, so I can switch off power between the battery and Raspberry, and switch on power between the solar cell and battery?

Greenonline
  • 2,969
  • 5
  • 27
  • 38
George Lazu
  • 131
  • 1
  • 5

2 Answers2

1

You can use the following to signal when the Pi has shutdown. This is commonly used to control power to the Pi.

Name:   gpio-poweroff
Info:   Drives a GPIO high or low on poweroff (including halt). Enabling this
        overlay will prevent the ability to boot by driving GPIO3 low.
Load:   dtoverlay=gpio-poweroff,<param>=<val>
Params: gpiopin                 GPIO for signalling (default 26)

        active_low              Set if the power control device requires a
                                high->low transition to trigger a power-down.
                                Note that this will require the support of a
                                custom dt-blob.bin to prevent a power-down
                                during the boot process, and that a reboot
                                will also cause the pin to go low.
Milliways
  • 62,573
  • 32
  • 113
  • 225
0

I have done a lot of remote weather sensor installations and RC model flying, my advice would be to connect the charger to the battery all the time. There's no point turning the charging on or off, and if you're lucky you may run your electronics right off the charger, giving your battery the rest.

Could not imagine any reason, why the charger cannot be always connected to the battery.

lenik
  • 11,533
  • 2
  • 32
  • 37