A complete project integrating ESP32, Arduino, and PHP backend using XAMPP.
This system allows you to display live sensor data, store it in a database, and visualize readings with real-time charts.
├── 📂 Arduino/
│ ├── 📂 session3/
│ │ └── session3.ino
│ ├── 📂 session3core/
│ │ └── session3core.ino
│ ├── 📂 session3googledocs/
│ │ └── session3googledocs.ino
│ ├── 📂 web-server-led/
│ │ └── web-server-led.ino
│ ├── 📂 libraries/
│
├── 📂 xampp/
│ └── 📂 htdocs/
│ ├── backend.php
│ ├── index.php
│ ├── fetch_data.php
│ ├── graph.html
│ ├── style.css
│ |── 📂 Live-Prediction/
│ | ├── predict_data.php
│ | └── predict.py
│ └── 📂 webserver/
│ └── index.html
-
Download & Install XAMPP
- Download XAMPP
- Install and launch Apache and MySQL from the XAMPP Control Panel.
-
Database Setup
-
Open phpMyAdmin at: http://localhost/phpmyadmin
-
Create a new database (e.g.,
esp32_data) -
Run the following SQL to create your table:
CREATE TABLE sensor_data ( id INT AUTO_INCREMENT PRIMARY KEY, temperature FLOAT, humidity FLOAT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
-
-
Place Project Files
- Move all PHP and HTML files into:
C:\xampp\htdocs\ - Run locally at:
http://localhost/yourfoldername
- Move all PHP and HTML files into:
-
Install Arduino IDE
Download from https://www.arduino.cc/en/software -
Add ESP32 Board
- Go to File → Preferences
- Add this URL in Additional Board Manager URLs:
https://dl.espressif.com/dl/package_esp32_index.json - Then go to Tools → Board → Board Manager, search for ESP32 and install it.
-
Install Required Libraries
- Import the provided ZIP library files
-
Project Files
- Move your Arduino
.inofiles into:Documents/Arduino/ - Open your main
.inofile and upload to ESP32
- Move your Arduino
- Receives data from ESP32 via HTTP POST
- Inserts data into MySQL database
- Displays stored data in a clean front-end interface
- Uses AJAX to fetch live data from the database
- Updates chart in real-time for monitoring
- ESP32's built-in WebServer page
- Displays sensor readings directly from ESP32 without database
-
Start Apache and MySQL from XAMPP
-
Connect your ESP32 to Wi-Fi
-
Open:
- Local dashboard: http://localhost/RoboticsBootcamp/index.php
- Live graph: http://localhost/RoboticsBootcamp/graph.html
- ESP32 WebServer: use the IP shown in Serial Monitor (e.g.
http://192.168.0.120)
- Ensure ESP32 and PC are connected to the same Wi-Fi network
- If you face database connection issues, check:
backend.phpcredentials (hostname, username, password)- MySQL running properly in XAMPP
Developed by Minhaj Udin Hassan
GS, Premier University Robotics Club
Department of Computer Science & Engineering
Premier University