|
|
Flux PCB Editor |
ATtiny85 Phone Charge Guard: A Smart USB Inline Charge Limiter for Li-ion Batteries
Original design by Stefan Wagner (wagiminator) | Flux version published by vasyl | Licence: CC BY-SA 3.0
- Flux project (source of the fabrication files): https://www.flux.ai/vasyl/attiny85-phone-charge-guard~459
- Original project and firmware: https://github.com/wagiminator/ATtiny85-PhoneChargeGuard
- Original design files (EasyEDA): https://easyeda.com/wagiminator/attiny85-phone-charge-guard
WHAT IS THIS PROJECT ABOUT?
The ATtiny85 Phone Charge Guard is a small inline USB device that sits between a power supply and a phone, or any other USB consumer, and controls how much it charges. It constantly measures voltage, current, power and energy, compares them with limits set by the user, and cuts the power with a MOSFET when the chosen limit is reached. The designer's aim is to control the state of charge of the phone's Li-ion battery and so extend its service life.
All of this is handled by a single ATtiny45/85 microcontroller, which runs the user interface, controls the power connection and calculates and displays the measurements. User settings are saved in the microcontroller's EEPROM and loaded automatically the next time the device is used.
HOW DOES IT WORK?
The device is plugged in the middle of the charging path, with a USB-A plug on the input side and a USB-A socket on the output side. The data lines D+ and D- are passed straight through, so the phone can still negotiate its own charging protocol with the charger.
An INA219 current-shunt and power monitor measures bus voltage and current continuously and sends the readings to the ATtiny over I2C. The ATtiny calculates the other values from them and shows them on a small OLED display. Depending on the limit the user selected, it then switches the P-channel MOSFET that connects the power supply to the phone, which stops the charge when the target is reached.
SELECTABLE CHARGING LIMITS
- mAh: stop charging when the electric charge reaches the selected value
- mWh: stop charging when the energy delivered reaches the selected value
- mA: stop charging when the current falls below the selected value, which usually correlates with the battery's state of charge
- min: stop charging after the selected time in minutes
HOW TO USE IT
1. Connect the device between a power supply and the phone.
2. Use the SELECT, INCREASE and DECREASE buttons to set the charging limit.
3. Press START to begin charging.
4. Press SELECT during charging to switch between the displayed values.
5. Charging stops automatically when the set limit is reached.
Button functions: RESET clears all values, SELECT chooses the limit type (or changes the displayed value while charging), INCREASE and DECREASE adjust the limit, and START starts or pauses charging.
HARDWARE DESIGN
- Microcontroller: ATtiny45/85
- Measurement: INA219 current-shunt and power monitor, with an 8 milliohm shunt resistor
- Switching: AS3621 P-channel MOSFET, rated for up to 30 V and 6 A continuous, with about 20 milliohms on-resistance
- Power for the electronics: HT7333 3.3 V LDO regulator, fed from the USB bus voltage of up to 12 V
- Display: compact 0.91-inch I2C OLED, SSD1306-type
- Controls: five tactile buttons
- Connectors: USB-A plug (input) and USB-A socket (output), with D+ and D- passed through
- Board construction: two-layer
The 8 milliohm shunt keeps the effect on the circuit very small while still allowing a 1 mA measurement resolution. For accurate readings, the design recommends a shunt resistor with a tolerance of 1% or better.
SPECIFICATIONS (FROM THE ORIGINAL DESIGN)
- Voltage range: 3 V to 12 V
- Maximum current: 5 A
- Voltage measurement resolution: 4 mV
- Current measurement resolution: 1 mA
FIRMWARE AND PROGRAMMING
The firmware is open source and is available in the original GitHub repository, as an Arduino sketch built with ATtinyCore, as a precompiled hex file, and with a makefile for Linux and macOS. The board has no ICSP header, so the ATtiny is programmed either before soldering, using an SOP adapter, or after soldering, using an EEPROM clip. Energy and capacity are timed from the microcontroller's internal oscillator, which is accurate to about plus or minus 10 percent from the factory and can be improved to about 2 percent or better by manual calibration. Follow the original repository for the exact fuse settings and build steps.
MANUFACTURING FILES
The Flux version is published ready for fabrication and assembly. It includes a complete Gerber set for top and bottom copper, solder mask, solder paste, silkscreen and board outline, together with an Excellon drill file, an IPC-D-356 electrical test netlist and a pick-and-place CSV for automated assembly. Bills of materials are provided in formats prepared for several manufacturers, including a version optimised for PCBWay. The original project also offers a 3D-printable case design.
CREDITS AND LICENCE
Original design, hardware and firmware: Stefan Wagner (wagiminator). Flux version published by vasyl.
The original design is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0): http://creativecommons.org/licenses/by-sa/3.0/ If you share or adapt this design, you must credit the original author, link to the licence and share your version under the same licence.
All design work and credit belong to the original author. Please visit the original GitHub and EasyEDA pages, explore the project in full, and show Stefan some support.
ATtiny85 Phone Charge Guard: A Smart USB Inline Charge Limiter for Li-ion Batteries
Project images are for reference only. Actual production is based on the manufacturing files on the project page.
Please review the designer's notes (e.g., PCB thickness) and select the appropriate options.
PCBWay is not responsible
for issues caused by unsuitable parameter selections.
For more important ordering information, please refer to
Read More
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by PCB HUB
-
ESP32-DIV v1 Shield – Modular RF Expansion Board for ESP32 Wireless Research
Designed by: CiferTechOriginal project: https://github.com/cifertech/ESP32-DIVProject website: https...
-
High-Fidelity Class-D Audio Amplifier: A Compact, Open 50 W Stereo / 100 W Mono Amplifier Board Built on the TPA3116D2DAD
Designed by jharwinbarrozoOriginal project on Flux: https://www.flux.ai/jharwinbarrozo/high-fidelity...
-
ATtiny85 Phone Charge Guard: A Smart USB Inline Charge Limiter for Li-ion Batteries
Original design by Stefan Wagner (wagiminator) | Flux version published by vasyl | Licence: CC BY-SA...
-
USB Type-C PD Downstream-Facing Port: A Protected, Monitored Power Source Design
Designer; ryanfDesign platform; FluxPD controller; TPS25740Power conversion; LM5175Board constructio...
-
Powerbank Board: A Bi-Directional PD3.0 Fast-Charge Design Built on the IP5328P
Designer; jecstronicDesign platform; FluxCore IC; IP5328P power bank SoCCharging standards; Bi-direc...
-
ESP32-DIV v1 Main Board – ESP32-Based Wireless Research Platform
Original Designer: CiferTechOriginal Project: https://github.com/cifertech/ESP32-DIVProject Website:...
-
STM32MP1 Linux Card: A Compact Linux Single Board Computer Built on the STM32MP157F Dual-Core Processor
Designed by vasy_skral with jharwinbarrozo | Shared under CC BY 4.0Original project on Flux: https:/...
-
BRAVE Power Management Board: A Solar, Battery and USB Powered Supply with 12 V, 5 V and 3.3 V Outputs
Designed by collinsemasi with jharwinbarrozoOriginal project on Flux: https://www.flux.ai/collinsema...
-
AvocAudio: A tinyML Community Board for Audio Data Collection, with RP2040, LoRaWAN, SD Storage and Solar Power
Designed by collinsemasi | Shared under CC BY 4.0Original project on Flux: https://www.flux.ai/colli...
-
The Green Dot 2040E5 Board: A Solar-Ready LoRa Node for RS485 Sensor Probes, Built on the XIAO RP2040 and LoRa-E5
Designed by Seeed Studio, with community contributors Original project on Flux: https://www.flux.ai/...
-
Radar Sensor XM125: A USB-C 60 GHz Radar Evaluation Board with Dual Serial Channels
Designed by vasy_skral | Shared under CC BY 4.0Original project on Flux: https://www.flux.ai/vasy_sk...
-
MIDI Controller PCB: A USB-C MIDI Effects Controller with OLED Feedback
Designed by vasy_skral with jharwinbarrozo Original project on Flux: https://www.flux.ai/vasy_skral/...
-
Pico Macro Keyboard: A Programmable RP2350 Macro Pad with Per-Key RGB and Dual Rotary Encoders
Designed by the Flux team (flux) with vasy_skral | Shared under CC BY 4.0Original project on Flux: h...
-
STM32F4 Flight Controller Template: A Modular, Flight-Tested Platform for Quadcopter Prototyping
Designed by vasyl | Shared under CC BY 4.0Original project on Flux: https://www.flux.ai/vasyl/stm32f...
-
ExcaliPad: A USB-C Keyboard and Game Controller Board with a Thumb Joystick
Designed by vasy_skral Original project on Flux: https://www.flux.ai/vasy_skral/excalipad-project~5h...
-
ESP32 Dual Ultrasonic Water Level Monitoring System: A Two-Tank Monitor with Relay Control
Designed by jharwinbarrozo Original project on Flux: https://www.flux.ai/jharwinbarrozo/esp32-dual-u...
-
ESP32 Quadcopter Flight Board: A 100 mm ESP32 and MPU-6050 Drone Reference Design
Designed by vasy_skral | Shared under CC BY 4.0Original project on Flux (project name: ESP32 Drone):...
-
CT Scanner DAS Board: A 32-Channel Data Acquisition Board with DDC232, iCE40 UltraPlus FPGA and STM32F745
Designed by vasy_skral | Shared under CC BY 4.0Original project on Flux: https://www.flux.ai/vasy_sk...
-
BorePilot - ESP32-S3 Smart Borewell Pump Controller
167 0 0 -
-
-
AudioLink – USB & Bluetooth LE Audio / Auracast Receiver with Balanced Line Outputs (nRF5340)
373 0 1 -
-
-
-
Émetteur Récepteur Optique Expérimental (communication UART ATtiny + fibre optique)
414 0 1 -
-
SmallOLED - Live PC Stats, Animated Clocks & Audio Visualizer
1545 0 4







