It's not a UPS. It's just my addition for my simple UPS AccordTek ББП-20 to switch off connected devices (up to three) depends on battery voltage. Including graceful shutdown of Raspberry Pi.
Features:
- Switch off relays (up to three) depends of voltage
- Graceful shutdown of Raspberry Pi
- Notify Raspberry Pi about battery voltage via UART
- Raspberry Pi reboot assitant
The projects consist of three parts: PCB, Arduino sketch, Linux Raspberry Pi app.
Components:
- 1 x Arduino Nano
- 3 x Relay Panasonic TQ2-L2-5V
- 1 x Relay Tianbo HJR-3FF-12VDC-S-ZF
- 1 x DC-DC converter SAIBO DCBK3836
- 1 x 4 channel logic converter
- 1 x SMD LED 0603
- 4 x LED 3mm
TBD
First of all you must adjust real voltage measuring by tuning A0_VR and checking Serial Output.
Relay routerRelay = Relay(2, 5, 1000, 10000, 0);
Shutdown voltage (1000): 10V
Raspberry raspberryRelay = Raspberry(6, 7, 3, 4, 10, 11, 1050, 60000, 10000, 1);
Relay thirdRelay = Relay(8, 9, 1050, 10000, 2);
Shutdown voltage (1050): 10.5V
Add to /boot/config.txt:
dtoverlay=gpio-shutdown,gpio_pin=23,active_low=0,gpio_pull=down
dtoverlay=gpio-poweroff,gpiopin=17
enable_uart=1
Remove console=serial0,115200
from /boot/cmdline.txt (if exists)
Build and copy rpi-ups-client
to /usr/local/sbin/
Place /srv/rpi-ups-client.yml from example
/lib/systemd/system/rpi-ups-client.service:
[Unit]
Description=rpi-ups-client
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/sbin/rpi-ups-client -c /srv/rpi-ups-client.yml
Restart=always
[Install]
WantedBy=multi-user.target
Enable SystemdD service:
systemctl daemon-reload
systemctl enable rpi-ups-client
systemctl start rpi-ups-client