In case you missed it, Soleil is a Raspberry Pi HAT which offers a fully integrated solution for managing power, including solar charging and low power mode. It was designed as Nerves-first hardware, with features to enable first-party support for the Nerves ecosystem. We carefully designed the circuitry onboard to balance the low power consumption, a rich set of features, and a low BOM cost. This overview will give you an understanding of how it all works.
Hardware Components
Soleil is comprised of the following basic hardware components:
- 5V boost converter
- Battery charger
- Power multiplexer
- Battery fuel gauge
- Low-power load switch
- Real-time Clock
- Hall Switch
Let's go through these one by one.
5V Boost Converter
A boost converter is used on Soleil to raise the battery voltage of approximately 3.7V up to the input voltage required by the Raspberry Pi, which is 5V.
This chip is essential to powering the Raspberry Pi, but this is also one of the
areas to make the most savings in our power budget. When you turn off a
Raspberry Pi Zero 2W - such as with the poweroff()
command from the Nerves IEx
console - you'll find that it still consumes around 80mA of current. While is
significantly less than the approximately 200mA of current draw when it is
powered on and idling, it is still too much for a low-power device. For
reference, a 1000mAh battery would only last 12.5 hours with a constant current
draw of 80mA.
Instead, what we can do is turn off the 5V boost converter entirely. By disabling the output of the 5V converter, we not only completely turn off the Raspberry Pi's circuitry, but we can also make the 5V converter enter a low-power state.
Let's look at the numbers: Soleil uses the MPS3423 5V boost converter. In normal operating mode, the device consumes up to 57µA, plus the power drawn by the load (which is the Raspberry Pi in this case). When the ENABLE pin on this chip is LOW, it instead only draws up to 1µA, as well as cuts off the power draw by the load. Huge savings!
Battery Charger
The battery charger is crucial to keeping the system powered. However, lithium batteries are dangerous and can cause a fire if not charged correctly. That's why it is important to use a special lithium battery charger chip - such as the BQ25185 used in Soleil.
This chip is pretty straightforward - it accepts an input voltage, and delivers power to the battery. When a power source is not connected, it instead powers the system from the battery. And in the case where the charging source is connected but the system requires more load than the source can provide, it will supplement the system power via the battery.
What's nice about this chip is that the input voltage source can even be solar. Solar panels typically have a special voltage-current curve and require a special maximum power point tracking (MPPT) algorithm to get the highest efficiency out of them. The BQ25185 supports a similar charging method for good results.
The datasheet of the BQ25185 states the power consumption from the battery when in battery-only mode is 4µA.
Power Multiplexer
Because we have two input power sources - solar and USB-C - and only one power output to charge the battery, we have to multiplex the power sources. Typically this is done via two diodes in parallel. However, these will drop the voltage up to 0.5V, which is bad for charging with solar. If not in direct sunlight, a solar panel will produce significantly less voltage and power for the system to charge the battery.
Thus, we want a low-voltage drop diode, such as an ideal diode chip. The LM66200 does exactly that - it accepts two power input sources, and uses two ideal diodes to "OR" them together. The output voltage is just a passthrough of the input with the highest voltage.
The LM66200 has one downside, however - it only supports an input voltage up to 6V. Even 6V-rated solar panels can achieve an open-circuit voltage of 7V or more, which would likely fry this chip. To circumvent this issue, we use a voltage regulator to drop higher voltages down to 6V. This also means that the solar input voltage can be expanded up to 16V, which enables support for a larger variety of solar panels.
Finally, the datasheet specifies a quiescent current of 1.32µA, but we will not take this chip into account for the power consumption estimations. This is because it only draws he quiescent current when the battery is charging through one of the two input sources, and not when the device is in low-power mode.
Battery Fuel Gauge
It is nice to know how much juice is left in your battery, similar to how your phone displays the percentage in the top corner. However, this isn't a trivial task for lithium batteries, as they have a non-linear discharge curve.
To get around this, there is a type of chip called a battery fuel gauge. It basically monitors the battery voltage and the amount of current flowing into or out of the battery, then makes an estimation of how much battery life is left.
The BQ27427 battery fuel gauge chip used in Soleil features an I2C interface for communicating with the chip, and the support library includes a driver for reading the voltage, current and remaining capacity from the chip. There even is a battery low indicator, which can be programmed to shut off the device if the capacity drops below a user-defined threshold.
The API for reading data from the BQ27427 is simple:
iex> Soleil.battery_info()
{:ok, %{
current: 0.24, # units are A
voltage: 3.32, # units are V
temperature: 29.0 # units are C
state_of_charge: 87, # units are %
}}
Because it is constantly monitoring the voltage and current of the battery, this chip has a slightly higher power consumption than the others discussed so far at 9µA. Not too bad though!
Low-Power Load Switch
Now, we get to one of the key components on the whole board - the XC6192 low-power load switch. This chip functions to turn on and off the boost converter. It has an internal state machine and is controlled via two pins: SW and SHDN. When the SW pin is pulled LOW, it will turn on the 5V boost converter. When the SHDN pin is set to HIGH, then it disables the boost converter.
Because there are different pins, that means we can control the value from different sources. For the SHDN pin, the Raspberry Pi will set it to HIGH when it is ready to shutdown. For the SW pin, there are several wake-up sources which can pull the pin to LOW.
According to the datasheet, when the load switch is in low-power mode, this chip only consumes 10nA (notice: that's nano amps!) of current.
Real-Time Clock
Soleil has a MCP7940N real-time clock (RTC) chip onboard. This chip is useful for off-grid applications, so it can maintain a system time even when not connected to the internet. However, it can also be used as an alarm clock to wake up the system.
The chip interfaces with the Raspberry Pi through I2C, and the support library also includes a driver for the chip. That means we can not only get and set the current time, but also set and configure an alarm to enable the boost converter via the load switch.
This means that Soleil can schedule the exact time it will wake up next, at any second up to one year in the future. The API for this is as follows:
iex> Soleil.sleep_for(30, :minute)
iex> Soleil.sleep_for(12, :hour)
iex> Soleil.sleep_until(~N[2026-01-01 00:00:00])
iex> Soleil.power_off()
Finally, the current consumption of the chip is quite low. The datasheet specifies 925nA when operating from the backup battery power supply, which is the case in sleep mode.
Hall Switch
Finally, we come to the Hall switch. This chip is not required on board, but it adds a nice feature. A Hall sensor is a chip which detects the strength of a magnetic field. The Hall switch variant simply acts as a binary switch by comparing the strength of the measured magnetic field to some pre-defined threshold.
In short, the DRV5032 Hall switch on Soleil acts as another wake-up source for the load switch by connecting the open-drain output to the SW pin. When the Hall switch detects a strong enough magnetic field, the open-drain output pulls the SW pin LOW which causes the load switch to turn on the 5V boost converter.
This is useful when considering rugged outdoor application environments for a solar power solution like Soleil. It can be helpful to have a manual power-on button, but by using magnets instead of a physical switch, the case design for Soleil does not require any electrical components to be exposed to the elements.
Here's what one solar panel case design looks like - notice the switch on the bottom left side which hides a small magnet underneath:
Finally, the datasheet for this component specifies an operating current of 1.3µA.
Total Current Consumption
Now that we've examined each of the components, let's take a look at the total current consumption of Soleil during sleep mode. I have standardized the units to be µA for all components.
Component | Part Number | Sleep-mode current |
---|---|---|
5V boost converter | MP3423 | 1µA |
Battery charger | BQ25185 | 4µA |
Power multiplexer | LM66200 | 0µA (inactive in sleep mode) |
Battery fuel gauge | BQ27427 | 9µA |
Low power load switch | XC6192 | 0.01µA |
Real-time clock | MCP7940N | 0.925µA |
Hall switch | DRV5032 | 1.3µA |
Total | 16.235µA |
As you can see, in low-power sleep mode, Soleil ideally totals only 16.235µA of current draw. However, the true consumption is likely slightly higher due to power consumption of the passive components. For the purpose of estimating battery life, let's assume 20µA in sleep mode.
Battery Size | Sleep-mode battery life |
---|---|
500mAh | 2.85 years |
1000mAh | 5.7 years |
2000mAh | 11.4 years |
This is impressive, even a small 500mAh battery could last Soleil more than two years! Well, not so fast - this is only taking into account the power consumption while Soleil is in sleep mode. If you want your Raspberry Pi to do something useful, you'll have to wake it up every once in a while. Of course, it will consume more power and drain your battery faster when it is powered on. However, Soleil adds many capabilities for extending battery life and recharging which can help power your project.
Wrapping Up
Soleil is designed to simplify and optimize your project, whether you're creating an off-grid monitoring device, an IoT node, or a low-power experimental setup. If you're as excited about Soleil as we are, visit the project page to read the docs and join the hardware group-buy waitlist.
We can’t wait to see the incredible applications you create with Soleil! Please share your thoughts, projects, and feedback with us - your input is invaluable in shaping the future of our open source products. Stay tuned for updates, and thank you for being part of this journey. 🌞