This repository contains an implementation of a simple HTTP webserver for an ESP32 microcontroller. The ESP32, connected to a WiFi network, is used to control a LED as well as read and process the values from a thermistor and a photoresistor.
The communication between the clients and the webserver is done using AJAX with jQuery in the clients. JSON is used as data format and charts.js for data visualization.
The following parts have been used in the electronic circuit. Nevertheless, they can be replaced by other similar ones with little change in the code.
- 1x LED.
- 1x MF52D NTC thermistor.
- 1x photoresistor.
- 2x 1 kΩ resistances.
- 1x 10 kΩ resistance.
Note: ESP32 ADC2 pins cannot be used when Wi-Fi is used.
ESP32 libraries:
External libraries:
- ArduinoJson. JSON library for embedded C++.
- Build the circuit as shown in the schematic.
- Install the standard ESP libraries either using the Arduino IDE or directly from Espressif.
- Install the required external libraries.
- Download the repository and rename the file constants.h.TEMPLATE to constants.h.
- Change the SSID and PASSWORD correspoding to the WiFi network.
- Change the IP address and gateway if necessary in constants.h and index.h.
- Flash the ESP32:
- For VSCode, modify the arduino.json and c_cpp_properties.json files to add the missing libraries.
- For the Arduino IDE, change the src folder to match the name of the .ino file.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.