Uninterruptible Jetson Nano Power Supply UPS HAT Module Wiki - DFRobot

Introduction

Designed for Jetson Nano Developer Kit, this advanced uninterruptible Power supply UPS module provides up to 5.1V 8000mA backup power for Jetson Nano board. With intelligent power management, the module supports multiple functions like power loss/adapter fault detection, automatic startup, complete shutdown from software, advanced power path management, I2C bus communication and onboard LED indicators for monitoring battery capacity. It is powered by six 18650 batteries.

Specification

Features

Safety Instructions and Warnings

Function and Assembly

LEDs display and Electricity

Electricity The number of LED lights on
0%~25% 1
26%~50% 2
51%~75% 3
76%~100% 4

Connect with Jetson Nano by 10Pin

Correctly install six 18650 batteries to the Jetson Nano UPS power board, and connect to Jetson Nano through the 10 Pin GPIO board. The connection diagram is as follows:

On/off operation

Long press for 3 seconds to turn off the UPS, short press once to turn on the UPS.

Battery power and voltage can be read by software

  1. First, install the pip of Python3 on the Ubuntu system. Please run the following command as the root user or sudo user in the terminal:
sudo apt-get update
sudo apt-get install python-pip
  1. Install Jetson GPIO library:
sudo pip install Jetson.GPIO
  1. Install the I2C development library:
sudo apt-get install libi2c-dev i2c-tools
pip install smbus
  1. Install Nano editor on Ubuntu:
sudo apt-get install nano
  1. Sample code for reading battery voltage and battery percentage

#!/usr/bin/env python
import struct
import smbus
import sys
import time


def readVoltage(bus):

     address = 0x36
     read = bus.read_word_data(address, 2)
     swapped = struct.unpack("<H", struct.pack(">H", read))[0]
     voltage = swapped * 1.25 /1000/16
     return voltage


def readCapacity(bus):

     address = 0x36
     read = bus.read_word_data(address, 4)
     swapped = struct.unpack("<H", struct.pack(">H", read))[0]
     capacity = swapped/256
     return capacity


bus = smbus.SMBus(1) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)

while True:

 print "******************"
 print "Voltage:%5.2fV" % readVoltage(bus)

 print "Battery:%5i%%" % readCapacity(bus)

 if readCapacity(bus) == 100:

         print "Battery FULL"

 if readCapacity(bus) < 20:


         print "Battery LOW"
 print "******************"
 time.sleep(2)

Create a new Bat.py file, and then run the command in the terminal:

sudo python Bat.py

Now you get the battery power percentage and battery voltage information.

FAQ

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

More Documents