Power Sleeping Functionality - eS2 Pro

Most of the time, we program our microcontrollers (Arduino board, etc.) to do something and then wait until it needs to be done again. Even though the microcontroller isn’t accomplishing anything, it still consumes power while it waits. In order to save power, we’ve designed the enregyShield 2 Pro with the ability to turn everything off while it isn’t needed. To use power sleeping, you need to write a program that executes once, performing your tasks, and then issues the sleepSeconds() command. This command sets an alarm that will re-enable the power and then turns the power off. Once the alarm is triggered, the power is restored to the microcontroller and the other circuitry, and the program executes again. This allows you to run your microcontroller, sensors, and other circuitry intermittently with dramatic power savings.

So, how does power sleeping work? The power sleeping is performed by the real-time clock (RTC) onboard the energyShield 2 Pro. The alarm output of the RTC is able to turn on the power enable net. To perform a power sleep cycle, the microcontroller reads the current time, sets the alarm registers to a time X seconds in the future (X being your chosen sleep time in seconds), and clears the alarm flag to turn off the power. When the RTC time registers match the alarm registers, the alarm pin becomes active, turning the power back on.

The trick to prioritizing the power switch over the RTC’s control involves some specialized logic circuitry. That logic says that the switch will always turn the energyShield ON and the RTC can only turn the power off after the alarm has triggered once. So, after the energyShield is turned on from the switch, the RTC has to trigger its alarm (the state where the RTC turns the power on) before it can turn the power off. This prevents the RTC from overriding the switch and is handled by the sleepSeconds() function.

Product Support

Hassle-Free Returns

Shop with confidence knowing that returns are easy. See our Return Policy.

From Our Customers

Great battery pack, just what I needed for some light controls via Arduino, I have already ordered 5 more.

Michael W., NightShade Customer

This is the 2nd unit I have purchased from NightShade Electronics. It is very well designed, and of high quality. There are a few simple parts included as a kit to solder in place to fit one’s configuration need. The PDF instruction was very helpful in explaining how to apply it. I had some outlying questions, and the people at [email protected] were quite helpful.

Geoff, NightShade Customer

This was an excellent purchasing experience and the energyShield from Nightshade Electronics is an excellent product.

Brad Bibler, NightShade Customer

These are great for energy storage and provides excellent data. Robust and simple to code. I use them in my solar projects and wirelessly xmit data back into my house. Thanks again! Great product!

Anonymous, NightShade Customer

Purchased mine through the Kickstarter campaign, but am so glad that I have one. Need many more.

John H., NightShade Customer

Would highly recommend this. Very useful and online directions are an exact match at what you have. Have all readouts in a simple Library. Voltage, Current, Temp and Socket Voltage (Solar or Wall Plug). Using mine with Solar panel @ ~12V…the VMPP pot adjustment included is a great plus. Perfect! Nice shield!

Anonymous, NightShade Customer

This shield is awesome! Having a rechargeable battery with so many internal diagnostics greatly increases the functionality of my Arduino projects.

Daniel, NightShade Customer

This works exactly as described. I’ve integrated into a little Arduino weather station and it is working perfectly.

About NightShade Electronics

NightShade Electronics is a company based on the Space Coast of Florida, started to provide electronics enthusiasts with the quality parts they need to make their projects come to life. Always innovating and designing, NightShade seeks to stay in tune with the ever changing needs of its customers.