I did some extensions to my Ardulink MQTT project. My plan was to have a graph of the values of the two analog sensors connected to the Arduino. So this is what I did in general:
- Deploy the Ardulink sketch to the Arduino
- Connect your analog sensors to the Arduino
- Connect the Arduino to a PC
- On the PC run the Ardulink’s MQTT module. I did by calling “java -jar Mqtt-0.5.1-SNAPSHOT.jar -athms 2000 -ato 0 -a 0 -a 1” to watch analog port 0 and 1
- Install graphite on a machine
- Because graphite cannot read mqtt messages you need to install and run mqtt2graphite as well. It subscribes to MQTT and pushes the payload to graphite/carbon. You have to enable UDP in carbon/graphite which is disabled by default!
After that you can open graphite in your browser and configure a view to show the data.
This is my example with the two analog sensors, sensor a0 is the soil moisture, a1 is a LDR (measuring the sunlight). As you can see that there were two watering actions (raising a0 values)