S3A7 with Sensirion Grove Sensor – An Alternative Approach

LEVEL 2: INTERMEDIATE  |

This tutorial uses the Renesas S3A7 IoT Fast Prototyping Kit with the Renesas IoT Sandbox to build an application to detect temperature and humidity. This tutorial will show you how to build workflows starting from a S3A7 template project.

In this tutorial, you will:

  • Get temperature and humidity from Sensirion sensor and display the detected values on the board’s LCD.
  • Visualize recorded data in a Dashboard from Renesas IoT Sandbox,
  • Create a simple workflow to allow temperature measurements in various units such as celsius and fahrenheit; use an input widget to select the preferred units.
  • Update the sampling rate of temperature and humidity directly controlled by the user’s input (via input widget).
  • Set the temperature and humidity thresholds.
  • Receive push notifications on your phone and/or email once measured temperature and humidity values are out of threshold boundaries.

Here’s a diagram of 9 workflows we will create in this tutorial:

 

HERE’S WHAT YOU NEED TO GET STARTED:

  1. Renesas Synergy S3A7 IoT Fast Prototyping Kit
  2. Micro USB cable to power up the board (part of the S3A7 IoT Fast Prototyping Kit)
  3. Grove Temperature & Humidity Sensor module (SHT31)
  4. WiFi Internet Access
  5. srec image file (Download here)
  6. iOS or Android phone mobile app (Download here)

Estimated Time to Complete :

Prerequisites:

 

STEP 1: PROGRAM S3A7 BOARD WITH SENSIRION SENSOR IMAGE

Program the Sensirion Sensor image onto the S3A7 board by following the instructions in the “How to flash the S3A7 board” tutorial. Be sure to download the latest release .srec file that is specific to this kit. This can be found in the HERE’S WHAT YOU NEED TO GET STARTED section.

 

STEP 2: ACTIVATE NEW S3A7 TEMPLATE PROJECT IN RENESAS IOT SANDBOX

Click here to activate a new S3A7 template project.  Once activation is completed, you will receive an email with your account credentials needed to provision the kit and access the cloud portal.

This email will include your:

  • Renesas IoT Sandbox web login
  • API Key
  • Device username and password
  • Mobile application credentials

We will connect your board to this project in a later step.

 

STEP 3: CONNECT THE S3A7 KIT TO THE CLOUD

Note: The S3A7 kit only works with 2.4GHz WiFi.

To simplify this step, we will first attach the sensor and then provision the board. However, the reverse order of these steps is also possible and acceptable.

Attach sensor:

●      Connect Grove Temperature & Humidity Sensor module (SHT31) to J18 (Grove I2C) on the board.

 

Provision the Board for WiFi and Renesas IoT Sandbox API:

●      Power up the board by connecting the white microUSB cable found inside the white box into J1 on the board, and then either power with the external battery in this box or by connecting to the USB port to a laptop.  Touch the screen within 10 seconds of powering up the board to boot it up in provisioning mode and the board will become a WiFi Access Point.

●      When you see the screen below, connect to the board from a computer via the WiFi network printed at the top of the screen.  This is a Wifi Access Point served by the board and is a unique SSID.  Important: Lenovo and Dell laptops running Microsoft Windows consistently face trouble connecting with the Wireless Module. MacBook, on the other hand, shows no issues so far. If you’re not using MacBook, your best bet is to use your mobile phone. Note: Keep a copy of your activation email readily available.  Once connected to the board’s Wifi Access Point, you will not have internet access on your computer or mobile device.

●      Once connected, click on the link at the bottom of the activation email you received in Step 1. This autofills the following form with the configuration details specific to your project. Alternatively, you can open the provisioning page served by the board by going to  http://192.168.3.1 on your browser and manually entering the information yourself.

●      On the provisioning page, enter the WiFi information from your home or office network (the router which will be linked to the board). You will need to specify the router’s WiFi authentication mode.  If you’re not sure, most Wifi routers use WPA2, so try that first.  The other possible WiFi authentication modes are Open (non secure), WEP with 40 or 128 key, and WPA.   NOTE:  This is NOT the information from the board’s WiFi Access Point.

●      If you did not use the hyperlink in the email, manually enter the Renesas IoT Sandbox API credentials emailed to you when you activated the kit in Step 2.

●      After entering the information, click Connect.  This will automatically exit out of provision mode and you will see a “Provisioning complete” screen.

●      Log into your Renesas Sandbox Account with the information provided in one of the emails at https://app-renesas-na-sandbox.mediumone.com/login.

●      Next, power down the board by removing the micro USB cable.

 

STEP 4: SWITCH TO PROJECT ON RENESAS IOT SANDBOX

Login to Renesas IoT Sandbox with your web credentials. Select your newly created project in the top right drop down.

In order to switch between projects, click on “Your Project Name” in the top right.  Note, if you have other browser tabs open pointing to other projects, those sessions will be invalidated.

 

STEP 5: CONNECT TO MOBILE

You should already have the mobile app installed from going through the Smart Chef tutorial. If you uninstalled the app, you can find links to the mobile app on renesas-docs.mediumone.com/?mobile or search for “IoT Controller” on the Apple or Google app store.

Make sure you enable push notifications when asked. If you have the app installed previously and you disabled push notifications, you will need to enable them in your Settings. Go to your phone Settings, scroll down until you find the “IOT Control” app, select the app and select “Notifications”. From the notifications screen, make sure that the “Allow Notifications” switch is enabled.

      

              

Create a new profile in the app for this S3A7 Sensirion Sensors project and input the API Settings from the welcome email you received, just like you did for the Smart Chef tutorial.  You can use whatever profile name you like.  Be sure to use the Mobile App credentials provided in the activation email for this project.

Note: these instructions are for the iOS App but Android is similar.

Open the app, click + to add a new profile.

Then click on API Login and specify a profile name, API keys, User, Password.

Be sure to click on “Renesas” to select the right environment.  Click Done.  Click Save.

If you logged in successfully, you should see a similar landing page.

For now, you can close the app; you will come back to this app later once you’ve created the necessary tags and workflows to monitor temperature and humidity in Renesas IoT Sandbox.

 

STEP 6: OBSERVE DATA ON BOARD’S LCD

In this step, you will observe recorded temperature and humidity values measured by the Sensirion Sensor attached to the S3A7 IoT Fast Prototyping Kit’s on board display.

Looking at the board display, you should be able observe temperature and humidity as shown in the picture below.  The Sensirion Sensor is constantly gathering the data, therefore, the changes in re-measured data are instantaneous.  You should be able to observe a slight deviation in measured values on the board’s LCD.

As shown in Real Time Events Log, by default, the sensor collects the measured temperature and humidity every one second. In a later step, you will create a simple workflow to adjust this rate to any desired period.

Note: Since this project transmits one event per minute, you may run out of free Sandbox credits within 24 hours.  If that happens, credits will reset in the next 24 hr period.

 

Alternatively, you can see the temperature and humidity value in the Real Time Gauge or Single User Line Chart widgets.  To do so, click on Real Time Gauge widget, then select “device” for user, “raw:temperature” and “raw:humidity” in Tag Config.

Click Save.

 

Now you can view the board’s temperature and humidity values in your Real Time Gauge dashboard.

 

STEP 7: CONVERT CELSIUS TO FAHRENHEIT

In this step, you will create a simple workflow that allows you to vary the temperature unit between celsius and fahrenheit. Additionally, you will have to create a new tag and define an input widget to allow for the changes in the measurement unit.

To do so, you will utilize various features of Renesas IoT Sandbox.

  1. You will create a new raw tag “celsius” by utilizing the API explorer.
  2. You will enable the newly generated tag.
  3. You will create an input button to select the desired unit selection.
  4. You will create a simple workflow to allow for the unit conversion.

A.  In Renesas IoT Sandbox, go to Resources -> API Explorer.

 

 

Under Login to API, login with your credentials: username, username password, and API key.

Note: The credentials were set and emailed to you during Step 2 the activation of your kit.

 

Note: Response code: 200 (true) indicates that you can use this user account to login to MQTT API for the project. If you didn’t get a correct response code, re-verify your user credentials and try again.

Now, you will create a new, raw tag called celsius. Under Create Events, select:

stream_name:             raw

login_id:                       device

event_data:                 {“celsius”:true}

 

Click “Send”.   If you didn’t observe successful response ‘200’, please correct errors and try again.

 

For further details on how to generate events, please visit Medium One Documentation Resources.

You just created a new raw tag called “celsius”. Now, you will use this tag to create a conversion button.

 

B.  In Renesas IoT Sandbox, go to Config -> Data Streams; select raw Events by clicking Edit.

Activate the “celsius” tag, then save by clicking on “Save Data Stream”.

 

C.  In Renesas IoT Sandbox, go to Dashboard; then click on Single User User Input Widget; then select:

Select user:     device

Tag config:      raw:celsius

 

Now, you have created an input button that will enable the temperature unit conversions.

 

D.  Finally, you will create a workflow that allows for temperature unit conversion; specifically, celsius to fahrenheit, and fahrenheit to celsius.

Create a new workflow and name it  “Convert Celsius to Fahrenheit” by clicking on Workflow Studio and “Create”.

 

Drag the “celsius” tag from the raw stream into the workflow.

 

Double click on “celsius” tag and confirm that it’s Trigger is checked.

 

Similarly, drag a Base Python module and connect its “in1” input with the “celsius” tag.

 

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT

celcius = IONode.get_input('in1')['event_data']['value']
message = "C" + str(int(celcius))
MQTT.publish_event_to_client('s3a7', message)

 

Then click the “Save and Activate” button to finish setting up the workflow.

 

CHECKPOINT

On your board display, observe that by default, the temperature is measured in celsius.

In input widget, change the value of raw “celsius” tag from true to false (by simply clicking on it), and then Send Event. You will observe that the temperature on the board just switched to Fahrenheit, as shown in the picture below.

 

Similarly, if you want to switch back to celsius, simply change the raw “celsius” tag to reflect true and then send the event. You will see that the temperature is again measured in celsius.

 

STEP 8: UPDATE THE SAMPLING RATE

In this step, you will create a workflow that allows the user to input the sampling rate of temperature and humidity. By default, temperature and humidity in this tutorial is sampled every one second.

In order to change the sampling rate, you need to create a new raw “update_rate” tag, activate this tag, create a user input widget button for manually changing the rate, and then write a simple workflow to adjust the sampling rate. All of the mentioned steps have been described in Step 6 in great detail, thus some details are omitted in this description.

 

A. In Renesas IoT Sandbox, go to API Explorer and create a new raw tag “update_rate”.

stream_name:             raw

login_id:                       device

event_data:                 {“update_rate”:1}

Click “Send”.  If you didn’t observe successful response ‘200’, please correct errors and try again.

 

B, In Renesas IoT Sandbox, activate the new tag by going to Config -> Data Streams, select raw Events by clicking Edit.

Locate “update_rate” tag and activate it by checking the box.

Save the activated tag by clicking on “Save Data Stream”.

 

C.  In Renesas IoT Sandbox, go to Dashboard; then click on Single User User Input Widget; then select:

Select user:     device

Tag config:      raw:update_rate

 

Now, you have created an input button that allows you to change the sampling rate.

Note: the more frequent the rate, the more Sandbox credits are used. To ensure enough of the daily allowed free Sandbox credits, it is recommended to reduce the sampling rate to every 1 min or more.

 

D.  Finally, you will create a workflow that allows to change the sampling rate.

Create a new workflow and name it  “Update Rate” by clicking on Workflow Studio and “Create”.

Drag the “update_rate” tag from the raw stream into the workflow.

Double click on “update_rate” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input with the “update_rate” tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store

rate = IONode.get_input('in1')['event_data']['value']
if int(rate) > 0:
message = "R" + str(int(rate))
MQTT.publish_event_to_client('s3a7', message)
Store.set_data("update_rate", str(int(rate)), -1)

Then click the “Save and Activate” button to finish setting up the workflow.

 

CHECKPOINT

On your board display, observe that by default, the temperature is measured in celsius.

In the input widget, change the value of raw “update_rate” tag to “60”, and then “Send Event. You will observe that the sampling rate of temperature and humidity on the board was increased from every 1 second, to every 1 min.

To confirm the updated rate, look at Real Time Events log file and the events time stamps.

 

STEP 9: CREATE TEMPERATURE & HUMIDITY THRESHOLDS

In this step, you will create a workflow that allows the user to set threshold values for temperature and humidity. As in previous steps, you need to create new raw “temp_threshold” and “humidity_threshold” tags, activate these tags, create a user input widget button for the user’s selection of threshold values, and then create a simple workflow that compares the current temperature and humidity with their threshold values.

All of the mentioned steps have been described in Step 6 in great detail, thus some details are omitted in this description. Similarly as in step 6, this section marks steps A – D to allow for better order of required steps.

 

A, In Renesas IoT Sandbox, go to API Explorer and create new raw tags “temp_threshold” and “humidity_threshold”.

stream_name:             raw

login_id:                       device

event_data:                 {“temp_threshold”:1, “humidity_threshold”:1}

Click “Send”.  If you didn’t observe successful response ‘200’, please correct errors and try again.

 

B, In Renesas IoT Sandbox, activate the new tag by going to Config -> Data Streams, select raw Events by clicking Edit.

 

Locate “temp_threshold” and “humidity_threshold” tags and activate them by clicking

Save the activated tags by clicking on “Save Data Stream”.

 

C.  In Renesas IoT Sandbox, go to Dashboard; then click on Single User User Input Widget; then select:

Select user:     device

Tag config:      raw:temp_threshold, raw: humidity_threshold

Your User Input widget should look similar to this:

 

D.  Now, you will create two workflows; the first workflow will process getting temperature threshold from dashboard widget and send message to the board; the second workflow will process getting humidity threshold from dashboard widget and send message to the board.

Create the first workflow and name it  “Set Temperature Threshold” by clicking on Workflow Studio and “Create”.

Drag the “temp_threshold” tag from the raw stream into the workflow.

Double click on “temp_threshold” tag and confirm that it’s Trigger is Checked.

Similarly, drag a Base Python module and connect its “in1” input with the “temp_threshold” tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store

temp_threshold = IONode.get_input('in1')['event_data']['value']
message = "T" + str(int(temp_threshold))
MQTT.publish_event_to_client('s3a7', message)
Store.set_data("temperature_threshold",str(int(temp_threshold)) , -1)

Then click the “Save and Activate” button to finish setting up the workflow.

Create the second workflow and name it  “Set Humidity Threshold” by clicking on Workflow Studio and “Create”.

Drag the “humidity_threshold” tag from the raw stream into the workflow.

Double click on “humidity_threshold” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input with the celsius tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
 import Store

humid_threshold = IONode.get_input('in1')['event_data']['value']
 message = "H" + str(int(humid_threshold))
 MQTT.publish_event_to_client('s3a7', message)
 Store.set_data("humidity_threshold", str(int(humid_threshold)), -1)

Then click the “Save and Activate” button to finish setting up the workflow.

 

CHECKPOINT

This was a preparation step for the upcoming section.  However, you can do a quick check to ensure that the buttons were created. Set the temp_threshold and humidity_threshold to a non-zero value and view the JSON log in Real Time Events Log.

In section 10, you will add a synchronization data workflow as well as notification workflow, which will report on temperature and humidity out of specified boundaries.

 

STEP 10: UPDATE USER EMAIL AND PHONE

In this step, you will create two workflows that process getting user email from Dashboard widget and then store the user’s email to the cloud. Similarly, second workflow will process getting user phone number from Dashboard widget and then store the user’s phone number to the cloud.

Similarly as in step 6, this section marks steps A – D to allow for better order of required steps.

 

A, In Renesas IoT Sandbox, go to API Explorer and create a new raw tag “user_email” and “user_phone”.

stream_name:              raw

login_id:                       device

event_data:                 {“user_email”:””, “user_phone”:””}

Click “Send”. If you didn’t observe successful response ‘200’, please correct errors and try again.

 

B.  In Renesas IoT Sandbox, activate the new tag by going to Config -> Data Streams, select raw Events by clicking Edit.

Locate “user_email” and “user_phone” tags and activate them by checking the box.

Save the activated tags by clicking on “Save Data Stream”.

 

C.  In Renesas IoT Sandbox, go to Dashboard; then click on Single User User Input Widget; then select:

Select user:     device

Tag config:      raw:user_email, raw: user_email

Your User Input widget should look similar to this:

The user email as well as user phone number will be used to notify an alert when the temperature or humidity value exceeds its threshold. User email will be stored on the cloud for further usage; once the user sets up his/her email, the email is stored on the cloud until overwritten by a different email.

Note: Make sure your email and phone number is always up to date to receive the threshold notifications.

 

D.  Now, you will create two workflows. The first workflow will process getting the user email from the dashboard widget and store the information in the cloud. The second workflow will process getting the user phone number from the dashboard widget and store it in the cloud.

Create the first workflow and name it  “Update User Email” by clicking on Workflow Studio and “Create”.

Drag the “user_email” tag from the raw stream into the workflow.

Double click on “user_email” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input with the “user_email” tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store

user_email = IONode.get_input('in1')['event_data']['value']
Store.set_data("user_email", user_email, -1)

Then click the “Save and Activate” button to finish setting up the workflow.

Create the second workflow and name it  “Update User Phone” by clicking on Workflow Studio and “Create”.

Drag the “user_phone” tag from the raw stream into the workflow.

Double click on “user_phone” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input to the celsius tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store

user_phone = IONode.get_input('in1')['event_data']['value']
Store.set_data("phone", user_phone, -1)

Then click the “Save and Activate” button to finish setting up the workflow.

 

STEP 11: SYNCHRONIZE DATA AND SEND NOTIFICATIONS TO USER’S EMAIL AND PHONE

In this step, you will create two final workflows.

The first workflow will synchronize data between application and the cloud. The last values of temperature threshold and humidity thresholds stored on the cloud will be sent to your board when starting the application. In this tutorial, it will be triggered on initial connection to the board.

The second workflow will send a notification to the user defined email and phone number once temperature and humidity have exceeded its threshold.

Similarly as in step 6, this section marks steps A – D to allow for better order of required steps.  Note: In this step, you will omit creation of input widgets (step C) as all necessary widgets have already been created in earlier sections.

 

A.  In Renesas IoT Sandbox, go to API Explorer and create a new raw tag “notification”.

stream_name:              raw

login_id:                       device

event_data:                 {“notification”:1}

Click “Send”. If you didn’t observe successful response ‘200’, please correct errors and try again.

 

B, In Renesas IoT Sandbox, activate the new tag by going to Config -> Data Streams, select raw Events by clicking Edit.

Locate “notification” and “connected” tags and if not activated, activate them by checking the box.

Save the activated tags by clicking on “Send Data Stream”.

 

D. Now, you will create two workflows for synchronizing data and sending notifications.

Create the first workflow and name it  “Sync Data” by clicking on Workflow Studio and “Create”.

Drag the “connected” tag from the raw stream into the workflow.

Double click on “connected” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input to the “connected” tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store

humid_threshold = Store.get("humidity_threshold")
message = "H" + str(int(humid_threshold))
MQTT.publish_event_to_client('s3a7', message)

temp_threshold = Store.get("temperature_threshold")
message = "T" + str(int(temp_threshold))
MQTT.publish_event_to_client('s3a7', message)

Then click the “Save and Activate” button to finish setting up the workflow.

 

Create the second workflow and name it  “Send Notification” by clicking on Workflow Studio and “Create”.

Drag the “notification” tag from the raw stream into the workflow.

Double click on “notification” tag and confirm that it’s Trigger is checked.

Similarly, drag a Base Python module and connect its “in1” input with the “notification” tag.

Your overall workflow should look as following:

Double click on Base Python, then delete and replace the Base Python script with the following code:

import MQTT
import Store
from datetime import datetime
import Email
import FreeSMS
import Analytics

# Get input value
notify = IONode.get_input('in1')['event_data']['value']
log(notify)

# Get previously saved input value (or None if not available)
previous_input = Store.get_global("notification")

# Save current input, to be used as previous input next time the workflow is ran
# The value must be a string so we cast it to a string with str()
Store.set_global_data("notification", str(notify))

# Check if the inputs are the same
# since the store takes string, let's make sure we compare strings

if str(notify) != str(previous_input):
   log(notify)

   # Get user email
   user_email = Store.get("user_email")
   log(user_email)

   # Get user phone
   user_phone = Store.get("phone")
   log(user_phone)

   temperature = Analytics.last_n_values('raw.temperature', 1)[0]['raw.temperature']
   log(temperature)

   temp_threshold = Store.get("temperature_threshold")
   log(temp_threshold)

   humidity = Analytics.last_n_values('raw.humidity', 1)[0]['raw.humidity']
   log(humidity)
   humid_threshold = Store.get("humidity_threshold")
   log(humid_threshold)

   if (int(notify) == 1):
       message = "Alert! Temperature {0} (Celcius) exceeded temperature threshold {1} (Celcius) at {2} (server time)\n".format(temperature, temp_threshold, datetime.now().strftime("%A, %d %b %Y, %I:%M%p"))
       message_sms = "Temperature {0}(C) exceeded threshold \n".format(temperature)

   elif (int(notify) == 2):
       message = "Alert! Humidity {0} (%RH) exceeded humidity threshold {1} (%RH) at {2} (server time) \n".format(humidity, humid_threshold, datetime.now().strftime("%A, %d %b %Y, %I:%M%p"))
       message_sms = "Humidity {0}(%RH)exceeded threshold \n".format(humidity)

   elif (int(notify)== 3):
       message1 = "Alert! Temperature and Humidity exceeded threshold at {0} (server time).\n".format(datetime.now().strftime("%A, %d %b %Y, %I:%M%p"))
       message2 = "Temperature {0} (Celcius) exceeded temperature threshold {1} (Celcius) \n".format(temperature, temp_threshold)
       message3 = "Humidity {0} (%RH) exceeded humidity threshold {1} (%RH) \n".format(humidity, humid_threshold)
       message = message1 + message2 + message3
       message_sms = "Temperature & humidity exceeded threshold"

   elif (int(notify) == 0):
       message = "Temperature and Humidity returned to normal condition at {0} (server time)".format(datetime.now().strftime("%A, %d %b %Y, %I:%M%p"))
       message_sms = "Temperature & humidity returned to normal condition"

   log(message)
   log(message_sms)

   # Send email
   try:
      email = Email.Email("support@medium.one", 'Renesas IoT Sandbox', user_email, 'S3 Sensirion Notifications')
      email.html_message(message)
      email.send()
   except Exception:
      log("Unable to send Email")

   # Send SMS
   try:
      if user_phone != "":
          FreeSMS.sendSMS(str(user_phone), message_sms)
   except Exception:
      log("Unable to send SMS")

 

Then click the “Save and Activate” button to finish setting up the workflow.

You created a workflow that synchronizes the data between the board and cloud every time the board is connected.

You also created a workflow that sends email and SMS notifications if the user-defined thresholds of temperature and humidity are exceeded. Now it’s time to test these final workflows.

 

CHECKPOINT

Now, you can finally connect all of the above steps and create the test described in following steps:

  1. Keep your temperature at Celsius.
  2. Set the update_rate to 60; thus, the events to update temperature and humidity are sent every 60 seconds.
  3. Set the temperature_threshold to 25 Celsius, and humidity_threshold to 60 %RH.
  4. Add your email and phone number, so you are able to receive notifications.
  5. Breathe on the Grove Sensirion sensor to temporarily increase temperature and humidity.
  6. Observe the increased temperature and humidity on the board’s LCD or in the Last Value Table.
  7. If the temperature or humidity exceeded the temp & humidity thresholds, you will immediately receive an email and SMS notification with any combination of the following messages:
    • Temperature & humidity exceeded threshold.
    • Humidity <value> (%RH) exceeded threshold.
    • Temperature <value> (C) exceeded threshold.
  8. If you have not done so yet, stop breathing on the Grove Sensirion sensor and let the temperature and humidity values adjust to the normal environment values. Once done, you will receive another notification:
    • Temperature & humidity returned to normal conditions

The following is a quick visual representation of the above test’s steps. For clarity, we show the current tag values (before test) by using Last Value Table widget as shown below.

As shown in the below table, the current temperature value of 23.18 C is lower than the temp_threshold value of 25 C; similarly, the current humidity value of 55.5 %RH is lower that the set humidity_threshold value of 60 %RH.

After you breathe on the Grove sensor, the temperature and humidity temporarily spike and we recorded the following values. The temperature temporarily increased to 26.7 C, thus exceeding the desired 25 C temperature threshold. Similarly, the humidity spiked to 89.88 %RH, thus exceeding the desired humidity threshold of 60 %RH.

The following examples show the SMS notifications received as soon as the temperature and/or humidity exceeded its defined thresholds.

Once the temperature and humidity returns to its original value, final SMS notification is sent with the following message:

If you set your email account, you should receive email notifications similar to these:

 

STEP 12: VIEWING SENSOR DATA IN MOBILE APPLICATION

Finally, you are ready to visualize the Dashboard data through the mobile application. Login to the account as shown below.

 

Click on “+Add New Widget”;

Here you can select which widget you want to display. In this tutorial, we will use Gauge and Slider widgets.

Select Gauge widget.

In the Gauge widget setting, you will specify “temperature” tag; set Stream to “raw” and Tag to “ temperature”. Then click Done.

Note: use the same steps to create a new gauge for humidity.

 

Similarly, you can use a Slider widget to update the sampling rate of measured temperature and humidity.

Click on “+Add New Widget”; then select Slider widget.

 

In the Slider widget setting, you will specify “update_rate” tag; set Stream to “raw” and Tag to “ update_rate”. Then click Done.

Note: Similarly, you can set the “temp_threshold” and “humidity_threshold” tags.

 

Now you are able to monitor temperature, humidity, their sampling rate, and other tags through your mobile applications. Feel free to add more tags to your mobile application.

Note: Don’t forget to Save your current layout.

Congratulations! This concludes the S3A7 Sensirion Sensor tutorial for Renesas Synergy S3A7 IoT Fast Prototyping Kit. You have used a Grove Sensirion sensor to measure the surrounding temperature and humidity and display the data in various units. You visualized received data in Renesas IoT Sandbox environment; you learned to set phone and email notifications, as well as, set threshold boundaries for measured data.

The rest is up to your imagination!

 

WHAT’S NEXT?

Try another S3A7 Renesas Synergy IoT Fast Prototyping Kit quick start guide:

  • S3A7 Activity Monitor (Level: intermediate)
  • S3A7 with Smart Garage Monitoring Demo (Level: Advanced)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

add link on where to buy the kit

can you copy from other blog?

update the link once known

add the estimated time