• Home
  • Microcontrollers
  • Frameworks
  • Protocols
  • 3D Printing
  • Web
  • Other
  • ESP32
    • Datasheets
    • Software
    • Timer Cam OV3660
    • TTGO T-Display
    • TTGO T5-EPaper
    • M5 Stick C Plus
    • FireBeetle
    • M5 Atom Lite
    • ESP-Now
    • ESP-Mesh
    • Wall Display
    • Round Display
    • S2 Saola 1
    • C3 Dev Kit M1
    • Debug
    • ESP32 D1 Mini
    • ESP32 C3 DevKit M1
  • Risc-V
  • STM32
  • nRF52
    • Thread SensorTag
    • UWB DWM3001 cdk
    • UWB DWM1001 dev
    • Trick Tracker
    • Simple Mesh SensorTag
    • nRF52840 USB dongle
    • nRF52832 UART dongle
  • nRF53
    • thingy53

Overview

  • 10 uA deep sleep current
  • USB and external DC battery power inputs (3.3V - 5V)
  • battery charging from USB external DC
  • TP4056 Li-Ion battery charger
  • RT9080 Low Drop out Linear Regulator
  • supported by platformio (board=firebeetle32)

PINS

  • LED : (IO2)
  • VBAT : (A0 - 36 - SENSOR_VP) measure ratio = 0.5

Danger

The 0 Ohm resistors R10 and R11 needed to sense the battery voltage by A0-Pin38 are not populated (as of the boards I have). Therefore solder bridges are required to be added manually 😢
  • Another caveat is the usage of pin 36 A0 which conflicts with wifi. To avoid that, in the program below, the battery is measured before the wifi is activated.

Gallery

Links

FireBeetle - DFRobot
Wiki
Schematics
User Manual

Related products

Solar Power Manager Micro

Applications

ESP32 Program Github Repo

Config

{
    "mqtt" : {
        "host":"10.0.0.42",
        "port":1883,
        "client_id":"esp_firebeetle_1"
    },
    "base_topic":"esp/firebeetle_1",
    "deep_sleep_sec":10
}
Copied!

Main

main.cpp
#include "Arduino.h"
#include <WiFi.h>

#include <ArduinoJson.h>
#include "freertos/FreeRTOS.h"
#include <WiFi.h>
#include <MQTT.h>
#include <esp_wifi.h>

#include "json_file.h"
#include "battery.h"
#include "wifi_secret.h"

DynamicJsonDocument config(1*1024);//5 KB
MQTTClient mqtt(1*1024);// 1KB for small messages
WiFiClient wifi;//needed to stay on global scope

void setup() {

  Serial.begin(115200);
  uint32_t vref = bat_init();
  Serial.printf("eFuse Vref:%u mV\n", vref);
  float battery_f = bat_get_voltage();
  battery_f /=1000;

  pinMode(LED_BUILTIN, OUTPUT);
  blink(100);
  WiFi.begin(ssid, password);
  load_config(config,true);
  timelog("config loaded");

  if(connect()){
    mqtt_publish_status(battery_f);    timelog("=>status");
    mqtt.loop();
  }

  Serial.println("ESP going to deep sleep");
  Serial.flush();
  blink(100);

  esp_wifi_stop();
  uint32_t deep_sleep_sec = config["deep_sleep_sec"];
  esp_deep_sleep(deep_sleep_sec*1000000);
  esp_deep_sleep_start();

}

void loop() {
  //no loop
}
Copied!
Build info...
PACKAGES:
 - framework-arduinoespressif32 3.10004.201016 (1.0.4)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
 ...
 Dependency Graph
|-- <WiFi> 1.0
|-- <ArduinoJson> 6.16.1
|-- <MQTT> 2.4.7        
|-- <FS> 1.0
|-- <SPIFFS> 1.0        
|   |-- <FS> 1.0   
Copied!
Details...
[env]
board = firebeetle32
framework = arduino
lib_deps =
    WiFi
    ArduinoJson@6.16.1
    617@2.4.7   #MQTT 256dpi/arduino-mqtt
lib_ldf_mode = deep+
[env:firebeetle32]
platform = espressif32
monitor_speed = 115200
Copied!
  • Overview
    • PINS
    • Gallery
    • Links
    • Related products
  • Applications
    • Config
    • Main

footer