Skip to main content

Wio Terminal电池底座(650mAh)

Wio-Terminal 电池底座是Wio Terminal开发板的必备扩展板,可为Wio Terminal提供外部电源,增强其便携性和紧凑性。它具有 650mAh可充电锂聚合物电池, 电池充放电状态LED, 4个Grove模拟/数字端口, 1个Grove I2C端口和1个Grove UART端口, 以及具备美观和保护功能的ABS外壳。 此外,Wio Terminal电池底座背面还具有与Raspberry Pi 40引脚兼容的GPIO接口,可连接更多附件!

Wio Terminal电池底座的新版本还增加了 Texas Instrument的 BQ27441-G1A - 这是一款自校准、基于I2C的锂聚合物(LiPo)电池燃料计,可用于测量电池的电压以估计其充电百分比和剩余容量!

特点

  • 内置650mAh可充电锂聚合物电池
  • 电池充放电状态LED
  • 电池开关按钮
  • 内置BQ27441-G1A锂聚合物电池燃料计
  • USB Type-C充电接口
  • 过流保护
  • 持续模式/保护
  • 4个Grove模拟/数字端口
  • 1个Grove I2C端口
  • 1个Grove UART端口
  • 外壳内隐藏了磁铁,可将其粘贴在白板上!

规格

项目详情
电源供应4.75V - 5.25V
内置电池650mAh
充电电流最大值: 660mA
电池板模式绿色LED:亮表示板子正在充电。

绿色LED:亮表示板子正在充电。

黄色LED:亮表示男性接口输出/输入5V。
GPIO 输出最大电压: 5.15V

最大电流: 380mA
涓流充电电流30mA
Grove 接口Grove模拟/数字 *4,Grove I2C * 1,Grove UART * 1

硬件概述

注意事项

  • 如果在底座处于充电模式时拆卸电池,底座将切换到故障模式,绿色指示灯以1Hz的频率闪烁。

  • 当不使用电池底座时,请按下按钮进入睡眠模式,所有LED指示灯都会关闭。

检测锂聚合物电池状态

  1. 请访问 SparkFun_BQ27441_Arduino_Library 存储库并将整个存储库下载到您的本地驱动器。

  2. 现在,可以将库安装到Arduino IDE中。打开Arduino IDE,点击sketch -> Include Library -> Add .ZIP Library,选择您刚刚下载的SparkFun_BQ27441_Arduino_Library 文件。

InstallLibrary

示例代码

您可以使用以下代码从电池底座读取统计信息。

#include <SparkFunBQ27441.h>
#include"TFT_eSPI.h"

TFT_eSPI tft;
TFT_eSprite spr = TFT_eSprite(&tft); // Sprite
#define FF17 &FreeSans9pt7b

const unsigned int BATTERY_CAPACITY = 650; // Set Wio Terminal Battery's Capacity

void setupBQ27441(void)
{
// Use lipo.begin() to initialize the BQ27441-G1A and confirm that it's
// connected and communicating.
if (!lipo.begin()) // begin() will return true if communication is successful
{
// If communication fails, print an error message and loop forever.
Serial.println("Error: Unable to communicate with BQ27441.");
Serial.println(" Check wiring and try again.");
Serial.println(" (Battery must be plugged into Battery Babysitter!)");
tft.setTextColor(TFT_RED);
tft.setCursor((320 - tft.textWidth("Battery Not Initialised!"))/2, 120);
tft.print("Battery Not Initialised!");
while (1) ;
}
Serial.println("Connected to BQ27441!");

// Uset lipo.setCapacity(BATTERY_CAPACITY) to set the design capacity
// of your battery.
lipo.setCapacity(BATTERY_CAPACITY);
}

void printBatteryStats()
{
// Read battery stats from the BQ27441-G1A
unsigned int soc = lipo.soc(); // Read state-of-charge (%)
unsigned int volts = lipo.voltage(); // Read battery voltage (mV)
int current = lipo.current(AVG); // Read average current (mA)
unsigned int fullCapacity = lipo.capacity(FULL); // Read full capacity (mAh)
unsigned int capacity = lipo.capacity(REMAIN); // Read remaining capacity (mAh)
int power = lipo.power(); // Read average power draw (mW)
int health = lipo.soh(); // Read state-of-health (%)

// Now print out those values:
String toPrint = String(soc) + "% | ";
toPrint += String(volts) + " mV | ";
toPrint += String(current) + " mA | ";
toPrint += String(capacity) + " / ";
toPrint += String(fullCapacity) + " mAh | ";
toPrint += String(power) + " mW | ";
toPrint += String(health) + "%";

Serial.println(toPrint);

// LCD Graphics
tft.setTextColor(TFT_BLUE);
tft.drawRoundRect(10, 10, 300, 220, 10, TFT_BLUE);
tft.setTextColor(TFT_MAGENTA);
tft.drawString("State of Chage:", 20, 30);
tft.drawString("Battery Voltage:", 20, 55);
tft.drawString("Average Current:", 20, 80);
tft.drawString("Remain Capacity:", 20, 105);
tft.drawString("Full Capacity:", 20, 130);
tft.drawString("Average Power:", 20, 155);
tft.drawString("State of Health:", 20, 180);

// Data
spr.createSprite(80, 170);
spr.fillSprite(TFT_BLACK);
spr.setFreeFont(FF17);
spr.setTextColor(TFT_WHITE);
spr.drawString(String(soc)+" % ", 0, 0);
spr.drawString(String(volts)+" mV ", 0, 25);
spr.drawString(String(current)+" mA ", 0, 50);
spr.drawString(String(capacity)+" mAh ", 0, 75);
spr.drawString(String(fullCapacity)+" mAh ", 0, 100);
spr.drawString(String(power)+" mW ", 0, 125);
spr.drawString(String(health)+" % ", 0, 150);
spr.pushSprite(170, 30);
spr.deleteSprite();
}

void setup()
{
Serial.begin(115200);
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
tft.setFreeFont(FF17);
setupBQ27441();
tft.setTextColor(TFT_GREEN);
tft.setCursor((320 - tft.textWidth("Battery Initialised!"))/2, 120);
tft.print("Battery Initialised!");
delay(1000);
tft.fillScreen(TFT_BLACK);
}

void loop()
{
printBatteryStats();
delay(1000);
}

原理图在线查看器

资源

技术支持

感谢您选择我们的产品!我们在这里为您提供不同的支持,以确保您对我们的产品的体验尽可能顺利。我们提供多种沟通渠道,以满足不同的偏好和需求。

Loading Comments...