Sigfox is a French company founded in 2009 that builds wireless networks to connect low-energy objects such as electricity meters, smart watches, and washing machines, which need to be continuously on and emitting small amounts of data.
Sigfox employs a proprietary technology that enables communication using the Industrial, Scientific and Medical ISM radio band which uses 868MHz in Europe and 902MHz in the US. It utilizes a wide-reaching signal that passes freely through solid objects, called "ultra narrowband" and requires little energy, being termed "Low-power Wide-area network (LPWAN)". The network is based on a one-hop star topology and requires a mobile operator to carry the generated traffic. The signal can also be used to easily cover large areas and to reach underground objects.
In this tutorial, we can make a simple and very efficient Meteo Station Sigfox based.
All the materials are
Arduino MKRFox 1200DHT-11There are the sensor shield or the simple sensor. You can also use the DHT-22 sensor. This sensor uses the same library of the DHT-11, but is more efficiency.
Also
Sigfox developer accountThingSpeak account
Step 1: Getting Start With Arduino MKRFox 1200The first step is the official page of Arduino MKRFox 1200:
https://www.arduino.cc/en/Guide.MKRFox1200
After this, you must register your Sigfox board. You can follow this steps:
SigFox First Configuration: https://www.arduino.cc/en/Tutorial/SigFoxFirstConf...
This procedure registers your board and connects the board to the internet network.
https://backend.sigfox.com/activate
If you don't follow this step you can't connect your board to the ThingSpeak dashboard or to the .
Step 2: A New Account on ThingSpeakNow you can open a new account on ThingSpeak. Go to ThingSpeak platform: https://thingspeak.com/users/sign_up
After this, you can create a new channel. Now your channel can receive the data from the Sigfox backend. For this reason, you must select the API key of your channel and add to the URL in the Sigfox Backend system. Go to API keys page and write your API keys on your Sigfox Backend page. See the next step.
Step 3: The Hardware and the CircuitIn this project, you can use the simple DHT-11 sensor or the DHT-11 board.
You can buy this sensor on Amazon. There are the sensor shield or the simple sensor. You can also use the DHT-22 sensor. This sensor uses the same library of the DHT-11, but is more efficiency.
If you use the simple sensor, you must connect one 10 kOhm resistor between the VCC and data pin. If you use the DHT-11 shield, you can connect the sensor directly to the Arduino board. The circuit is very simple. You must connect the 5v and GND to the DHT-11 and the data pin to the Arduino MKRfox 1200 number 1.
Now try to use the DHT library. Use DHT example code. Open the serial monitor and read the results. If all works, and you can read the "Temp" and "Humi" values, all is OK and you can go to the next step.
Step 4: Add the Command to the Sigfox Developer PortalCreate a new Callback command on SigFox backend portal. https://backend.sigfox.com
Click on Device type and after click on "Callbacks".
Select Type DATA and Uplink
Select Channel URL
Add this line to "Custom payload config":
status::uint:8 temp::int:16:little-endian t::int:16:little-endian h::int:16:little-endian
Select "Use HTTP method" GET
Add this line to your Callback. Modify the ############# with your Thingspeak api key.
https://api.thingspeak.com/update?api_key= ###############&field1={customData#temp}&field2={customData#t}&field3={customData#h}&field4={snr}
Step 5: All the Code and the SoftwareFirst of all, install the Sigfox library on your Arduino IDE. This is the Arduino libraries. You can see the official guide to add the Arduino libraries: https://www.arduino.cc/en/Guide/Libraries
Install the Arduino Low Power libraries, Sigfox and DHT.
#include <ArduinoLowPower.h>
#include <Sigfox.h>
#include <DHT.h>
In the callback data on the backend page, there are the names of the variables of your Arduino code. See inside the code.
t = dht.readTemperature();msg.t = convertoFloatToInt16(t, 60, -60);h = dht.readHumidity();msg.h = convertoFloatToUInt16(h, 110);[...]msg.moduleTemperature = convertoFloatToInt16(temperature, 60, -60);[...]SigFox.write((uint8_t*)&msg, 12);
The code catches the Temperature and Humidity data by the DHT-11 sensor, and convert the data to "int". After sending the data to the Thingspeak platform by using the SigFox.write command.
This is the link to the Arduino code: https://github.com/masteruan/SigFoxThingSpeak
Upload the code and try the project.
You can install this device by using a battery. I use this device in a boat that haven't wifi connection, because the data transmission travels on the Sigfox network.
Comments