Contents
Another common applications of ioBridge’s technology is to remotely monitor sensor data over the internet, log the results, and display historical data on a dashboard, and send email or other alerts.
This tutorial shows you one way to do this following a step-by-step wizard and without writing any code.
Project Components
-
ioBridge IO-204 or Gamma PRO
-
ioBridge Temperature Probe (FB-2)
-
Wire jumper
Step 1 – Set up your Web Gateway to Monitor your Sensor
ioBridge web gatewayss can be used to monitor many types of sensors. The ioBridge web gatewayss include 0-5V analog inputs (with 10-bit or 1024 steps of resolution. Many sensors output a DC voltage proportional to their sensor reading that can be connected to the analog inputs on the ioBridge web gatewayss. The DC voltage between 0 and 5 volts is converted to a “RAW” value between 0 and 1023 using the following expression:
RAW = 1023 x (Input Voltage in volts)/5
in whole numbers. For example 3V connected to analog input on an ioBridge web gateway will give a RAW value of:
RAW = 1023 x 3/5 = 614
Other sensors such as 4-20 mA sensors and pulse output meters can also be used but that is beyond the scope of this tutorial.
For this tutorial we are going to assume that you have set up the ioBridge Temperature Probe (FB-2) following the steps in the tutorial Tutorial 2: Remote Temperature Monitoring and Display.
To log temperature you need to set up your web gateway to send the temperature value to the ioBridge server. This is done on the Modules page under Settings. Set the Channel Push Update Mode: to Push Analog Input Value Periodically and set the Auto Message Period (seconds): to 60 as shown below:
Step 2 – Creating a Data Log
After Signing In click in the Modules menu to display the Modules page as shown below:
Click Add Data Log and then select Analog Input Logging and click Next.
Select the web gateway or Module you are using and the Channel the Sensor is connected to. Select Temperature (F) for the Analog Scale. Note that this is an option that only works with the Temperature Probe (FB-2). Select your desired logging frequency (in this case 10 Minutes) and click Create Data Log.
A new data log is created.
Step 3 – Create a Chart of your Data Log and Display it on the Dashboard
By now you should be getting the hang of following the Wizards so fewer images will be used to illustrate the steps going forward. The next step is to create a Data Log Chart Widget.
-
Click on the Widget menu
-
Click Create Widget
-
On the Create Widget page select Chart and click Next
-
Select the data log you wish to chart (i.e. New Analog Input Log) and click Create Widget
You should then see a page similar to the following:
You can now update the label and click on the + (change to -) to place the chart on your dashboard. Click on the Dashboard to view your chart.
Step 4 – Send Email Alerts
In this final step you are going to set up the ioBridge server to send an email alert when the temperature goes above 80F and again when the temperature goes below 75F. This is going to be done using Server-side actions and more specifically the Analog Input Messaging feature.
Note that the Temperature Probe is currently connected to channel 1 and that channel 1 is set to send analog value updates to the server every 1 minute for data logging. Because channel 1 is sending updates every 1 minute for data logging it should not be used to send temperature alerts and another channel should be used.
Using a short piece of wire (20 gauge or similar) to jumper Analog In or AI on channel 1 to AI on channel 3 (we are keeping channel 2 free for a follow on tutorial), it is possible to connect the temperature probe to both channel 1 and channel 3 at the same time as shown below.
Now that channel 3 is also connected to the temperature probe it is possible to set up channel 3 so that it pushes a temperature value to the server when the temperature reaches 80F and again when the temperature drops to 75F. This is done from the web gateway Channels page as follows:
The important settings are as follows:
-
Channel Push Update Mode:
-
Push Update on Analog Trigger and Reset
-
Auto Message Period (seconds): 10
-
Analog Scale: Temp F
-
Analog Trigger: 80.0
-
Analog Reset: 75.0
The final step is to configure the server to send a text message when the updates are received from channel 3.
Go to the Actions page. Add an email address Add Account, Email Address (note that you could alternatively send a Tweet), Next», and Enter Account Label and Email Address and return to the Actions tab.
Create server-side email alerts as follows: Click on Create Action, select Analog Input Messaging, select your web gateway, select Channel 3 and then enter account and enter message conditions as follows using the email account that you created earlier:
and click Create Action. Note that the Analog Trigger Value is set to 0. Since the pushed values are always creater than 0 an email will be triggered every time a value is pushed. Note that it is also possible to have two unique emails sent for the high or low temperature values (see Digital Input Messaging for more details).
You can now test your set up by heating up your sensor above 80F and then cooling it down below 75F. A convenient way to do this is by dipping the temperature probe into, a glass of cool water (below 75F), and then a glass of warm water (above 80F), and then again into a glass of cool water (below 75F) to reset.
You should receive two email messages that look similar to this: