Environmental Monitoring (Temperature / Humidity) December 23, 2019

To monitor the environment you will need 3 things. First, a sensor that provides the environmental condition you are looking to monitor. Second, an application that will read that sensor and log the values. Third, a way to view that data.

INTEG resells an environmental sensor from Embedded Data Systems. The sensor itself wont work directly with the JNIOR until it is wired. They have several different models that provide different environmental metrics. Temperature and humidity have been the consistent requests. INTEG also sells a rugged external sensor that tracks just temperature.

Set Up

To start, you’ll want to connect the Temp & Humidity Sensor to the JNIOR through the sensor port. After that, you’ll use the grapher application to monitor the sensor. You’ll also want the SNAP application. Here is a link to both:

You’ll want to do an update project one at a time, publishing these to the JNIOR you have the sensor connected to. After that, to get to the Grapher application, you’ll type (JNIOR’s IP)/Grapher into the URL and it will take you to the application. There you can create the graph to monitor your Temperature. 

Once on the Grapher application page, you’ll want to enter settings to create a graph. To start, you can go down to the Graphs section and add a graph.

Here at the top you can create the chart name, and then set the range of the chart and also the time range being charted. Below that you can create the lines that go into the graph that are tracked. You can add their names, what the units they are measured in are called, and the color of the line. After that you can add a file that will be monitored to create the graph.

Here you can define the directory path of the file you want monitored. The columns are the lines that you defined in the Graphs section. The Date format can be set to MM-DD-YY HH:mm:ss.SSS. The file count is specified to how many files you have added. Once this is all set you’ll now want to open the snap application by typing in the URL (JNIOR’s IP)/snap. This is to pull information for the graph you want to crate.

Like in the picture above, you’ll want to pull a block function into the block area, and name it. The one in the example is called temp_logs. Then the filename is defined as the one you named in the file section in Grapher. (The date.format part of the file name auto inputs the date when creating the file). The Text is defined as separate values that will act as the lines we created in the graph section of Grapher. So you will only have text values equal to the amount of different lines in the graph your creating.

The values need to be labeled as this in order from top to bottom from Grapher, {{env_[1].fahrenheit}}, {{env_[1].humidity}}. These text values represent one module getting humidity and Fahrenheit. How the text values work is, the double squiggly brackets and comma between each value are needed to separate each value. The env_ is what you have to preface each value with in the text. The “.fahrenheit” has to be replaced with “.celcius”, “.humidity”, or each words first letter like “.f”, “.c”, or “.h” depending on what type of value you are trying to monitor. The number surrounded by brackets represents which module is getting that value so if you only have on module you’d label every bracket with a 1.

As for commands, you can use the extern command to tell you what modules you have connected, and the extern -r command to remove a module on your device to switch to another.

After you define those text values, you’ll want to pull a loop block into the block area. You’ll change the name to the name of the function we just created, and then you can set every time it adds information to the chart. Then you’ll go back to the functions tab and add the function we created into the loop block. Once that is done you should be able to go back to the main Grapher page and see your graph updating with information. Keep in mind that if you ever want more then one graph to be able to display, when creating multiple files in the Grapher configuration page, make sure you also create the blocks for them in snap.

By | On December 23, 2019 4:36 pm | No Comments | Categorized in: , ,