Based on https://github.com/abratchik/HIDPowerDevice by Alex Bratchik.
A work in progress...
This design is for a 12v adjustable voltage output UPS using the following items:
- Arduino Pro Micro
- XL6009 boost converter to boost the battery from 6.4v to 12-30v
- XL4005 buck converter to charge the battery more efficiently
- 2x INA180A2IDBVR current sense chips, one for battery and one for output rail
- 2x FQP30N06L N channel MOSFETS for switching the battery and output
- 2S LifePO4 6Ah cells - maybe 2S2P for a 76wh pack
- min (2v2) 4v, nominal (3.2v2) 6.4v, max (3.65v*2) 7.3v
- through a 100k/10k resistive divider so should be 0.4v - 0.73v - may need to tweak resistor values
- as above, hopefully vrange is from 0-5v as input voltage is 12v - may need to tweak resistor values
- confirm gain function on INA180A2IDBVR (should be 50v/v) and check high-power resistor used (0.05R) gives sane values
- according to the below link, we should get 5v @ 2A, 2.5v @1A, etc
- https://techoverflow.net/2019/12/17/sense-resistor-current-shunt-current-sense-amplifier-calculator/
work out how to measure the battery current on A3 and whether it is functional during charge or discharge
- as above
- check battery bms works with pwm or if it needs extra caps
- adapt my measurement code to Alex's UPS sketch
- implement coloumb counting as we know battery voltage and current and time
- implement anti-brownout based auto reset based on output current draw measurements (configurable by jumper bodge wire?)
Pro Micro I/O pins as follows:
still making changes, ideas as follows:
- bidirectional battery current measurement
Copy linux/98-upower-hid.rules file to the /etc/udev/rules.d/ folder , then reboot. This is required for
Linux device manager (udev) to recognize the Arduino board as UPS.