OPOPERUPS树莓派HAT

导 言

DFROBET OPOWER树莓PiUPS帽为Raspberry Pi3模型B+/4模型B开发板不间断电源扩展板电源管理设备 专为树莓派设计它可以持续向Raspberryi提供一段时间电量,如果外部电量失效避免系统损坏和数据因突发功耗而丢失等问题。Ompower树莓PiUPS帽支持USBTYPE-C电源输入,与TYPE-CQ2.0/QC3.0兼容,华为FCP保留5V@3A最大功率输出30MAH 18650电池可保持系统正常运行3至4小时,确保数据安全,但也足以满足RaspberryPi日常使用和移动应用假想的需要帽子为DC风扇加插洞,它能维护设备运行温度DFROBETOPER Raspberry PiUPS帽上装有RTC模块,我们可以定期通过软件设置时间并控制RaspberryPi上下电源协同主机自启动功能,它能实现定时启动/停机DFROBOT OPOWER树莓PiUPS扩展板使用MAX17043专用电源检测芯片,该芯片与市场大多数锂电池兼容芯片自有算法,机上LED可直接显示电池电容量,您也可以通过串口命令获取供电状态

特征学

规范化

棋局概述

棋局概述注:请注意电池容量至少3000mAh高点比较好

教程

安装图

OPOUPSHAT安装图
  1. 风扇可用M3x12螺丝和M3坚果板固定(风扇接口方位)
  2. 插入后端 XH2.542x20P长针头
  3. 向Raspberryi插针侧插入行的雌性侧面,细节见上图

UPSRTC(实时时钟)教程

上推电源树莓i通过I2C接口通信我们可以设置时间和报警器,读实时时钟并开关计时求下载DFROBOTUPS Python库,并把这个文件夹放入Raspbian系统桌面

Raspbian办公台

打开Raspberryi接口并输入终端sudoraspi配置

开树莓Pi2C

选择互连选项 > I2C->Enable

开机树莓Pi2C

开I2C接口后 RTC现在就能工作

切换目录DFROBOTUPS Python库位置 :cd /home/pi/Desktop/DFRobot_raspberrypi_ups/python/examples/ups

更改目录

输入帮助命令,检查所有命令和解释:ython上传.py-p帮助

输入帮助命令

帮助命令

帮助命令

实例:同步系统时间:python上传.py-p get_time

同步系统时间

UPS中有许多命令,请多试

UPS范式教程

上推电源使用BCM26(bringPi代码GPIO25;Phystemject 37)控制风扇

范驱动

样本代码

打开Thonnypython集成复制并粘贴代码,当SOC温度高于55度时,打开风扇下度小于48度时关闭风扇

from RPi import GPIO from time import sleep  GPIO.setmode(GPIO.BCM) # USD BCM Pin mode  channel = 26    # BCM26(Physical pin 37) start_temp = 55 # Startup threshold: 55(℃) end_temp = 48   # Shutdown threshold: 48(℃)  GPIO.setup(channel, GPIO.OUT, initial = GPIO.LOW) # Initialize control pin is_high = GPIO.LOW # GPIO Status flag  try:     while True:         # Get SoC temperature         temp = open('/sys/class/thermal/thermal_zone0/temp')         temp = int(temp.read()) / 1000          if temp > start_temp and not is_high: # When the SoC temperature exceeds the startup threshold and the fan is off             GPIO.output(channel, GPIO.HIGH)   # Turn on the fan             is_high = GPIO.HIGH               # Mark the fan status as on          elif temp < end_temp and is_high:     # When the SoC temperature is below the shutdown threshold and the fan is on             GPIO.output(channel, GPIO.LOW)    # Turn off the fan             is_high = GPIO.LOW                # Mark the fan status as off          sleep(10) # 10s except:     pass # Reset this pin when exiting GPIO.cleanup(channel)

多文档

结构学

DFshopping_car1.png获取上推电源DFROBOT存储器或DFROBT分布器.

转向顶部