DFR0682 LattePanda Alpha&Delta UPS Hat Wiki - DFRobot

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

Technical Specifications

Hardware Introduction

Hardware Introduction 1

Hardware Introduction 2

User Instructions

Preparation

Arduino Library Installation Tutorial

Hardware Installation

  1. Do not install the lithium battery before the UPS Hat is in place

  2. Align the UPS power interface side with the LattePanda TypeC/RJ45/HDMI interface side
    LattePanda UPS Hardware Installation 1

  3. Insert the UPS Hat into the LattePanda
    LattePanda UPS Hardware Installation 2

  4. 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.
    LattePanda UPS Hardware Installation 3

  5. After checking the installation, install the 18650 lithium battery, paying attention to the positive and negative directions.
    LattePanda UPS Hardware Installation 4

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

  1. Please make sure you have already installed the Arduino IDE, HIDPowerDevice library, and LPUPS library.

  2. Launch the Arduino IDE, open the UPS program: "File -> Examples -> DFRobot_LPUPS -> LPUPS"

  3. Select the corresponding development board model: "Tools -> Board -> Arduino Leonardo"

  4. Select the corresponding development board port: "Tools -> Port -> COMx" (Select the port marked with Arduino Leonardo)

  5. 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.

LattePanda UPS battery display

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.

  1. Launch the Arduino IDE and open "File -> Examples -> DFRobot_LPUPS -> LPUPS".

  2. Find uint16_t maxChargeVoltage = 12600; to set the maximum charging voltage.

  3. 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.

  4. 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

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents