Skip to content
/ ESPtemp Public

Battery powered ESP8266 controlled temperature and humidity sensor communicating via MQTT protocol.

License

Notifications You must be signed in to change notification settings

ni-c/ESPtemp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPtemp

Battery powered ESP8266 controlled temperature and humidity sensor communicating via MQTT protocol (with Home Assistant).

ESPTemp v1.0 with case

ESPtemp is a battery-powered device that detects temperature and humidity and transmits them to a server (like Home Assistant) via WiFi using MQTT. It measures the current temperature, humidity and battery voltage, transmits them and then goes into deep sleep for 5 minutes to save energy. After that, the process is repeated. To make the connection to the WiFi as fast as possible, the WiFi channel and the MAC address of the router are stored in the RTC memory of the microcotroller and used to speed up the next connection attempt.

The device uses an ESP-12F microcontroller to process and transmit the data. Temperature and humidity are measured by a HTU21D sensor. The required operating voltage of 3.3V for the MCU and the sensor is provided by a MCP1700-3302E low dropout voltage regulator. The power supply is a lithium-ion battery type 18650 with 3.7V and 3500mAh. The protection of the circuit and the lithium-ion battery is ensured by a 200mA fine-wire fuse. The circuit is built on a double-sided prototype PCB board for ESP8266 and ESP32.

ESPTemp v1.0 without case

Part list

Schematics

Schematics

Perfboard layout

Front

Perfboard front

Back

Perfboard back

Assembled

Perfboard back Perfboard back

Firmware

The firmware is written in C++ using Visual Studio Code with the PlatformIO extension.

⚠️ Before building the firmware be sure to copy the file include\config.h.example to include/config.h and change the WiFi and MQTT credentials as well as the other settings in the new file.

Flash via serial connection

Connect RX, TX and GND to your serial interface or USB-to-TTL converter. To enter flash mode on the ESP-12F you must connect GPIO0 to GND and reset the MCU.

Flash via OTA

To flash the ESP8266 Over-The-Air, connect GPIO 14 to VCC and reset the ESP8266. After reboot it will enter the "OTA wait loop". The flashing blue LED indicates that the MCU is waiting for the OTA firmware update.

TODOs

  • Create an ESPHome configuration to use the hardware without the firmware provided here