Fish and Chip
In this article I’m showing you how to manage the SensorTag IoT device as an Aquarium ambient thermometer and to measure the ambient lighting level.
For my prototype I used my son’s aquarium with a blood parrot cichlid (the Fish) and my SensorTag (the Chip) 🙂
The prototype’s goal is to check the average ambient temperature and the average ambient lighting and alert me (or my wife) when the mean values are too high. Get started with my Fun Watson Internet of Things project:
To get input from IoT device attached to the aquarium I used as input node the IBM Internet of Things Foundation node.
The input node receives events sent from devices and it produces an object called msg and sets msg.payload to be a string containing the payload of the incoming message. I wired the input node with a debug node to check in real-time the data sent from my device and the freeboard dashboard.
I used an alarm node (Temperature sample rate) to introduce a rate limits messages. When set to rate limit messages, they are spread across the configured time period. It can also be set to discard any intermediate messages that arrive.
I used an smooth node (temperature mean value) to calculate the average temperature, or the average light, over a specified number of previous values. In my prototype I calculate the average temperature last 2 hours.
By a simple function node I write code to check the values, if the average ambient temperature is over the limits allowed, in our scenario the range is 16˚ / 33˚ Celsius degree, an email is sent.
By a mail node configured with personal gmail account the flow is able to sent emails.
I used Freeboard real-time interactive dashboard, in my node-RED environment, for real-time data:
It’s very funny to use the new IBM’s technologies, greetings from my fish and from my chip 🙂