My target for this course is to create a system where it is possible to track measurements from multiple sensors in real-time, and to do this in a scalable way. What I mean by scalable is that it should be possible to add at least dozens of sensors to the network, and the results should be easily monitored and understood. The emphasis is thus not so much on the code that is written for the devices, such as arduino, but more on the whole architecture. The code in individual arduino board should not be dependent of the way the results are shown for the end-user, only a URI where the data is sent is needed.
The system is push-based in the sense that data is pushed from the sensors to a database, from which it can be processed or used as wanted. Here, a Firebase database is used to be able to update a web-client immediately when a new reading is received. Otherwise the web-client would have to poll for new values.
I created a web application where users can registrate and login and create their own channels for receiving and showing data. Each channel has its own chart-view and can have multiple time-series’ of data. Chart-view was chosen so that historical changes can be easily noticed from the view. The data in each series in a channel updates in real-time, so that data that is send from a remote device immediately shows in the chart without polling for server or doing a page load.
The arduino part that I made consists of an Arduino duemiliano board, an Ethernet-shield and a DHT11-sensor. DHT11-sensor can measure temperature and humidity, which were used to calculate also the dew point. All the three values are sent to a proxy-server (because Firebase can only handle SLL-connections, which is a bit too much for arduino), which sends them to Firebase. The web-application has a connection to the user’s Firebase-channel and updates the chart.
A great majority of my time went to building the web-app. The arduino code was pretty trivial, as I only needed to be able to send data out and not do any processing on incoming data. All in all, I am very happy of the result, and will probably continue to develop the web-client.