Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ Sprig-C3 Public template

This is the repo of my SPrig-C3 project, which includes an ESP32 development board I made to simplify the deployment of small battery-powered devices for use with Home Assistant and ESPHome.

License

Notifications You must be signed in to change notification settings

Frapais/Sprig-C3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sprig-C3 ESP32 Development Board

This is the repository of the Sprig-C3 project. An ESP32 development board made to simplify the creation of small battery-powered devices, especially useful for the Home Assistant platform.

Photo 1 Photo 2
Pinout photo 3

Description

Hardware

Main Features

  • Li-ion/Li-po battery charging & protection ICs
  • Accurate battery capacity measurement IC, accessible via I2C on pins 2 and 3.
  • USB Type-C port for charging and uploading firmware
  • RESET and BOOT pushbuttons
  • LED indicators for "charging" and "USB-power".
  • Breadboard-compatible pin headers breaking out all the pins of ESP32-C3, as well as the USB, Battery, and Vcc voltage.

I2C Pins of the Sprig-C3 board

Function Pin No
SDA 2
SCL 3

Tests

Idle Power Consumption: 66.1μA Max Charging Current: 464mA VCC Output @ 4.2V input: 3.356V VCC Output @ 3V input: ~3.359V
Idle Power Consumption

The Idle Power Consumption image shows the consumption of all the components of the board except the ESP32 module, as its consumption fluctuates depending on the tasks it's running. Therefore, if you want to calculate the battery life of your project, you should expect at least 66μA of current, in addition to the current consumption of the ESP32 module.

Power cycle energy tests

The following tests measured the total power consumption of the Sprig-C3 while in deep-sleep mode, and the average power consumption when active. For the deep sleep mode, a multimeter set to uA was used, monitoring the current consumption of the Sprig-C3 powered from an 18650 Li-Ion cell at 4.118V. For the active mode, due to the erradic changes in current consumption, an Oscilloscope was used instead of a multimeter. It measured the average current consumprion during the board's active mode, as well as the exact time this mode lasted.

The board was programmed to do the following routine:

  • Wake up and connect to WiFi
  • Read internal fuel-gauge IC
  • Post the values to a server via WiFi
  • Enter Deep-Sleep for 10 minutes.

Results:

  • Deep sleep current: 68 uA
  • Deep sleep power: 0.28 mW
  • Active average power: 11.424 mW
  • Active duration: 6.293 sec

The table below shows some images from these tests.

Given these results, the Sprig-C3 following this routine could be powered by a 2000 mAh Li-Ion cell for about 1.5 Years.

Deep sleep current Active event

Home Assistant setup using ESPHome

Requirements:

  • Access to Home Assistant Dashboard
  • Installed ESPHome addon

Main process:

  1. Connect the Sprig-C3 board on the computer running Home Assistant, while pressing the BOOT button (required only the first time).
  2. Open ESPHome, and add a new ESP32-C3 device as shown here.
  3. Copy the contents of the provided configuration file for the Sprig-C3, to the generated YAML of your ESPHome device.
  4. Upload the firmware on the board while selecting the correct port from the popup window. (It usually shows up as a "USB JTAG" device).
  5. Last step, is to go to your Home Assistant settings, and Configure your newly discovered device (assuming it is powered on and visible on the network).

Video Tutorial: Sprig-C3 first setup

Battery Capacity Measurement

The Sprig-C3 board features the MAX17048 battery capacity measurement IC connected to the respective I2C pins. As there is not complete support for this IC in the ESPHome, you need to add it as a custom ESPHome Component, or just add a MAX17043 component which is compatible.

Enabling fuel-gauge in ESPHome

Inside the Home Assistant Setup folder, you will find a YAML file.

  • First, you have to create a new ESP32-C3 device from the ESPHome plugin, as described above. (If you haven't already).
  • Inside the created YAML file, you must paste the contents of this repo's YAML file.

Voila! You can now monitor your battery status from Home Assistant with accuracy and precision!

Home Assistant Setup using MQTT

Requirements:

  • Access to Home Assistant Dashboard
  • Installed MQTT integration (Tested with Mosquitto Broker).
  • Installed Arduino IDE on your PC.

Main process:

  1. Download the provided Arduino scetch and the corresponding secrets.h header file.
  2. Open the secrets.h and replace the contents with your WiFi and your MQTT server credentials.
  3. Connect your Sprig-C3 to your PC via USB and select the detected COM port from the Arduino IDE.
  4. Upload the code to the Sprig-C3.
  5. Go the MQTT integration on your Home Assistant and manually add a new device. By default the code publishes the battery level and battery voltage to the sprigC3/batVoltage and sprigC3/batLevel topics respectively, so you need to add these topics while creating the MQTT device to immediately see the measured battery status.

Of course the provided Arduino code is just a sample, publishing the measured battery status. You can use it as a base for building your custom MQTT device with the Sprig-C3.

Availability

You can get the assembled boards in my Tindie, Lectronz, Elecrow, or my official website stores.

I sell on Tindie

Certifications

This project is certified by the Open Source Hardware Association (OSHWA)

Open Source Hardware Association Certification

Support

If you find this project useful, please consider supporting me on any of the following platforms:

About

This is the repo of my SPrig-C3 project, which includes an ESP32 development board I made to simplify the deployment of small battery-powered devices for use with Home Assistant and ESPHome.

Resources

License

Stars

Watchers

Forks

Packages

No packages published