Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use UPS HAT(E): Examples, Pinouts, and Specs

Image of UPS HAT(E)
Cirkit Designer LogoDesign with UPS HAT(E) in Cirkit Designer

Introduction

The UPS HAT (E) is an advanced add-on board designed to provide uninterruptible power supply functionality for single-board computers, such as the Raspberry Pi. This HAT ensures continuous operation during power outages by seamlessly switching to battery power when the primary power source is interrupted. It also includes power management features, such as battery monitoring and safe shutdown capabilities, to protect your device and data.

Explore Projects Built with UPS HAT(E)

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-S3 Battery-Powered Environmental Monitoring System with OLED Display
Image of Diagram wiring: A project utilizing UPS HAT(E) in a practical application
This circuit is a sensor and display system powered by a UPS module with a 12V power supply and 18650 batteries. It includes an ESP32 microcontroller that interfaces with various sensors (DHT22, Strain Gauge, MPU-6050, ADXL345) and an OLED display, with power regulation provided by a step-down buck converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
12V UPS System with Dual 18650 Li-ion Battery Backup and Voltage Regulation
Image of Power supply: A project utilizing UPS HAT(E) in a practical application
This circuit is designed to provide an uninterruptible power supply (UPS) system with a 12V DC output. It includes a 12V 5A power supply connected to an AC source through a toggle switch, which charges a pair of 18650 Li-ion batteries via a voltage regulator (XL4016). The UPS module ensures a continuous power supply to the load by switching between the power supply and the battery bank.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
Image of Rocket: A project utilizing UPS HAT(E) in a practical application
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered UPS with Step-Down Buck Converter and BMS
Image of Mini ups: A project utilizing UPS HAT(E) in a practical application
This circuit is a power management system that steps down a 240V AC input to a lower DC voltage using a buck converter, which then powers a 40W UPS. The UPS is controlled by a rocker switch and is backed up by a battery management system (BMS) connected to three 3.7V batteries in series, ensuring continuous power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with UPS HAT(E)

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Diagram wiring: A project utilizing UPS HAT(E) in a practical application
ESP32-S3 Battery-Powered Environmental Monitoring System with OLED Display
This circuit is a sensor and display system powered by a UPS module with a 12V power supply and 18650 batteries. It includes an ESP32 microcontroller that interfaces with various sensors (DHT22, Strain Gauge, MPU-6050, ADXL345) and an OLED display, with power regulation provided by a step-down buck converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Power supply: A project utilizing UPS HAT(E) in a practical application
12V UPS System with Dual 18650 Li-ion Battery Backup and Voltage Regulation
This circuit is designed to provide an uninterruptible power supply (UPS) system with a 12V DC output. It includes a 12V 5A power supply connected to an AC source through a toggle switch, which charges a pair of 18650 Li-ion batteries via a voltage regulator (XL4016). The UPS module ensures a continuous power supply to the load by switching between the power supply and the battery bank.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rocket: A project utilizing UPS HAT(E) in a practical application
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Mini ups: A project utilizing UPS HAT(E) in a practical application
Battery-Powered UPS with Step-Down Buck Converter and BMS
This circuit is a power management system that steps down a 240V AC input to a lower DC voltage using a buck converter, which then powers a 40W UPS. The UPS is controlled by a rocker switch and is backed up by a battery management system (BMS) connected to three 3.7V batteries in series, ensuring continuous power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT Devices: Ensures uninterrupted operation of Internet of Things (IoT) systems during power failures.
  • Home Automation: Keeps smart home systems running without interruption.
  • Edge Computing: Provides reliable power for edge devices in remote or unstable power environments.
  • Data Logging: Prevents data loss in applications requiring continuous data collection.
  • Portable Projects: Powers Raspberry Pi-based portable devices with rechargeable battery support.

Technical Specifications

Key Technical Details

  • Input Voltage: 5V DC (via micro-USB or GPIO header)
  • Output Voltage: 5V DC (regulated)
  • Maximum Output Current: 2.5A
  • Battery Type: Lithium-ion or Lithium-polymer (3.7V, single-cell)
  • Battery Capacity: Supports batteries up to 5000mAh
  • Charging Current: 1A (max)
  • Communication Interface: I2C for battery status monitoring
  • Dimensions: 65mm x 56mm (compatible with Raspberry Pi form factor)

Pin Configuration and Descriptions

The UPS HAT (E) connects to the Raspberry Pi via the GPIO header. Below is the pin configuration:

Pin Name Description
1 3.3V Power supply for the HAT's logic circuitry.
2 5V Main power input/output for the Raspberry Pi and peripherals.
3 SDA (I2C) Data line for I2C communication (used for battery status monitoring).
5 SCL (I2C) Clock line for I2C communication.
6 GND Ground connection.
7 Power Key Optional pin to trigger a safe shutdown or wake-up signal.
8 Battery+ Positive terminal for the external battery connection.
9 Battery- Negative terminal for the external battery connection.

Usage Instructions

How to Use the UPS HAT (E) in a Circuit

  1. Attach the HAT: Securely mount the UPS HAT (E) onto the GPIO header of your Raspberry Pi.
  2. Connect a Battery: Attach a 3.7V lithium-ion or lithium-polymer battery to the Battery+ and Battery- terminals.
  3. Power the HAT: Supply 5V DC power to the HAT via the micro-USB port or GPIO header.
  4. Monitor Battery Status: Use the I2C interface to read battery voltage, charge percentage, and other parameters.
  5. Enable Safe Shutdown: Configure the Raspberry Pi to safely shut down when the battery level is critically low.

Important Considerations and Best Practices

  • Battery Selection: Use only high-quality, compatible lithium-ion or lithium-polymer batteries to ensure safety and performance.
  • Ventilation: Ensure proper ventilation to prevent overheating during charging or high current draw.
  • Firmware Updates: Check for firmware updates from the manufacturer to improve functionality and compatibility.
  • I2C Address Conflicts: If using other I2C devices, ensure there are no address conflicts with the UPS HAT (E).

Example Code for Raspberry Pi

Below is an example Python script to monitor the battery status using the I2C interface:

import smbus
import time

Initialize I2C bus

bus = smbus.SMBus(1) # Use I2C bus 1 on Raspberry Pi

UPS HAT I2C address (replace with the correct address if different)

UPS_HAT_I2C_ADDRESS = 0x36

def read_battery_voltage(): # Read two bytes of data from the voltage register (0x02) data = bus.read_word_data(UPS_HAT_I2C_ADDRESS, 0x02) # Convert the data to voltage (in millivolts) voltage = ((data & 0xFF) << 8 | (data >> 8)) * 1.25 / 1000 return voltage

def read_battery_percentage(): # Read two bytes of data from the percentage register (0x04) data = bus.read_word_data(UPS_HAT_I2C_ADDRESS, 0x04) # Convert the data to percentage percentage = (data & 0xFF) << 8 | (data >> 8) return percentage / 256

try: while True: voltage = read_battery_voltage() percentage = read_battery_percentage() print(f"Battery Voltage: {voltage:.2f}V") print(f"Battery Percentage: {percentage:.2f}%") time.sleep(5) # Wait for 5 seconds before the next reading except KeyboardInterrupt: print("Exiting program.")


Notes:

  • Install the smbus library using sudo apt-get install python3-smbus if not already installed.
  • Replace the I2C address (0x36) with the correct address if your UPS HAT uses a different one.

Troubleshooting and FAQs

Common Issues and Solutions

  1. HAT Not Powering the Raspberry Pi

    • Cause: Insufficient battery charge or incorrect battery connection.
    • Solution: Ensure the battery is fully charged and properly connected to the Battery+ and Battery- terminals.
  2. I2C Communication Fails

    • Cause: Incorrect I2C address or bus configuration.
    • Solution: Verify the I2C address of the UPS HAT and ensure the Raspberry Pi's I2C interface is enabled in the raspi-config tool.
  3. Overheating During Operation

    • Cause: High current draw or poor ventilation.
    • Solution: Reduce the load on the Raspberry Pi or improve airflow around the HAT.
  4. Battery Not Charging

    • Cause: Faulty battery or insufficient input power.
    • Solution: Test with a different battery and ensure the input power supply provides at least 5V and 2A.

FAQs

  • Can I use the UPS HAT (E) with other single-board computers?

    • Yes, as long as the GPIO pinout and power requirements are compatible.
  • What happens when the battery is fully discharged?

    • The UPS HAT will shut down the Raspberry Pi safely to prevent data loss and battery damage.
  • Can I monitor the battery status without using I2C?

    • No, the I2C interface is required to access battery status information.
  • Is the UPS HAT (E) hot-swappable?

    • Yes, you can connect or disconnect the external power supply without interrupting operation, as long as the battery is connected.