Introduction
LattePanda Alpha & Delta UPS Hat is a UPS expansion board compatible with the shape and pins of LattePanda Alpha, Delta, and 3 Delta, which can be installed and used directly. It uses 3 18650 lithium-ion batteries as UPS energy storage batteries and supports external power supply through TypeC PD and 5.5mm DC interfaces. In the event of a power outage, the 3 18650 batteries directly power the LattePanda without any additional voltage conversion steps, consuming energy and extending the battery life up to 8 hours.
Through the HID-UPS protocol, the LattePanda UPS Hat can be recognized as a battery device in the operating system and use system power management to implement performance limitations and automatic shutdown functions, just like a built-in battery in a laptop. The HID-UPS protocol is implemented through Arduino and is fully open source. You can edit a more accurate battery capacity algorithm yourself and set a charging voltage limit to extend battery life.
Precautions
💡 To ensure the normal operation of the UPS, please use a reputable brand 3.7V 18650 lithium-ion battery with a capacity of no less than 3000mAh.
🔋 The UPS Hat has integrated battery protection, so you can safely use "flat top" 18650 batteries without the need for "pointed top" 18650 batteries with integrated protection boards.
⚠ The UPS Hat does not support 3.2V lithium iron phosphate batteries of the same 18650 size. Installing the wrong battery for charging may lead to fire or explosion.
💤 If the UPS is not in use for an extended period of time, please remove the battery from the UPS to avoid over-discharging and damaging the battery.
Technical Specifications
- Power supply interface:
- USB Type-C PD protocol
- Voltage requirement: 15V
- Power requirement: ≥30W
- DC Jack 5.5x2.1mm
- Voltage requirement: 4.5~24V
- Power requirement: ≥30W
- USB Type-C PD protocol
- Battery type: 3.7V 18650 lithium-ion battery
- Charging current: 1A
- Compatible boards:
- LattePanda 3 Delta
- LattePanda Alpha
- LattePanda Delta
- Operating temperature: 0~60℃
Hardware Introduction
User Instructions
Preparation
- Hardware
- 1x LattePanda UPS Hat
- 3x 18650 3.7V lithium-ion batteries
- 1x Compatible LattePanda
- LattePanda Alpha
- LattePanda Delta
- LattePanda 3 Delta
- Software
Arduino Library Installation Tutorial
Hardware Installation
Do not install the lithium battery before the UPS Hat is in place
Align the UPS power interface side with the LattePanda TypeC/RJ45/HDMI interface side
Insert the UPS Hat into the LattePanda
Check that the pins are fully inserted in order, without any floating or bent pins.
To reserve space for heat dissipation and ventilation, the UPS Hat pins are longer. The figure shows the appearance after the installation is in place.After checking the installation, install the 18650 lithium battery, paying attention to the positive and negative directions.
After the UPS Hat is installed, please use the USB-C or DC 5.5x2.1mm interface on the UPS Hat to power the LattePanda. Using the LattePanda's own interface for power will not allow the UPS function to work properly.
Software Installation
Please make sure you have already installed the Arduino IDE, HIDPowerDevice library, and LPUPS library.
Launch the Arduino IDE, open the UPS program: "File -> Examples -> DFRobot_LPUPS -> LPUPS"
Select the corresponding development board model: "Tools -> Board -> Arduino Leonardo"
Select the corresponding development board port: "Tools -> Port -> COMx" (Select the port marked with Arduino Leonardo)
Upload the example program, and after a short wait, you can see that the battery has been recognized in the system. If you need to further set the threshold battery level for automatic power-saving and forced sleep on your computer, you can adjust it in the Windows advanced power settings.
Adjusting Charging Limit
Long-term maintenance of a 4.2V full charge state in a lithium battery results in a high internal discharge current, which can cause rapid battery wear. If you don't have high requirements for battery capacity, you can set the maximum charging voltage in the Arduino program to extend battery life.
Launch the Arduino IDE and open "File -> Examples -> DFRobot_LPUPS -> LPUPS".
Find
uint16_t maxChargeVoltage = 12600;
to set the maximum charging voltage.The unit of
uint16_t maxChargeVoltage
is mV, which sets the charging voltage for a 3-cell lithium battery pack. 12600 means the charging voltage is limited to 12.6V, with a maximum voltage of 12.6V÷3=4.2V per cell.Modify it to
uint16_t maxChargeVoltage = 12000;
, and re-upload the Arduino program. The charging will automatically stop when the total voltage of the battery pack reaches 12V.
The allowed range for maxChargeVoltage
is 11100 ~ 12600, and settings beyond this range will not take effect.
FAQ
Q: If both the 5.5x2.1mm DC and USB TypeC power supplies of the UPS HAT are connected, which interface will be used for power supply?
A: Power will be obtained preferentially from the interface with the higher voltage. The USB Type-C PD automatically negotiates for a 15V power supply, and the voltage of the 5.5x2.1mm DC interface depends on the specifications of the power adapter you are using.Q: Can power generation devices such as solar panels or wind turbines be directly connected to the UPS HAT?
A: In theory, as long as the input voltage is within the range of 12~24V, the UPS can work, but we do not recommend directly connecting solar panels in this way. An overly unstable power source can cause the battery to frequently switch between charging and discharging, which may severely affect battery life. If you want to connect a solar panel, a power management module with voltage stabilization and energy storage functions, such as SKU:DFR0580, should be connected before input to the UPS.Q: What will happen if the power adapter supply is insufficient?
A: Insufficient adapter power will cause slow charging, inability to charge, or even consume battery power while charging. Please pair the UPS with a power adapter of at least 30W. It is recommended to use the 45W power supply included in the LattePanda package.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.