Seeedstudio - SenseCap-S2102
- Manufacturer: Seeedstudio
- Product: SenseCap S2102
The SenseCap S2102 is a LoRaWAN indoor/outdoor sensor to measure light intensity in lux.
Table of contents
- Specifications
- Documents/Links
- Ordering Info
- Button Actions, Modes and LED States
- Adding the Device to TTN
- Settings (mandatory!)
- Payload Decoder
Specifications
- indoor/outdoor device
- Price ca. CHF 75.- (09.08.2023)
- Sensors
- Light Intensity, 0 … 16’000 [lux], ± 5 %, Resolution 1 lux
- Power Supply: 1 Li-SOCl2, ER34615, 3.6V, 19’000 mAh
- Expected life time: depending on usage, 5 … 10 years
- LoRaWAN version: 1.0.3
- LoRaWAN device class: A
- Protection: IP66
- Operating Temperature: 0 … +50 °C ( Effective measurement range of CO2)
- Size: 184.2 × 63 × 63.7 mm
- Weight: 457 g
Documents/Links
- S210X Sensor User Guide from seeedstudio.com (2023-08-09)
- Battery Life Prediction Table (Excel document)
Ordering Info
- Part Number: 114992868 Model S2102
- Ordering Link
Button Actions, Modes and LED States
Action | Description | Green LED Status |
---|---|---|
First power up, press and hold for 3s | Power on and activate the Bluetooth | LED flashes at 1s frequency, waiting for Bluetooth connection. If Bluetooth not connected within 1 minute, the device will shut down again |
Press once | Reboot device and join LoRa network | 1. The LED will be on for 5 seconds for initialization 2. Waiting to join LoRa network: breathing light flashing 3. Join LoRa network success: LED flashes fast for 2s 4. LoRa network join failure: LED suddenly stop. |
Press and hold for 3s | Activate Bluetooth again | 1. Waiting for Bluetooth connection: LED flashes at 1s frequency 2. Enter configuration mode after Bluetooth connection is successful: LED flashes at 2s frequency If Bluetooth is not connected within 1 minute, the device will reboot and join Lora network. |
Press and hold for 9s | Power off | In the 3rd second LED will start flashing at 1s frequency, release the button when the light is steady on, the light will then turn off. |
Note
After power off, you need to reconfigure the frequency band. Power off is recommended when not deployed.
Adding the Device to TTN
- Configure the device via Bluetooth with the
SenseCAP Mate App
. See User Guide chapter 5.2 for details -> you don’t have to create an account, simply clickSkip
on top right - Copy the
JoinEUI
,App EUI
and theDevEUI
and send it from the smartphone via E-Mail to your computer. - Before a device can communicate via “The Things Network” we have to add it to an application.
- Create a new application
- Under
End devices
in the application click(+) Register end device
- Under
Input method
selectEnter end device specifics manually
- Under
Frequency plan
selectEurope 863-870 Mhz (SF9 for RX2 - recommended)
- Under
LoRaWAN version
select1.0.3
- Under
JoinEUI
enter theApp EUI
from the App and pressConfirm
- Enter as well the
DevEUI
and theAppKey
from the App - Set an end-device name
- Press
Register end device
- Add the payload formatter from below, either to the device itself or if all devices in the app are from the same type, to the application
- Switch on the device
- After Configuration, the device restarts automatically and tries to join the network
- Now the device should join the network and you can see the incoming telegrams in the
Live data
section
Settings (mandatory!)
- Configure the device via Bluetooth with the
SenseCAP Mate App
. See User Guide chapter 5.2 for details
- Connect to the device
- Choose configuration mode
Device Firmware Update
and Update the Firmware - Connect again after update and choose under configuration mode
Advanced Configuration
- Go to tab
Settings
- Under
Platform
chooseThe Things Network
(Attention, dont choose “SenceCAP for The Things Network”) - Under
Frequency Plan
chooseEU868
- Under
Upling Interval (min)
choose10
- Under
Activation Type
chooseOTAA
(Over the air activation) - Under
Packet Policy
choose2C+1N
(Over the air activation) - Press
Send
- After Configuration, the device restarts automatically and tries to join the network
Payload Decoder
function hexToDec(hex) {
return parseInt(hex, 16);
}
function isObjectEmpty(objectName) {
return Object.keys(objectName).length === 0;
}
function stringToHex(str) {
var result = '';
for (var i = 0; i < str.length; i++) {
result += str.charCodeAt(i).toString(16);
}
return result;
}
function bytes2HexString(arrBytes) {
var str = '';
for (var i = 0; i < arrBytes.length; i++) {
var tmp;
var num = arrBytes[i];
if (num < 0) {
tmp = (255 + num + 1).toString(16);
} else {
tmp = num.toString(16);
}
if (tmp.length === 1) {
tmp = '0' + tmp;
}
str += tmp;
}
return str;
}
function decodeUplink(input) {
try {
var bytes = input['bytes'];
let payload_raw = bytes2HexString(bytes).toUpperCase();
var decoded = {};
let payload = "";
// Brightness
if (payload_raw.includes("010310")) {
payload = payload_raw.split('010310')[1];
if (payload.length > 8) {
if (payload.includes('0700')) {
payload = payload.split('0700')[0];
}
}
payload = payload.substring(0, Math.min(payload.length, 8));
payload = payload.match(/[a-fA-F0-9]{2}/g).reverse().join('');
decoded.brightness_lux = Number(hexToDec(payload)) / 1000;
}
// Battery
if (payload_raw.includes("000700") && payload_raw.length > 18) {
payload = payload_raw.split('000700')[1];
payload = payload.substring(0, 4);
payload = payload.match(/[a-fA-F0-9]{2}/g).reverse().join('');
decoded.battery_perc = Number(hexToDec(payload));
}
return { data: decoded };
} catch (e) {
// Handle error appropriately if needed
return { data: null, error: e.message };
}
}