The objective of this project was to use and Arduino to read a sensor and send the values to the internet, to be stored in a Web Server and displayed.
It consists in an Arduino Uno with an Ethernet Shield and a DHT 11 temperature / moisture sensor, acting as a Web Client. It sends POST requests with the readings to a web server running a custom Database and PHP application.
The PHP app stores the values when new POST requests are received and also serves the pages that display the information. In Part 2, i will explain the use of D3.js to dynamically show the data stored in the Database.
The Arduino it's configured to use a Dynamic IP Address, in order to solve any conflicting IP issues, and also to work easily with most home networks/routers.
This project is divided in 2 main parts:PART 1
- Arduino Web client Application: reads the sensor values and sends them to the webserver.
- PHP/MySQL Application: handles the POST requests that are sent to the server and serves the pages to clients who connectPART 2
- You need access to a web server ( can be from a free hosting company ) with capability to run PHP applications and also to create databases. ( possibly cPanel with phpMyAdmin)
Request Maker: This online tool is very useful to test the PHP application. You can simulate the POST requests that will be made by the Arduino and check if everything is working well.
The code is very simple, all the important section are commented. If you have any doubt feel free to ask.