Translate

Thursday, May 4, 2017

5v Solar Power Supply for Raspberry Pi - Enhanced RPOf

This article describe an idea about a 5v Solar power supply for Raspberry to be used with the fHelper project. Another article describes some tests on the 5v Solar power supply.
in particular this article discuss about the requirements for the Enhanced RPOf (eRPOf).

The goal is to have a 5V solar power supply for Raspberry Pi capable to power up and power down automatically (or forced via a pushbutton) the Raspberry Pi.
The eRPOf will be powered by the same battery, thus it will have a voltage detector circuit to power it up.

Main characteristics

The main goal is to have the Raspberry Pi totally independent for the power supply.
The system should be able to be powered only using the sun.
Because some limits and to reduce the cost, the system will be able to shutdown the Raspberry Pi under determined conditions and re-power it later under a different sets of events.
Here a sum up of the main characteristics
  • Solar powered battery
  • Capable to give 5v 1A
  • monitoring power and shutting off nicely Raspberry before the battery is depleted
  • automatic powering up the Raspberry when the battery is back charged 
  • Push button for manual on/off operation (see RPOf)
  • Other condition to determine when powering up the Raspberry (light or time of the day or other condition)

Block schematic



The key is the eRPOf circuit that is used to turn on and off the Raspberry Pi safely, plus the trigger command can come from the charge level monitor.
If the battery level start to be close to a critical threshold, the monitor send out the off signal to the eRPOf that is removing the power to the Raspberry after sending a shutdown command (see the RPOf article).
The eRPOf in this case however will turn automatically On the Raspberry when there is enough power stored in the battery, or if the manual command is issued (pressing pushbutton) or other conditions are satisfied.
The eRPOf is powered by the same battery. The threshold to cut power to the Raspberry Pi will be set in a way to allow the battery to power the eRPOf using a voltage detector circuit.
i.e. the eRPOf will be allowed to run if the battery will have enough charge.

Let see some blocks.

  • Solar panel - solar controller - battery
    These are the keys for the solar charger.
    The battery is kept charged by the solar panel and the solar controller is capable to power whatever is connected thru the battery or, if in excess, the solar panel.
  • Relay - DC/DC converter
    Control part to power up the Raspberry. eRPOf will connect the DC/DC to the battery.
  • Charge level monitor
    Hardware component to decide when there is enough power to power on the eRPOf.
  • Power level monitor
    Optional - a way to monitor how much power is coming from the solar panel. Can be used to infer if is day or night or cloudy.
  • Other conditions
    Like the block above, a set of other possible conditions to prevent eRPOf to power up the Raspberry

Components

Here a list of components used to build the eRPOf.
The goal is to use as much as possible "ready made" circuits, so I looked at Adafruit.
See the feasibility phase article for more details, here the list :



eRPOf details


The eRPOf is based on the original one, however it has some differences, thus it will be an Enhanced version of RPOf.
For example it must be capable not only to shut down the Raspberry Pi when the battery level is going down too much, but it must be able also to power back automatically the Raspberry when the battery level is enough to sustain the fHelper job and another condition allows that to happen.
Starting from the original RPOf based on the MSP430, here the specifics for the eRPOf.

The eRPOf will be able to:

  • monitor the battery level
  • shutdown the Raspberry Pi
  • monitor if the Raspberry Pi is turned Off (to determine if the Raspberry is already went off)
  • power up the Raspberry Pi in autonomy depending the battery level charge and other conditions
  • power up the Raspberry Pi if the push-button is pressed AND all the necessary conditions are satisfied.
    For example if the battery level is still below the threshold (level 3) pressing the pushbutton will NOT turn on the Raspberry Pi

Tentative schematic


Here a tentative for a schematic, in order to do some prototype:



The eRPOF is powered directly from the battery under charge (3.7 V nominal) and the voltage detector controls the MSP430 reset pin.
Still to decide many things, for example if make sense to have the LED for the power button since the goal is to minimize the current used.
Anyway this schematic is just a starting point to experiment and it will be likely be modified.

I/O description

Like the original RPOf, the eRPOf will use two I/O to communicate with the Raspberry Pi.
One line will be used in output mode from eRPOf to inform the Raspberry to start the shutdown sequence.
The other line will be used in input mode on the eRPOf to determine if the Raspberry Pi is running.

Of course it is implicitly assumed that those line are handled on the Raspberry Pi side as well !

One other line will be used to measure the battery voltage and another line will be used to measure the solar panel voltage.
This should allows to determine when is daylight and if there is enough power available to turn on the Raspberry Pi.

Here a detailed description of the I/O used in the project :


  • P1.3 - Reading voltage
    • Direction : Input
    • Mode : ADC
    • Description : It is connected to the battery.
      Via it the MSP430 can read the voltage of the battery
  • P1.6 - push button
    • Direction : Input
    • Mode : Digital - pull up inserted
    • Description : It is connected to the push button. Active low
  • P1.7 - relay control
    • Direction : Output
    • Mode : Digital
    • Description : It controls the relay - active high
  • P2.1 - to GPI0018 Raspberry Pi
    • Direction : Input
    • Mode : Digital - pull up
    • Description : Shutdown control - input
      Reads a line controlled by the Raspberry Pi - active low
  • P2.2 - to GPI0017 Raspberry Pi
    • Direction : Output
    • Mode : Digital
    • Description : Shutdown control - output
      Used to force a signal to the Raspberry Pi.
      When the signal is up, the Raspberry start the shutdown sequence
  • P2.5 - push button LED
    • Direction : Output
    • Mode : Digital
    • Description : It controls the push button LED (active high)

Powering ON


The power ON procedure is more tricky since everything is powered from the same battery.
We can have different states and for some of them a specific hardware solution is the only way.
Let see some states of the battery :

  1. Battery totally discharged
    When this state happens, there is no power to supply not only the Raspberry but also the eRPOf itself.
    The power to the Raspberry (via the DC/DC converter) the eRPOf must be able to run and this means that the it must be blocked if the battery is below a specific threshold
    An hardware circuit must ensure that.
  2. Battery charged (transition from discharged to charged - level 1)
    When the battery voltage is above a specific threshold, the hardware circuit will allow eRPOf to run.
    eRPOf then will execute some tests to determine if there is enough charge to power the Raspberry.
    This threshold is called level 1.
  3. Battery charged (transition from level 1)
    eRPOf will enable the Raspberry activating the DC/DC circuit when the battery charge level will raise above a threshold (higher than the one at level 1, called level 2).
    eRPOf will try to determine if the battery is charged enough before to connect the DC/DC.
    Some suggestions :
    1. verify if is night - if no light is detected or looking at the time, it means the battery is not charging, avoid to start the Raspberry in the night
    2. verify the battery charge to be above the level 2, let call the activation threshold level 3
    3. connect a resistor temporary (via a rele') to give a load to the battery in order to measure the battery voltage with a load
    4. wait some time, at least an hour, from a disconnection before to consider a reconnection
  4. Battery discharged (transition from charged to discharged - level 2)
    The eRPOf will consider the battery as discharged with a voltage level little bit above the one used by the voltage detector.
    Thus the "level 2" is referring to this threshold.
    When this happens, eRPOf will issue a shutdown command to the Raspberry and when the Raspberry will be off, remove the power to the DC/DC.
    At this point eRPOf will determine if there are the conditions to re-apply the power to the Raspberry (see event 3)
One possible way thus is to have three threshold to determine the actions
  • level 1
    battery considered totally discharged, not good even to power up eRPOf
  • level 2
    battery discharged to power up the Raspberry but still OK to power eRPOf
  • level 3
    battery level to be considered as charged enough for eRPOf and Raspberry Pi

Next articles will discuss experiments and modifications of the design of the eRPOf.

No comments:

Post a Comment