Introduction: LTE CAT-M1 GSM IoT Sensors Network... T - 15 Minutes.
At April 08th 2018, R&D Software Solutions srl [itbrainpower.net] revealed to the public the announcement of the xyz-mIoT by itbrainpower.net shield - the first, and the most compact, IoT board that combines the versatility of ARM0 micro-controller (Microchip/Atmel ATSAMD21G in Arduino Zero compatible design), the comfortable use of the embedded sensors bundle with connectivity provided by LPWR LTE CAT M1 or NB-IoT long-range & low-power modems or legacy 3G / GSM modems.
The xyz-mIoT by itbrainpower.net shield may have up to 5 integrated sensors:
- THS (temperature and humidity sensors) - HDC2010,
- tVOC & eCO2 (air quality sensor - CO2 total volatile organic compounds- CO2 equivalent) - CCS811,
- HALL (magnetic sensor) - DRV5032 sau or IR (infrared sensor) KP-2012P3C ,
- secondary IR (infrared sensor) - KP-2012P3C ,
- TILT (movement vibration sensor) or REED (magnetic sensor) - SW200D.
Use of-the-self xyz-mIOT shield temperature and humidity sensors as CLOUD sensor data loggers using Arduino board programming support.... t minus 15 minutes.
Required time: 10-15 minutes.
The implementation time may vary depending on previous user experience. Arduino environment installing and manual Arduino class installing are not covered by this how to; try google it. Support libraries and the source code used in this how to are available for download, for registered users here.
Difficulty: beginner - intermediate.
- xyz-mIoT shield having integrated HDC2010 sensor, as following PN:
- XYZMIOT209#BG96-UFL-1100000 [equipped with LTE CAT M1 and GSM modem] or
- XYZMIOT209#M95FA-UFL-1100000 [equipped with GSM only modem]
- micro-size [4FF] LTE CATM1 or 2G SIM card [having data plan enabled]
- small LiPo battery
- GSM embedded antenna with uFL or, GSM antenna with SMA plus u.FL to SMA pigtail
Step 1: Hardware, Soldering
Enable 5V from USB to be as primary power supply for the board as described up here. Alternative: solder both connectors rows, place the board into one breadboard and connect between Vusb and Vraw using one male-male breadboard wire.
Solder the LiPo connector. Keep in mind the LiPO polarity!
DOUBLE CHECK YOUR SOLDERING!!!
Step 2: Hardware, Bring All Together
Insert the micro-SIM in his slot [the SIM must have the PIN check procedure removed].
Connect the the antenna, then connect the USB cable to xyz-mIoT USB port and to your computer.
Connect the LiPo battery.
Step 3: Software Download and Install, Preliminary Settings
a. Download and install "xyz-mIoT shields Arduino class", then download the last version of classes: "xyz-mIOT shield IoT Rest support" and "xyz-mIOT shield sensors support class" from here.
b. Install the classes. Expand the archives and install the classes - in a nutshell:
- copy the "xyz-mIoT shields Arduino class" files in Arduino local hardware folder (mine is: "C:\Users\dragos\Documents\Arduino\hardware"), then
- copy the the support classes folders into your Arduino local user folder [mine is: "C:\Users\dragos\Documents\Arduino\libraries"] and - restart Arduino environment. More detail about manual library installing, read about Arduino library manual installation.
c. Make a folder named "xyz_mIoT_v41_temp_humidity".
d. Grab the project Arduino code from here and save it as "xyz_mIoT_v41_temp_humidity.ino" in previous created folder.
e. Make some settings in some files contained inside "xyz-mIOT shield IoT Rest support" class:
- in "itbpGPRSIPdefinition.h" line 2 set the APN value, using the APN value of your GSM provider (Eg: NET for RO Orange)
- in "itbpGPRSIPdefinition.h" line 9 set the SERVER_ADDRESS address for CLOUD Robofun #define SERVER_ADDRESS "iot.robofun.ro" #define SERVER_PORT "80"
- in "itbpGSMdefinition.h" comment default option for "__itbpModem__" and chose (delete comment sign) option "#define __itbpModem__ xyzmIoT" (line 71)
- in "itbpGSMdefinition.h" chose the right modem for your xyz-mIoT flavour: for M95FA chose "#define xyzmIoTmodem TWOG" (line 73) or for BG96 chose "#define xyzmIoTmodem CATM1" (line 75)
Step 4: Robofun Cloud - Define New Sensors and Copy TOKEN Settings.
For this how to we used the Robofun cloud [simple REST implementation] https://iot.robofun.ro
- Create a new account.
- Add two new sensors (xyzmIOT_temperature and xyzmIOT_humidity).
- For each new created sensor scroll down the page until "TOKEN" chapter and retain the "Tocken" id value. Those values will be used, next, to set sensors id[token id] in the Arduino code.
For reference, see the above pictures.
Step 5: Arduino - Sensors Tocken Id, Compile and Upload the IOT Code
Open in Arduino[(arduino.cc v >= 1.8.5] the xyz_mIoT_v41_temp_humidity.ino project.
a. Set tempTocken and humiTocken values with the one retained in previous step [created in the CLOUD].
If you use xyz-mIoT shield equipped with BG96 module you can select network registration mode as "GSM mode" or as "LTE CATM1 mode" (mobile network used and SIM card must support LTE CATM1*) by calling client.setNetworkMode(GSMONLY), respectivelly client.setNetworkMode(CATM1ONLY) function, right after client.begin() in function setup().
* we use it for tests RO Orange LTE CATM1 enabled SIM.
b. Press twice (fast) the xyz-mIoT shield RESET button [the board will switch into programming mode].
In Arduino, select "itbrainpower.net xyz-mIoT" board and "itbrainpower.net xyz-mIoT" programming port.
c. Compile and upload the code.
The xyz-mIoT shield will start sampling temperature and humidity data (at 1min. rate) and to upload sampled values to the CLOUD.
In order to visualize the debug output use the Arduino Serial Monitor or other terminal by selecting the debug port with following settings: 115200bps, 8N, 1.
For reference, see the above pictures.
The temperature logged data can be visualized in Robofun cloud sensor page or, in public (shared) page as we specified in Step4.
TUTORIAL PROVIDED WITHOUT ANY WARRANTY!!! USE IT AT YOUR OWN RISK!!!!
Originally published by me on itbrainpower.net projects and how to section.