The project I’ve been tinkering with involves sending light data from a voltage divider/photoresistor circuit and broadcasting that light intensity data to the web. Here is a video to explain:
My github repository is here. Functionality is achieved using 6 files (who could use a much betternaming convention but I am all about speed!):
- LightSensor.php – The public facing webpage is generated with the PHP script.
- LightSensorWriteToFile.php – PHP script the Arduino sketch calls upon using HTTP GET request to send sensor data to server for storage.
- sensor.css – Used by LightSensor.php to make the format look really pretty like!
- sensorLog.txt – The archive log of sensor readings sent to the server.
- WebPHPLightSensor.ino – The firmware sketch that runs on the Arduino to handle sensor interfacing and communication to the web.
- ProcessingPHP.pde – Processing sketch that help visualize the sensor log data by generating a graph from the sensorLog.txt file. Can be refreshed as desired by clicking in the window and pressing ‘R’ on the keyboard.