Skip to content

An open-source, battery-powered temperature and environmental monitoring sensor.

License

Notifications You must be signed in to change notification settings

mawaeg/OpenESPTemp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenESPTemp

OpenESPTemp is an open-source, battery-powered temperature and environmental monitoring sensor built using ESP32-C3 and a BME280 sensor. It can easily be integrated into IoT systems.

This repository includes a pcb design, a 3d printed case and basic firmware.

PCB Front PCB Back

Features

  • Temperature Monitoring: Accurate readings with the BME280 sensor.
  • Environment Sensing: Includes humidity and pressure measurements.
  • Low Power: Optimized for battery-powered operation.
  • Battery Monitoring: Allows to monitor the battery voltage.
  • Open Source: Fully customizable for your specific needs.
  • ESP32-C3 Powered: Leverages the capabilities of the ESP32-C3 for efficient wireless communication and processing.

Getting Started

Pcb

To get started you first need a version of the pcb using the manufacturing files included in the latest release.

I got my pcb assembled from PCBWay.

I noticed JLCPCB has troubles assembling the pcb as the bme280 can only be assembled with their standard smt service which does not support such small pcbs.

  • If you want to assemble the pcb yourself please lookup the files in the BOM from the latest release.

Other needed parts

Part Quantity Link (recommendation) Note
3D Printing Filament (PETG) 40g PETG Filament
TPU Filament 2g TPU Filament
M2.5 Heat Inserts 7 Heat Inserts
M2.5 x 12 Screws 4 M2.5 x 12 Screws
M2.5 x 6 Screws 3 M2.5 x 6 Screws
Keystone 204 Battery Clips 2 Battery Clips
JST PH 2-Pin Cable (Male) 1 JST PH 2-Pin Cable
CR123A battery 1 CR123A
UART to USB Adapter 1 Adapter

Building the OpenESPTemp

  1. Get a PCB and prepare it by soldering the components onto it (if not already done through SMT assembly)
  2. Print the case (and the seal) with standard print settings and a layer height of 0.2 mm
  3. Insert the Heat Inserts into the holes provided using a soldering iron
  4. Solder both wires of the JST Cable onto a battery clip and press them into the space into the top part of the case
  5. Put the seal onto the top part of the case and the 4 small parts on the nubs where the pcb will go to protect it from scratches
  6. After flashing the firmware (described in the next chapter) you can screw the pcb into place
  7. Insert the battery (Check the polarity and never connect USB to UART and battery at the same time) and connect the battery cable to the pcb
  8. The sensor should start sending data
  9. You can screw the top part of the case onto the bottom part

Assembled sensor

Building the OpenESPTemp Firmware

  • The firmware can be compiled and flashed with PlatformIO.
  • By default the sensor connects to a given WIFI network and sends data every 15 minutes to a given api endpoint.
  • To be able to build the firmware you need to configure the firmware first.
  • For that you need to create a file called SECRETS.h under /firmware/generic/src/
    The file should look like that:
       const char* wifi_ssid = "Your wifi ssid";
       const char* wifi_pswd = "Your wifi password";
       const char* post_url = "your api endpoint the data should be sent to";
       const char* x_access_token = "your Bearer token for the Authorization header";

Compile

  • You can build the project in debug mode to get debug information over UART or in release without debug information:
       platformio run --environment esp32-c3-debug
       platformio run --environment esp32-c3

Flashing the OpenESPTemp Firmware

  • First you have to connect the UART to USB Adapter to the Pcb.
  • The wiring should look like this:

Flash wiring

NOTE: When connecting the UART to USB adapter your must disconnect the battery beforehand!

  • To flash using PlatformIO use the following command:
    • platformio run --target upload --environment esp32-c3
  • When you see Looking for upload port... in the console you have to put the ESP32 in boot mode:
    1. Push the Reset and the Boot button at the same time
    2. Release the Reset button while keep pressing the Boot button.
    3. The upload should now start and you can release the Boot button.

PCB Design

The PCB for OpenESPTemp includes the following features:

  • Voltage Divider: Allows monitoring of battery health.
  • Exposed UART Header: Facilitates flashing and serial communication.
  • JST 2-Pin Connector: For connecting a battery.
  • BME280 Environmental Sensor: Measures temperature, humidity, and pressure.
  • ESP32-C3: Powers the sensor and handles wireless communication and processing.

The PCB for OpenESPTemp was designed using Flux. A copy of the project is included under electronics, but you can also view the current version here: Project Link.

Future versions of the OpenESPTemp hardware will transition to KiCad.

Troubleshooting

TBD


Coming next

  • Move pcb to KiCad
  • Include mounting bracket for the case
  • Include HomeAssistant integration
  • Use ESP32-C6 to add ability to use Thread / Matter / Zigbee
  • Use Low Power Timer with Power Latch to further reduce power consumption

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.


About

An open-source, battery-powered temperature and environmental monitoring sensor.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages