ESP32 DHT22 Temperature Humidity to MySQL Database
ESP32 DHT22 Temperature Humidity to MySQL Database I have decided to replace the Arduino Nano, DHT22 and HC-05 Module with something more simple, smaller, cheaper and with longer battery life. The main focus of this project is the code, for a simple power supply a power bank should last a week or more. The power usage will be 3mA for 99% of the time and only rising to ~140mA for a few seconds per reading. The following were used : ESP32 Devkit C DHT22, temperature humidity sensor MySQL database on local network eg. Raspberry Pi with MariaDB, phpMyAdmin is usefull as well. USB Powerbank Breadboard, wires etc. To connect the DHT22, connect + to 3.3v, Out to pin 14, Gnd to Gnd. Simple :) The complete code is below with extra comments shown in bold. Parts that you need to change are shown in red. The code can be downloaded from gitlab https://gitlab.com/leahC123/ESP32DHT22MYSQL/-/blob/master/ESP32DHT22.ino ------------------------------------------------------------------...