Skip to content

Power Management Unit SDK for unstable supply source

License

AGPL-3.0, GPL-3.0 licenses found

Licenses found

AGPL-3.0
LICENSE
GPL-3.0
LICENSE.txt
Notifications You must be signed in to change notification settings

westial/powermanagementunit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power Management Unit powermu icon

Power Management Unit SDK for unstable supply source.

It manages all registered devices sleeping mode according to their individual power level threshold.

Usage

If the power level of the environment is lower than the threshold it makes a device sleep. If the power level is equal or over the threshold, it wakes up a device.

First thing is to register every device. An implementation of the Sleepable interface for every device is required. Examples here mocks/sleepable.

The most advanced use cases are shown as test scenarios in this test group module test/powermu/BalanceTest.cpp.

Example of use

I have a sensor with a Wi-Fi communication module requires up to 150-300mAh, and the microcontroller with the sensor require less than 50mA.

The battery gets drawn during a few concurrent cloudy days because the charger is based on solar PV panels, because every time I read the sensor I send a report to the backend through the Wi-Fi network.

With this Power Management Unit I can disable the Wi-Fi communication module when the power level is under 50% for example. I'm keeping the sensor readings until a few sunny hours charge my battery at least 50%, and then I'm sending all kept reports together to the backend.

Arduino Library

There is an Arduino library based implementation in ./arduino.

To prepare the files for this Arduino library, go to this directory and execute make. It creates a subdirectory in ./arduino/prebuild with the directory of the library itself ./arduino/prebuild/PowerManagementUnit

To install the library move the ./arduino/prebuild/PowerManagementUnit to your Arduino Libraries directory.

Thanks

My C programming journey is based on Test-Driven Development for Embedded C by James W. Grenning. A great book to learn much more than advanced C programming.

License

GNU General Public License (GPLv3). Read the attached license file.

Author

Jaume Mila Bea jaume@westial.com_

About

Power Management Unit SDK for unstable supply source

Resources

License

AGPL-3.0, GPL-3.0 licenses found

Licenses found

AGPL-3.0
LICENSE
GPL-3.0
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published