This project uses esp8266 and python to measure temperatures and write to MySQL database.
Python >= 3.12 Pip MySql database Esp8266
Install packages using pip pip install -r requirements.txt
You need to create a database named esp_data. Then you can use this script to create a table:
CREATE TABLE 'temp_data' ( 'id' int NOT NULL AUTO_INCREMENT, 'temp' float NOT NULL, 'time' timestamp NOT NULL, 'sensor_id' int NOT NULL, PRIMARY KEY ('id') ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
or you can run setup.py
file.
To use this project you need an esp8266 with wifi support. You need only
- port D7, 3v, GND.
- a temperature sensor like 0750C3
- installed esp8266 plugin (fast tutorial)
- know your wifi ssid and password
Here is a photo of the schema that is used:
Tip
You can use any esp8266 board and connect up to 8 sensors to pin D7.