导 言
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可直接显示电池电容量,您也可以通过串口命令获取供电状态
特征学
- TYPE-CQ2.0/QC3.0华为FCP
- 最大5V@3A输出
- 支持 18650,锂离子,聚合锂电池
- 机上RTC支持软件定时启动/shutdow
- LED电池容量显示和串口信息查询
规范化
- 输入电压:TYPE-CQC2.0/QC3.0快速电荷5V/2A9V/2A12V/1.5A
- 供电接口:USBTYPEC
- 电池类型:3.7V锂电池组,18650锂电池组
- 输出电源5V@3A
- 备用电耗:<10m
- 通信接口:I2C
- 产品大小:65毫米56毫米13毫米
棋局概述
注:请注意电池容量至少3000mAh高点比较好
教程
安装图
- 风扇可用M3x12螺丝和M3坚果板固定(风扇接口方位)
- 插入后端 XH2.542x20P长针头
- 向Raspberryi插针侧插入行的雌性侧面,细节见上图
UPSRTC(实时时钟)教程
上推电源树莓i通过I2C接口通信我们可以设置时间和报警器,读实时时钟并开关计时求下载DFROBOTUPS Python库,并把这个文件夹放入Raspbian系统桌面
打开Raspberryi接口并输入终端sudoraspi配置
选择互连选项 > I2C->Enable
开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)
多文档
获取上推电源DFROBOT存储器或DFROBT分布器.