• Home
  • Robotics
  • 3D Printing
  • Web
  • Microcontrollers
  • Frameworks
  • Protocols
  • Other
  • Explore knowledge
  • Loading graph.
    Depth
    …
    … visible
  • Home
  • Robotics
  • 3D Printing
  • Web
  • Microcontrollers
  • Frameworks
  • Protocols
  • Other
Tools
    Pages
    • Microcontrollers
      • ESP32
        • C3 Dev Kit M1
        • Datasheets
        • Debug
        • ESP-Mesh
        • ESP-Now
        • ESP32 C3 DevKit M1
        • ESP32 D1 Mini
        • ESP32-C3 0.42 Oled
        • FireBeetle
        • M5 Atom Lite
        • M5 Stick C Plus
        • m5 stick V
        • Round Display
        • S2 Saola 1
        • Software
        • Thermostat Control
        • Timer Cam OV3660
        • TTGO T-Display
        • TTGO T5-EPaper
        • Wall Display
        • Waveshare S3 3.5 Inch display
      • nRF52
        • nRF52832 UART dongle
        • nRF52840 USB dongle
        • Simple Mesh SensorTag
        • Thread SensorTag
        • Trick Tracker
        • UWB DWM1001 dev
        • UWB DWM3001 cdk
      • nRF53
        • thingy53
      • Risc-V
      • STM32
        • Black Pill
        • Blue Pill
        • Dev EBox F407
    Pages
    • Microcontrollers
      • ESP32
        • C3 Dev Kit M1
        • Datasheets
        • Debug
        • ESP-Mesh
        • ESP-Now
        • ESP32 C3 DevKit M1
        • ESP32 D1 Mini
        • ESP32-C3 0.42 Oled
        • FireBeetle
        • M5 Atom Lite
        • M5 Stick C Plus
        • m5 stick V
        • Round Display
        • S2 Saola 1
        • Software
        • Thermostat Control
        • Timer Cam OV3660
        • TTGO T-Display
        • TTGO T5-EPaper
        • Wall Display
        • Waveshare S3 3.5 Inch display
      • nRF52
        • nRF52832 UART dongle
        • nRF52840 USB dongle
        • Simple Mesh SensorTag
        • Thread SensorTag
        • Trick Tracker
        • UWB DWM1001 dev
        • UWB DWM3001 cdk
      • nRF53
        • thingy53
      • Risc-V
      • STM32
        • Black Pill
        • Blue Pill
        • Dev EBox F407
    Home/Microcontrollers/ESP32/fire-beetle
    Metadata
    description
    Low power design with ESP-WROOM-32 module with 10 uA deep sleep
    date
    2021-02-26
    tags
    Board, LowPower
    features
    ["10 uA deep sleep current","USB and external DC","TP4056 Li-Ion battery charger"]

    Overview

    image-firebeetle_board.png
    ×
    • 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

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

    Main

    main.cpp
    C++
    #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
    }
    
    Build info...
    Bash
    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   
    Details...
    Ini
    [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
    ← PreviousM5 Stick C PlusNext →M5 Atom Lite
    On this page
    • Overview
      • PINS
      • Gallery
      • Links
      • Related products
    • Applications
      • Config
      • Main
    Open page ×