Pollutants.eu Monitor kvality ovzduší v České republice

No doubt Guys, here is the node assembled!

Datacake screen:

So far so good!

There are already implemented few new features:

1. Sleep current 0.9mA overall

2. Reset the device via sending downlink on Port2: FF FF FF FF FF FF

3. Set transmit period (in milliseconds) via downlink on Port2: 01 00 XX XX XX XX (XX XX XX XX - milliseconds coded in hex (big endian), ex. for 5 minutes = 300,000 ms = 00 04 93 E0)

4. Set measuring period (in minutes) via downlink as for now provided with LED_ON command in one 2-bytes downlink message on Port2: 01 XX - LED ON and measuring period = XX minutes, 00 XX - LED is OFF and measuring period = XX minutes This LED enchanced with FET transictor, so you may connect some load to be switched ON/OFF (see the schematic in PCB folder)

          ex downlink payload: 

function Encoder(measurements, port) {
return [measurements.LED_ON.value, measurements.MEASURE_PERIOD.value];
}

 

 

 

Hello Guys, pollutagNode2 almost here, and will be prototyped soon.

Advatages:

1. LaraWAN node based on STM32WLE MCU (LORA-E5), easy to integrate monitoring and control node (air quality monitoring, garden, intelligent home. etc.)

2. You may connect load remotely by downlinks - via AO3400A transistor (on board)

3. New Sensirion SEN54 sensor optimized

4. MPPT and Li-Ion battery charger for power from 5V++ cheap solar panels.

5. Sleep current below 1mA expected

6. 10+ years of autonomity with cheap 2W solar panel and standard 1850 Li-Ion battery

7. More than 2 weeks work autonomity from fully charged 3500mA  Li-Ion battery

8. Ideal for sensor.community integration over LoRaWAN IoT, like TTN and Helium, no internet connection from your side needed!

9. Full fledged with routed test points - easy to solder - easy to add functionality (inputs, outputs, interfaces etc.)

 

1. Our LoRaWAN payload settled by following fragment of code:

  AppData.Port = LORAWAN_USER_APP_PORT;
  AppData.Buffer[i++] = (PM1) >> 8;
  AppData.Buffer[i++] = (PM1)%256;
  AppData.Buffer[i++] = (PM2_5)>>8;
  AppData.Buffer[i++] = (PM2_5)%256;
  AppData.Buffer[i++] = (PM10)>>8;
  AppData.Buffer[i++] = (PM10)%256;
  int16_t tempVar;
  tempVar = ((int16_t)(temperatureTX*100.0)) + 10000;
  AppData.Buffer[i++] = tempVar/100;
  AppData.Buffer[i++] = tempVar%100;
  tempVar = ((int16_t)(humidity*100.0));
  AppData.Buffer[i++] = tempVar/100;
  AppData.Buffer[i++] = tempVar%100;
  AppData.Buffer[i++] = VOC/256;
  AppData.Buffer[i++] = VOC%256;
  AppData.Buffer[i++] = extBattery;
  AppData.Buffer[i++] = LEDON;

 here you may see, than first 2 bytes in payload occupied by PM1 data (ultradisperse particles), next 2 bytes: PM2.5, then next 2 bytes: PM10, next 2 bytes by temperature, next 2 bytes by humidity, next 2 bytes by VOC (volatile organic compounds index), next byte by battery charge and the last one is LED status on/off.

2. In helium console we need to create decoder function (menu Functions), example flow:

decoder function may look like:

 

 
function Decoder(bytes, port, uplink_info) {

var decoded = {};
    decoded.PM1 = ((bytes[0]*256 +  bytes[1])/10.0).toFixed(2);
    decoded.PM2_5 = ((bytes[2]*256 +  bytes[3])/10.0).toFixed(2);
    decoded.PM10 = ((bytes[4]*256 +  bytes[5])/10.0).toFixed(2);
    decoded.T = (-100.0 + bytes[6] +  bytes[7]/100.0).toFixed(2);
    decoded.RH = (bytes[8] +  bytes[9]/100).toFixed(2);
    decoded.VOC = ((bytes[10]*256 + bytes[11])/10.0).toFixed(2);
    decoded.Battery = (bytes[12]*(2.82/76)).toFixed(2);//52.08;//31.06;
    decoded.LEDON = bytes[13];
  return decoded;
}

 

3. After decoder next step to pass (see flow above)  webhook to devices.sensor.community with your node tag . Particulate matter (PM10 and PM2.5) and (temperature and humidity) separately.

These webhooks in helium console created like integrations:

 

HTTP webhooks integrations:

 1.a) set the header, for PM particles as following (this node001_PM webhook):

* sensor ID =

 

Sensor UID

below is printscreen from sensor.community:

 

1.b) set the Advanced - JSON Message Template on the same page as follow (TEMPLATE BODY) - will be available then you press "ADD INTEGRATION" on the bottom :

{
  "software_version": "1",
  "sensordatavalues": [
      {"value_type": "P1","value": "{{decoded.payload.PM10}}"},
      {"value_type": "P2","value": "{{decoded.payload.PM2_5}}"}
  ]
}
 

2.a) Next webhook dedicated to temperature and humidity (node001_TH webhook):

* sensor ID =

  Sensor UID

 

2.b) set the Advanced - JSON Message Template on the same page as follow (TEMPLATE BODY) - will be available then you press "ADD INTEGRATION" on the bottom:

 

{
  "software_version": "1",
  "sensordatavalues": [
      {"value_type":"temperature","value": "{{decoded.payload.T}}"},
      {"value_type":"humidity","value": "{{decoded.payload.RH}}"}
  ]
}
 

 

Už to tam je a funguje. (https://waqi.info/#/c/49.191/16.662/16.7z)

Integration of pollutag_node_001 into sensor.community successfully done via 2 webhooks and decoder script directly from Helium Console, I will update the post with decoder code, flow and webhooks

 

Sirencely yours, Alex

 

 

 

 

Update will be provided in next article

 

feed-image RSS