DeepSleepr is a compact power management module that transforms any USB-powered SBC, MCU, or development board into a low-power device through intelligent power cycling. Built around an ATtiny414 microcontroller, it sits between your power source and your device, allowing your board to schedule its own power-down periods via I2C communication before gracefully shutting down.
The module handles the rest, cutting power for the specified duration (using an accurate 32kHz crystal oscillator for timing), then restoring it automatically. This approach enables battery-powered or solar-powered deployments that would otherwise be impractical due to idle power consumption.
Why I Built ThisThe idea struck me at 4am one morning when I couldn't sleep. I'd been mulling over various projects and remembered an article about using an ATtiny as a wake controller for larger systems running on AA batteries. The concept was brilliant in its simplicity: why waste power keeping an entire SBC running when you only need it active for a fraction of the time?
Many of the SBCs and development boards I work with don't have viable low-power modes, or implementing them requires significant software overhead. I wanted a solution that:
- Works with virtually any USB-powered device
- Requires minimal software integration (just I2C communication)
- Provides accurate, long-duration timing
- Draws negligible power when the main device is off
- Can handle adequate current for real-world USB Type-C devices (up to 20V/5A ideally)
Perfect for applications like:
- Remote environmental monitoring stations
- Garden automation and irrigation controllers
- Solar-powered IoT deployments
- Farm sensors and agricultural monitoring
- Weather stations in remote locations
- Any project where you need periodic data collection but continuous operation isn't necessary
The DeepSleepr module is built on a two-layer PCB designed in KiCad and manufactured by PCBWay (who sponsored this project). The core components include:
Power Path:
- USB-C input connector (currently 5V, up to 3A negotiated via CC resistors)
- P-channel MOSFET for switching positive (enabling complete power cut-off)
- USB-C output connector with passthrough data lines
- Direct power passthrough when active
Control System:
- ATtiny414 microcontroller running the power management logic
- 32kHz crystal oscillator for accurate long-duration timing
- I2C interface for communication with the host device
- UPDI programming header for firmware updates
- Optional SPI support (though I2C is the primary interface, with SPI being removed)
The workflow is beautifully simple:
- Your SBC boots up with power provided through DeepSleepr
- Your application connects to DeepSleepr via I2C (using GPIO pins)
- When ready to sleep, your SBC sends a command like "power off in 10 seconds for 24 hours"
- Your SBC performs a graceful shutdown within those 10 seconds
- DeepSleepr cuts power by via the MOSFET
- The ATtiny414 enters deep sleep, consuming minimal power while the crystal keeps accurate time
- After 24 hours (or your specified duration), DeepSleepr restores power
- Your SBC boots up, does its work, and the cycle repeats
The beauty of this approach is that it leverages I2C, which nearly every SBC and development board already supports. No special hardware modifications needed to the host device, just a simple Python script, software library or command line application to send commands.
Power ConsumptionWhen the main device is powered off, the DeepSleepr module draws only the quiescent current of the ATtiny414 in deep sleep mode plus the crystal oscillator, measured in microamps. This means a small battery or solar setup can sustain the system for extended periods between active cycles. The goal is 5 years on 4x Alkaline AA batteries with <1 hour of drift ( <10 minutes per year / <1 second per day).
Version 0.1 LearningsThe first revision taught me some valuable lessons:
What Worked:
- Core power switching functionality operates perfectly but can definitely be improved.
- I2C communication interface is solid. Time to build a library and some example applications for it.
- 32kHz crystal provides accurate timing for long durations, but I can improve it with better product selection / PPM.
- USB-C connectors with data passthrough work as intended, but I can support PD by making some changes to how this operates.
- PCBWay's assembly service handled the SMD components beautifully.
What Needs Improvement:
- The LED debacle: I ordered 0605 LEDs in metric when the footprint was imperial (or vice versa), so the status LED doesn't fit. A reminder to always double-check SMD package specifications!
- PCB thickness: At only two layers and minimal thickness, the board is a bit too flexible. Version 0.2 will use a thicker substrate.
- UPDI pin conflict: I placed a resistor on PA0 that interferes with programming. This requires a workaround that shouldn't be necessary.
- No mounting holes: Version 0.1 was purely functional, but Version 0.2 needs proper mounting options for real-world installations.
Based on community feedback and my own testing, the next revision will include:
- Mounting holes for secure installation in enclosures.
- Improved current handling with better thermal design for sustained 3-5A operation.
- USB Power Delivery support for negotiating higher power levels when needed.
- Enhanced silkscreen with clearer labelling and pin assignments.
- Thicker PCB substrate for better mechanical stability.
- Corrected LED footprints (metric vs imperial, finally sorted!)
- Optimised pin assignments to avoid UPDI conflicts.
- Better component placement based on initial assembly experience.
The firmware is being developed in pure C implementation to:
- Minimise power consumption by avoiding Arduino overhead.
- Provide more precise control over sleep modes.
- Reduce code size.
- Demonstrate bare-metal programming on the ATtiny platform.
The host-side library will be simple and platform-agnostic, providing functions like:
deepsleepr.sleep_for(duration_seconds)
deepsleepr.sleep_until(timestamp)
deepsleepr.set_wake_schedule(interval_seconds)Current Status and Next StepsThe Version 0.1 boards are assembled and tested. Next steps include:
- Finishing the V0.2 design and sending it to PCBWay.
- Reviewing the code to resolve an unexpected 20s drift.
- Test power switching functionality with various SBCs.
- Measure actual power consumption in sleep mode.
- Develop and test the I2C communication protocol & library.
- Iterate the design based on real-world testing.
- Finalise with community feedback incorporated.
- Create a new YouTube video for it.
The DeepSleepr project will be fully open source, with design files, firmware, and host libraries available on GitHub. I'm building out a dedicated website to document the project, provide assembly instructions, and share use cases from the community.
This is very much a learning-in-public project, and I'd love your input and feedback. Whether you're interested in low-power design, embedded systems, or just need a practical solution for battery-powered IoT projects, I hope DeepSleepr will be useful to you.
AcknowledgementsHuge thanks to PCBWay for sponsoring this project and providing the PCB manufacturing and assembly services. Special shout-out to Zoey, my account manager, for supporting this idea from the initial concept.
Thanks also to the broader maker community for inspiration, particularly the original article about using an ATtiny as a wake controller that sparked this whole idea during that sleepless night.
Find more of my projects involving SBCs, RISC-V, and embedded Linux on my YouTube channel @PlatimaTinkers



Comments