This code is an IoT project that monitors temperature and humidity using the ESP8266 Wi-Fi module and a DHT11 sensor. The data is displayed on a web server running on the ESP8266 and can be sent to a remote server using HTTP POST requests.
- Web server from ESP8266 not public its local use only.
- API (Get everything in database saved)
- API (Last data from database by Datetime)
- ESP8266 Wi-Fi module
- DHT11 sensor
- Arduino IDE
- ESP8266 libraries (ESP8266WiFi, WiFiClient, ESP8266WebServer, ESP8266HTTPClient, and DHT)
- .Net 7
- postgreSQL
- Install the required libraries in the Arduino IDE:
- ESP8266WiFi
- WiFiClient
- ESP8266WebServer
- ESP8266HTTPClient
- DHT
- Clone or download the repository to your local machine.
- Open the .ino file in the Arduino IDE and replace the placeholder values for ssid, password, and host with your Wi-Fi credentials and the URL of the remote server.
- Connect the ESP8266 module and the DHT11 sensor to the board following the pin assignments in the code.
- Upload the code to the board and check the serial monitor for the IP address of the web server.
- Install .NET Core 7 on your local machine.
- Open the solution in Visual Studio and edit the appsettings.json file to include the connection string for your PostgreSQL Server database.
- Build and run the solution.
The connection diagram shows how to connect the DHT11 sensor to the ESP8266:
- Connect the VCC pin of the sensor to 3.3V on the ESP8266.
- Connect the GND pin of the sensor to GND on the ESP8266.
- Connect the data pin of the sensor to digital pin 2 (D4) on the ESP8266.
Once the code is uploaded and the board is connected to the Wi-Fi network, you can access the web page displaying the temperature and humidity data by visiting the IP address of the ESP8266 in a web browser. The data will be sent to the remote server at regular intervals specified in the code.
If you would like to contribute to this project, you can submit a pull request or open an issue on the GitHub repository.