EP-0159: Difference between revisions

From 52Pi Wiki
Jump to navigation Jump to search
Line 103: Line 103:
</pre>
</pre>


==How to use==
==Package Includes==
==Package Includes==
==Keyword==
==Keyword==
* Raspberry Pi Pico UPS, Power bank, UPS for Pico
* Raspberry Pi Pico UPS, Power bank, UPS for Pico

Revision as of 12:38, 8 February 2022

Raspberry Pi Pico UPS

EP-0159-1.jpg

Descriptions

This is a mobile power supply for the Raspberry Pi Pico.
which supports the use of a single 18650 lithium battery for power supply, which can free your pico from the shackles of cables and make it more convenient for you to DIY Pico projects.
The remain power of battery can be read from the 4 LED indicators. You can also read battery voltage and current information by connecting the USB-to-TTL cable to the serial port pins of the UPS.
The charging prompt during charging is very intuitive, and when the battery is fully charged, it will stop charging, and the `Standby indicator` on the panel will light up.
All GPIOs is leading out and providing clear silkscreens which are very convenient for Pico experiments.
It is plug-and-play module.

This device is a power supply device, please pay attention to the positive and negative poles of the battery. Reverse battery connection may damage your UPS device or Pico development board.Please check the circuit carefully before turning on the power switch to avoid equipment damage caused by short circuit. 

Features

  • Plug & Play
  • Support Raspberry Pi Pico Only
  • Monitor battery voltage (error ±2%), monitor battery current (error ±10%).
  • Monitor the charging current.
  • If it is not in charging mode, the power LED indicator will not be on, wake up for 5 seconds every 2 minutes to reduce light pollution.
  • In charging mode, it can judge whether it is fully charged, and stop flashing lights when fully charged.
  • In charging mode, the LED will flash when it is not fully charged.
  • Evenly allocate the power ratio of each LED to prevent the load from appearing abruptly.
  • The static power consumption is less than 10mA.
  • Data format: [Battery voltage mV] | [Charging current mA] | [Discharging current X10] mA
  • Serial output data.
  • Only supports 18650 lithium battery
Note: It is normal that the current consumption can still be read when the PICO is not connected and the power switch is turned on. After all, the board also consumes a small amount of electricity, which can be ignored.

Gallery

  • Product Outlook:
EP-0159-1.jpg
EP-0159-2.jpg
EP-0159-3.jpg
EP-0159-4.jpg
EP-0159-5.jpg
EP-0159-6.jpg
EP-0159-7.jpg
EP-0159-8.jpg
EP-0159-9.jpg
EP-0159-10.jpg
EP-0159-11.jpg

Serial output data format

  • Parameters are read from the serial port onboard, you can connect USB-To-TTL cable to the pin(TX and RX), Silkmark is JP3.
引脚定义0.png


  • Data Format:

Battery voltage | Charging current In | Battery current

NOTE:
When the data shows Negative sign means the battery is charging.
When the data shows Positive means the battery is in power consumption.
Data parameters are separated by pipe symbols(delimiter is "|")
microPython can use the split method to split data information.

How to read voltage and current from UPS via Pico

  • We assume that you are using MicroPython as the interpreter.
  • We assume that you are using thonny IDE as editor.
  • Connect GP0 to RX pin, GP1 to TX pin on UPS's JP3 Pin header.
  • Open a new file and paste following code and press run button on the thonny IDE.
from machine import UART, Pin
import time

# create an instance. Connect GP0 to UPS's RX pin, GP1 to UPS's TX pin
uart1 = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1))

# loop
while True:
    try:
        data = uart1.readline()   # read data from UPS.
        if data != None:
            data = data.decode('utf-8')
            data = data.rstrip('\n')
            print(data)
        
            print("Battery Voltage:{}".format(data.split('|')[0]))
            print("Current of Charging In:{}".format(data.split('|')[1]))
            batt_cur = float(data.split('|')[2]) / 10.0
            print("Consuming Current:{}".format(batt_cur))
        
            sign = data.split('|')[2]
            print("sign: {}".format(sign))
            if float(sign) < 0.0:
                print("Battery is charging....")
            else:
                print("Power is consuming...")
    
        time.sleep(2)
        print("-"*38)
    except ValueError:
        pass
    except IndexError:
        pass

Package Includes

Keyword

  • Raspberry Pi Pico UPS, Power bank, UPS for Pico