Help on avr + webpage

Hello everyone,

i am working on my thesis and what i want to do is to create a webpage to monitor the results of 3 different sensors, thermometer,accelerometer and a light sensor and insert those data in 3 tables with one column showing the time and the 2nd column the value of each sensor. Moreover i would like to create plots of these data for each sensor with y-axis the sensor data and x-axis time. The platform i work on is an stk600 featuring the atmega2560 microcontroller and the enc28j60 ethernet controller. So far i have created one table showing temperature but i have not found a way to monitor the current time which i want to be shown at the first column. Could you propose me a way to do this? And also can you suggest me a good way to create plots from the data i take from my sensors? I forgot to tell you that i write html code on my main program to create tables etc. If there is a better way to do those things i would be appreciated if you could tell me.

Thank you in advance.

i have not found a way to monitor the current time

The Arduino knows the time relative to when it was powered on. If you want real time, you'll either need to get the time from the net when the Arduino starts up and used the Tme Library Arduino Playground - HomePage or use an external Real Time Clock (RTC) module, which will keep good time until its battery goes flat in a year or two.

i write html code on my main program to create tables etc. If there is a better way to do those things i would be appreciated if you could tell me

The overall structure of your page will need to be either hard coded into the program or you could load it from external storage e.g. SD card.

As you need to display dynamic data, I'd suggest you use a text substitution method to insert / replace special tags in your code with the dynamic data.

With this method you can put most of the HTML in either PROGMEM or SD etc and just build the dynamic parts in the program.

Re: Plotting data.
You have not said what sort of plot you need. There are a myriad of different types of plots, some more difficult than others to generate.
There are also lots of javascript based libraries for plotting on web pages e.g. highcharts, however its a massive package and you'd need to put it onto SD if you wanted to host it locally, rather than via an external Content Delivery Network.
I also suspect that serving large files from the Arduino is going to be a lot slower than the browser getting them from a CDN.

panos21g:
i have not found a way to monitor the current time which i want to be shown at the first column. Could you propose me a way to do this? And also can you suggest me a good way to create plots from the data i take from my sensors?

Put the web server and data storage on a PC and have the data passed to the PC as they are collected. Do the timestamping on the PC. I would suggest using a relational database to store the data. Once you have the data in an RDB and a PC-hosted web server you have access to a wide variety of reporting and visualisation tools, WYSIWYG website page editors and so on - the whole solution gets much easier to implement and the result is dramatically more capable than a purely Arduino-based solution. To get the data into the database you could have the web app on the PC open the Arduino serial port and store the data received from it, or give the Arduino a network interface and have it post the data to your PC-based web app.