How to Use the SensorTile with the Atmosphere IoT Studio
2020-01-22 | By Maker.io Staff
The SensorTile is a compact IoT development platform that is compatible with the Atmosphere IoT Studio and can be used in a wide range of applications.
In this how-to, we will learn how to use the SensorTile with the Atmosphere IoT Studioo and see a simple sensor example!
BOM
- ST SensorTile
- ST Nucleo
- Jumper wires
- USB mini B
- USB micro B
- Smartphone with Android or iOS and the Atmosphere IoT Studio App
Scheme-It
Some First Steps on Windows
In order to be able to use the SensorTile, there are a few prerequisites that need to be met. The SensorTile itself cannot be programmed directly by a computer and requires an ST-Link. The best method for doing this is to use the ST Nucleo board that includes an ST Link and header that can be connected to the SensorTile motherboard. The whole setup also requires the installation of two drivers:
Once these two have been downloaded and installed, it is time to check that the ST-Link is correctly recognized. Connect the ST-Link (via a USB B Mini cable) to your computer and check to see if the hardware is recognized. If there is no indication of hardware being recognized, navigate to Device Manager and check to see if you have the following device drivers:
Now that we have confirmed that the drivers are working, we can now connect the SensorTile to the motherboard and the motherboard to the Nucleo via the provided 5-pin header. The 5-pin header is connected between the SWD on the Nucleo and the SWD on the SensorTile motherboard. The Nucleo also requires the two jumpers found on the ST-LINK pin header to be removed so that the SensorTile can be programmed. The last step is to connect the SensorTile to the computer via a micro USB cable for power.
Getting Started with STMicroelectronics SensorTile
Getting Started with STM32 and Nucleo
At this stage, if everything works correctly you should see the following USB drive under “My Computer."
Creating a SensorTile Project
SensorTile projects are created in a similar way to other projects. On the Atmosphere IoT Studio, start by clicking New Project under the Projects tab, and then in the device list, select SensorTile. Give the project a name and then click the Create button.
Just like the Adafruit Huzzah32, we are presented with the same development environment including elements, application builder, and cloud development tools. For this simple example, we will drop an interval into the project as well as the LSM303AGR Interval element and then the Bluetooth Characteristic element. The interval will probe the LSM303 element once a second for the latest temperature reading and then the LSM303 element will send its read data to the Bluetooth element.
The application side of this SensorTile example is trivial and consists of an interval element, a Bluetooth element, and a label. Once a second, the interval element reads the latest data over Bluetooth and then this value is displayed on the label element. The value shown is the current temperature read from the SensorTile and shows how sensory data can be obtained from the SensorTile.
Programming the SensorTile
Now that we have our program ready to be flashed to the SensorTile we need to compile the project. Once compiled we click the download button as we would do on the Adafruit Huzzah32. However, you will notice that, despite Atmosphere IoT running, you will see a .bin file download instead of the usual programming window. This downloaded file is our project that we need to transfer to the SensorTile and this is a very trivial step to do.
All that is required is that the downloaded .bin file is copied and pasted to the flash drive that appears when the ST-Link board is connected to the computer. The image below shows the flash drive on my computer that I drag it to and its total size should be around 540KB. Those who have used the micro:bit will recognize this step as it is the same way that the micro:bit is programmed.
Once programmed, the SensorTile can be accessed via the Atmosphere IoT Studio Android app and once the device is added our app will launch and we can interact with the SensorTile. We’ll see the SensorTile used in more projects and how-to’s in the future!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum