GithubHelp home page GithubHelp logo

ni-c / esptemp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5.85 MB

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

License: MIT License

C++ 100.00%
battery esp12f esp8266 homeassistant htu21d humidity-monitoring humidity-sensor mqtt temperature-monitoring temperature-sensor

esptemp's Introduction

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

esptemp's People

Contributors

ni-c avatar

Stargazers

 avatar

Watchers

 avatar

esptemp's Issues

Battery drains if WiFi is not available or working

Subject of the issue

Battery drains fast if the WiFi is not available or the WiFi connection is not working.

Affected versions

  • v1.0

Steps to reproduce

Turn off your WiFi for a while and check the battery voltage or percentage before and after.

Expected behaviour

Battery drain should be reduced, if WiFi is not available or not working, the device should not try to reconnect to the WiFi every 5 minutes. Instead it should go to sleep for a longer time between reconnect-tries and resume to normal operation if the WiFi is working again.

Actual behaviour

When WiFi is not available, the battery drain is around 3.75% per day (under normal operation it is 0.5% per day). That's because the device tries to connect to the WiFi every 5 minutes until a connection timeout occurs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.