EP-0159

From 52Pi Wiki
Revision as of 16:41, 8 February 2022 by Yoyojacky (talk | contribs) (How to read voltage and current from UPS via Pico)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Raspberry Pi Pico UPS

EP-0159-3.jpg

Descriptions

This is a portable 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.
  • 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.
EP-0159放大.jpg


  • Data format: [Battery voltage mV] | [Charging current mA] | [Discharging current X10] mA

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.
  • Plug Raspberry Pi Pico to UPS.
EP-0159安装pico.jpg


  • Insert Battery(18650) into slot.
EP-0159-11.jpg


  • Connect GP0 to RX pin, GP1 to TX pin on UPS's JP3 Pin header.
EP-0159接线.jpg


  • Open a new file and paste following code and press run button on the Thonny IDE.
  • Thonny IDE Download: [ https://thonny.org/ ]
Screenshot.png


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

  • 1 x UPS for Raspberry Pi Pico
EP-0159-3.jpg


Note: Raspberry Pi Pico and battery are not include in the package, Additional purchase required!

Keyword

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