The aim is to design and develop a smart module that can provide possibilities for usage in personal health and asset monitoring, wearables and smart homes
. The Smart modules will be developed with RSL10-SENSE-GEVK as the core component connected to a custom-made mobile application via BLE for external access, monitoring, and control.
The main intention of this project is to lay down the development of a baseline module that can be extended to the following without any big modifications.
- Smart monitoring and reporting of healthcare activities / Smart wearable
This deals with the monitoring and reporting of healthcare-related data to a central server (eg: Atmosphere IoT) so as to generate daily or periodic health care reports. The data includes data collected from the IMU (based on various activities carried out) and the environmental sensors (for checking various conditions of exposure). - Asset monitoring
This deals by interfacing the module with the assets for monitoring its movements based on the data obtained from the onboard inertial measurement systems.
The RSL10-SENSE-GEVK is a comprehensive, compact, node-to-cloud IoT sensor platform that allows the development of various Bluetooth Low Energy-based use cases. The board boasts a compact size and an ultra-low-power Bluetooth Low Energy SoC and features a wide range of onboard sensors, including sensors for ambient light, temperature, pressure, humidity, gas, inertia, and magnetism. Along with the hardware and software, the RSL10-SENSE-GEVK includes a mobile app to interact with sensors and actuators.
The board features ON Semiconductor’s RSL10, Industry’s lowest power Bluetooth® 5 Certified SoC and several sensors from ON Semiconductor and Bosch. By combining motion, environmental, ambient light sensing with the ultra-low-power of the RSL10, ON Semiconductor is enabling customers to realize a new class of battery-powered static, mobile and wearable smart sensors targeting consumer and industrial applications in the Internet of Things, including worker safety, asset tracking, and smart home sensing.
- RSL10 SIP: Industry’s lowest power RSL10 Radio SoC
- BME680: Integrated high-accuracy gas, pressure, humidity and temperature sensor, antenna and all passive components in a single, miniature package.
- N24RF64: Dual Interface RFID 64Kb EEPROM Tag, ISO 15693 Compliant with RF, I 2 C Bus and Energy Harvesting.
- BHI160: Integrated low power smart hub 3-axis accelerometer, 3-axis gyroscope.
- BMM150: Low Power, low noise 3-axis digital geomagnetic sensor.
- INMP522: ultra−low power microphone for audio applications.
- I2C: I2C is exposed via the SCL and SDA pins on the 5 pin header.
- Programming Method: Programming the RSL10-SENSE-GEVK involves using the programmer interface in Atmosphere Studio to install embedded firmware. However the RSL10-SENSE-GEVK doesn’t contain a built-in programmer, so it’s used alongside the SEGGER JLink tool to program it. SEGGER’s license doesn’t allow Atmosphere to redistribute the tool ourselves, so you must install the JLink Software and Documentation pack for your operating system before programming.
- Device Power: The RSL10-SENSE-GEVK can be powered either via coin cell battery or external 3.3V into the VCC pin on the 5 pin user header.
Now it's the time for the software hack!! It's not technically hacking, but rather an approach to make this kit behave as intended by forcefully putting instructions into its mind. Yes!! We are going to control its mind.
But to control, I need to know how the mind of the RSL10-SENSE module works.
Basically, this is what is inside the module:
It looks a little scary at first. But it's not that scary too.
Basically the module consists of an RSL10 SIP, integrated BLE, a BHI160 + BMM150 based Inertial measurement system, a BME680 environmental sensor, an INMP522 ultra-low-power microphone, and an integrated N24RF64 NFC module.
Yah!! So simple right? As I said, it's not at all scary.
So now that we know what's in his mind, we need to get inside. Ok, so what are the possibilities!!??
Let me find out...
Ok. There are 2 ways:
- Using the ON Semiconductor IDE which is based on the Eclipse Editor.
- Using the Atmosphere IoT Web interface.
Considering the pros and cons of both methods, I have finally decided to settle with the atmosphere IoT. The main reason being I am too lazy to code and the atmosphere IoT packs predefined elements that can be drag and dropped for making each and every feature of the module to work with the help of events and parameters. It also features cloud connectivity and even lets us compile our own mobile app to monitor and control the module.
Let us see how we can use the atmosphere IoT to program our RSL10-SENSE module.
This is the link that I had referenced, to begin with. It packs a lot of information regarding prerequisites and setting up the board to compile and run the mobile application.
I worked on an Ubuntu machine, so my steps would be based primarily on the same platform. I have also done similar steps (as far as my hobby time allowed) in a Windows 10 virtual machine.
Make sure we have the following pre-requisite software before proceeding:
1. SEGGER JLink Software - This is used as an interface to talk with the JLink debugger module.
2. Atmosphere IoT Agent - This allows the atmosphere web interface to talk with associated hardware for programming and debugging.
3. Atmosphere IoT app - From the respective stores, iPhone & android
Now once these are downloaded, install the SEGGER JLink Software. The Atmosphere IoT Agent is an app image, we just have to run this using Sudo privileges.
chmod u+x <app image>
Now add the current user to dialout group
sudo adduser $USER dialout
I would recommend logging in again for the changes to take the effect.
Now after re-logged in, start the atmosphere agent app. An atmosphere agent icon would appear at the top taskbar.
Now if we click on that icon and select status, we would get a webpage stating this:
This means that everything is up and running.
Now we move on to the next step. The programming.
Head to https://platform.atmosphereiot.com/
If you don't have an account already, now it's the time to make one.
Start a new project using RSL10-SENSE-GEVK as the device.
Give a cool name and let's start.
Now we are presented with a nice canvas and an element toolbox to the right.
Now as I told I am a bit lazy, I am gonna take the help from the atmosphere tutorial webpage to explain the upcoming steps.
The first aspect of building this sample project is adding elements to the Embedded tab to create the project’s embedded firmware. This involves setting an interval to read embedded data, and when to run to read the board’s BME680 element.
Add the following elements to the canvas by clicking them in the Element Toolbox:
- Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
- BME680 element: The BM3680 element reads the temperature, humidity, and pressure data. This is an environmental sensor that is onboard the RSL10-SENSE-GEVK, and its element is imported in the Element Toolbox for RSL-SENSE-GEVK projects by default.
- BLE characteristic element: This element creates a GATT characteristic to use in your project and is a coupled element that bridges the project between the Embedded tab and Application tab, meaning it’s included on both tabs.
The interval and BME680 element will work as intended by default, so none of their properties need to be changed. Connect the interval element to the BME680 element. This creates an event between them, which can be seen in either the interval element’s properties or by clicking the connector’s button. The event added is within the Interval
trigger, with the BME680 ability Read Temperature (°C)
. This means that when the interval element is triggered (which is every second), it will read the sensor’s temperature data. Add a BLE characteristic element to the canvas. In the BLE characteristic element’s properties, change the Read Data Type and Write Data Type fields to Floating Point (32-bit)
. This allows the elements to read and write floating-point values that will eventually be sent through them. You’re encouraged to give the elements custom names that represent what they do or what data they are passing through, such as naming it “Temperature". Connect the BME680 element to the BLE characteristic element, which ties the value of the sensor to the Application tab. This creates an event between the two elements in the Temperature Read
trigger, with the ability as Set Value
. This sets a value for the project’s interface after it reads the temperature sensor data. That’s all for work in the Embedded tab. To this point, an interval has been set that will run once per second after the project opens, and when run will read the temperature value from the onboard BME680 sensor.
Let's proceed to the Applications tab to create the project’s visual component. Here we’ll create a basic interface, pairing the sensor values sent from the Embedded tab with label elements to display their values on labels inside the mobile app. Click the Application tab to move to the application area of the project. Notice how the Element Toolbox has changed, and that the coupled BLE characteristic elements are displayed on the canvas. Click the top right button in the Application tab’s toolbar to display the app builder. This area creates a visual interface for your project. By default, this uses the smallest display size supported for an interface (320x560), but you can add an interface size by clicking the phone button. Use the display size that fits best with your mobile device.
Now, sad the following elements:
- Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
- Label element: The label element displays text on a project’s interface. Notice when the label is added to the canvas, a corresponding interface component is added to the app builder. The label component can be moved around on the interface wherever you like.
- Analog meter element: The analog meter element adds a meter to measure value to a project’s interface.
- Cloud element: The element enables a project’s data to be sent to the Atmosphere cloud.
Connect the interval element to the BLE characteristic elements. Within the interval element’s trigger properties, set each BLE characteristic’s event ability to Trigger
under the Interval
trigger, which will trigger the BLE characteristic elements every time the interval triggers. Connect the BLE characteristic element carrying the temperature data to the first label element. This creates an event between the two elements of Set Text
under the Read
trigger, which sets the text to the value of the label when the BLE characteristic is read. This correlates the set value from the BLE characteristic element in the Embedded tab to the label on the interface. Within the Set Text event, modify the Text field to "Temperature:" + readData.toFixed(2)
. This argument reads the temperature data and truncates the value to two decimal places. This is all that needs to be done for the project’s interface, simply using three labels to display text values. To this point, an interval has been set that will trigger the BLE characteristic elements once per second, which will display the read temperature values on the interface label. The cloud event element is a coupled element between the Application and Cloud tabs. Connect the BLE characteristic element carrying the temperature data to the cloud event element. This adds the Send Event
event to the BLE characteristic element’s Read
trigger, which sends the set value data to the Atmosphere when the BLE characteristic is read. Connect the BLE element to the Analog meter event and set the ranges and other characteristics if required.
These are the basic things that need to be done for the basic setup inside the Applications tab. but I have added a few more customizations such as adding background images and logos to give credits to certain entities.
Now let's move on to the Cloud tab.
Add the following elements:
- Cloud storage element: The cloud storage element is used to persistently store data on the Atmosphere. This is most commonly used alongside the cloud event element to store the embedded data sent to the Atmosphere from a device.
Connect the temperature data cloud event element to the cloud storage element. By default, this creates an event using the Add Data
ability within the cloud event’s Event Received
trigger. This allows theAtmosphere to add (and store) data sent to it from the connected cloud event element. Within the Add Data event, modify the Value field to {"Temperature": value}
, which will label the temperature dataset when displayed in the cloud.
That's all folks. We are done with the programming part !! As simple as that. No teeth crunching through hefty nifty codes. This is for lazy folks like me who want to get the best from minimum effort. As for the geeks, you can jump directly to the IDE and play or hack more. Thanks for your patience if you followed me so far.
Additional steps for asset monitoring:
For asset monitoring, we need to use more elements:
In the Embedded tab, add the following:
- BHI160 element: The BHI160 element is used to measure acceleration and angular velocity.
Add 4 BLE elements and connect each of them to the BH160 element to read each of the x, y, and z acceleration values with read and write parameters as floating-point type. Configure the fourth BLE element to read the full acceleration cluster values (x,y,z together) using a 3D float vector type for read and write.
In the Application tab, add the following:
- Progress bar element: The progress bar element adds a progress bar component to a project’s interface.
Replace the Analog meter with 3 progress meter elements and connect each of the BLE x,y,z elements to their respective progress bar elements. Give appropriate ranges for each of the progress bar element. Add a Cloud Event element and connect the fourth BLE element to it.
In the Cloud tab, connect the new cloud event element to the Cloud storage element to publish the acceleration 3D-vector values to the atmosphere cloud.
The programming for the asset monitoring application is complete. Compile the application and proceed to the next section.
Now that we have completed our program, we need to flash the same on to the device.
Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment. From any tab, click the hammer button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen indicating compiling has started, and will be notified when the project is compiled.
You will get a confirmation at the bottom after successful compilation.
With the project compiled, your RSL10-SENSE-GEVK can be programmed with the project’s embedded firmware. Programming the RSL10-SENSE-GEVK involves using the programmer interface in Atmosphere Studio to install embedded firmware. Prior to programming a device, ensure you have completely made sure the initially specified pre-requisites are done.
Let's program our board.
Connect the JLink debugger board to the PC via USB and the RSL10-SENSE-GEVK via the provided USB cable.
While the Embedded tab is active, click the flash firmware button from the tab’s toolbar. This displays the Program Firmware window. Click Program to start programming.
If you happen to get the following prompt, it is because the JLink debugger is not properly connected to the USB. Recheck the connection or try with a new USB cable.
Now some of you may get the following:
Another case is below:
Even though the prompt windows say 100% or complete, it actually hasn't. You can notice certain errors in the program output window. The reason for this prompt is because there is no connection to the RSL10 module which might have been put to deep sleep mode since it came with the default firmware or the coin cell battery might not have enough power to keep ìt working.
TIP: The board needs to be powered externally via a coin cell CR2032 battery or via external 3.3v supply. Richard LaBorde, who is an atmosphere IoT support member was of great help in assisting me to solve a lot of hurdles along the way. I wish to thank him for his support.
When complete, you’ll receive a notification stating the RSL10-SENSE-GEVK is programmed with the project’s embedded firmware.
With firmware installed, the device can now be recognized and connected to the Atmosphere network. From here, open the Atmosphere IoT app on your mobile device. We’ll use the mobile app to register the device, and eventually view the data on the project’s interface. To register the RSL10-SENSE-GEVK, navigate to the Devices area, and click the box button in the top-right of the screen to display the Add Device window. When the window opens it automatically starts scanning for available devices within range. Ensure your RSL10-SENSE-GEVK is within the range from the mobile device you are attempting to register from, otherwise, it may not appear. The list of available devices appears. Select your RSL10-SENSE-GEVK you just programmed and it will connect to the Atmosphere.
The device is now registered to the Atmosphere and added in the Devices area. The app interface we created will be displayed on the screen, with device data immediately shown on it. Since the interval in the project was set to run once per second, the readings should update every second.
Now that the device’s data is sent to the Atmosphere, let’s view it through one of the many device dashboard widgets available. We will use a data glance widget and a data graph widget to monitor the temperature data. We’ll do this directly on the device’s console page, so click on the newly-added RSL10-SENSE-GEVK to enter its console. To add a widget to the device’s dashboard, click the cogwheel button on the right side of the screen. This displays the menu of available widgets. Select the eye data glance widget to add a data glance to the dashboard. Once on the dashboard, click the widget’s 3 dot menu icon to display its menu, then click Settings. In the data glance’s settings, modify the following properties.
- Name: Give the widget a name, such as “Temperature Data.”
- Units: Enter
C
for its unit of measurement. - Icon: Select an icon that represents the data, such as the
Temperature
icon. - Color: Give the widget a color that represents the data.
In the Data Source field, click Select, then choose the following configuration options for the widget. Click the cloud storage and select the temperature dataset.
When finished click Save. The data glance is then populated with the temperature value, which updates every second. Now add a data graph widget to add a graph to the dashboard, then go to its settings.
Give the data graph a name (such as “Temperature Data”), then in its Data Source field click Select and choose the following configuration options for the widget: Select the cloud storage that is storing the data. For X-axis Value: Select the timestamp to go along the graph’s x-axis. For Y-axis Value: Select the temperature dataset to go up the graph’s y-axis. When finished click Save. This populates the data graph plotting the temperature values as time progresses. If you’d like to adjust the graph’s timeline or its bounds, you can edit those properties from the data graph’s menu as well.
The same widgets can be viewed on the mobile app from the dashboard view.
Congratulations, we have finished our software part of Smart wearable.
Similarly, once you compile the project with modifications for the asset monitoring system, flash it to the device and use the app and dashboard to view the data being monitored.
The Smart module can be used in many use-cases as I have pointed out in the introduction. The module which we have developed is scalable and can accommodate any use-case scenario. Here I am showing two simple use-cases which are:
- Smart monitoring and reporting of healthcare activities / Smart wearable
For the making of smart wearable, the module should be worn on the body of the subject. The best practical way of approach is to wear on the hand.
I could salvage a band from my previous smartwatch to make a carrier for the module so that it can be worn easily on the subject's hand. Since I do not own a 3D printer nor have access to any, I could print any sample band cases. So as of now, the module is attached to the band using double-sided tape.
After it was attached to the band, it made a very good smart band.
What the smart wearable application does is that it will continuously monitor the body to measure the changes in temperature, pacing (using accelerometer), etc and would display it in real-time on the custom made application as well as the web dashboard.
- Asset Monitoring
The module can be attached to any assets that need to be monitored. A real-life example is to monitor fragile items such as glass items, cutlery, etc. The module could measure the vibrations that happen on the package on its journey from source to destination. Thus we can estimate the amount of damage that might have taken by the item even before opening the package.
Since the module is very lightweight (very few grams), it won't add up any extra weight to the package. The module can run on the coin cell battery power for almost a year. So it won't run out of charge during its transportation period.
The asset monitor continuously monitors the disturbances that occurred to the particular entity which it monitors. The real-time data is displayed on the custom made mobile application and also on the web dashboard. It can be further modified to notify the implementer upon detecting very serious disturbances.
However, I would suggest you use the normal non-debug version of the module for these as the debug versions have the protruding 10-pin debug header which might hinder its portability.
Referenceshttps://www.segger.com/downloads/jlink/
https://forum.atmosphereiot.com/
Comments