Seedstudio - SenseCap-S2102
- Manufacturer: Seedstudio
- 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
- Device specific Information
- Adding the Device to TTN
- Payload formatter
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 seedstudio.com (2023-08-09)
- Battery Life Prediction Table (Excel document)
Ordering Info
- Part Number: 114992868 Model S2102
- Ordering Link
Device specific Information
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 downagain |
Press once | Reboot device and join LoRa network | 1. The LEDw ill be onfor 5 seconds for initialization 2. Waiting to joinLoRa network: breathing light flashing 3. Join LoRa network success: LED flashes fast for 2s 4. LoRa network joinfailure: LEDsuddenlystop. |
Press and hold for 3s | Activate Bluetooth again | 1. Waiting for Bluetooth connection: LEDflashes at 1s frequency 2. Enter configurationmode 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 seconds will start flashing at 1s frequency, until the light is steady on, release the button, the light will go out. |
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 - 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
Overview
click(+) Register device
- Under
Input method
selectSelect the end device in the LoRaWAN Device Repository
- Enter the following device information
End device brand
selectSenseCAP
Model
selectSenseCAP S2102...
Hardware Ver.
select1.0
or whatever is possible or on the stickerFirmware
select1.0
or whatever is possible or on the stickerProfile (Region)
selectEU_863_870
- Under
Frequency plan
selectEurope 863-870 Mhz (SF9 for RX2 - recommended)
- Under
JoinEUI
enter theApp EUI
from the App - Enter as well the
DevEUI
and theAppKey
from the sticker - Set an end-device name
- Press
Register end device
- 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 - The payload formatter should already be preset. If not, you can copy/paste it from below
Payload formatter
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.brgt_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 };
}
}