MeteoRain automatic wireless rain gauge open message format
MeteoRain automatic rain gauge (pluviometer) wireless message format and its Java-Script decoder code is available as open-source because our customers have a wide range of applications for rain accumulation data.
We will still keep offering our allMETEO web portal platform as the default data solution for the MeteoRain IoT and MeteoHelix IoT weather stations. Making the MeteoRain and MeteoHelix message formats open and public will enable 3rd parties to build their own software applications and mobile apps as they see fit.
MeteoRain rain gauges are available in variants which meet the World Meteorological Organization (WMO) measurement precision standards for climatology and meteorology and also in cost sensitive variants to meet the demands of agriculture and other industrial and hobby uses where robustness and ease of use are paramount. Opening up the communication protocol will enable farmers, agronomists, meteorologists, oceanographers and private organizations to bring real benefits to their customers.
Type=0, MeteoRain wireless automatic raingauge message format (6 byte for arbitrary transmit intervals) | ||||||||
---|---|---|---|---|---|---|---|---|
Bits | 8 bits | 5 bits | 12 bits | 8 bits | 1 bit | 1 bit | 12 bits | |
Physical property | Message Index | Battery | Clicks (revolving counter) | Minimum time between clicks | Is internal temp > 2 °C | Heater status | Rain Intensity Correction (revolving counter) | |
Units | V | Clicks: Unitless value. Before displaying, multiply by rain gauge resolution. | 182 ÷ Time in seconds | Boolean | Boolean | Clicks: Unitless value. Add to clicks before multiplying with rain gauge resolution. | ||
Resolution | 1 | 0.05 | 1 | 1 | 1 | 1 | 0.01 | |
Maximum value | 255 | 4.6 V | 4095 | 255 | 1 | 1 | 40.95 | |
Minimum value | 0 | 3 V | 0 | 0 | 0 | 0 | 0 |
Rain (revolving counter) value is a revolving counter which returns to zero after the maximum 4095 value (12bits^2 - 1) is reached and starts counting up again. For each 10 minute data transmit interval, the amount of rain is equal to the difference between two consecutive values of this register times the rain gauge resolution.
So if the previous value was 4093 and the current value is 3, then 7 clicks have been recorded as written out here: 4093, 4094, 4095, 0, 1, 2, 3.
Rain Intensity Correction may be added to this value if high-intensity rain rates over 200 mm/hr have occurred.
Minimum time between clicks is the minimum elapsed time between 2 successive rain gauge tipping bucket mechanism signals. It is used to determine the maximum instantaneous rain rate. It is transmitted as 182 / Time. (Rain rate in mm/hr = Rain gauge resolution / Minimum time between clicks * 3600 s)
Rain gauge internal temperature warning (Is internal temperature > 2 °C?) is used to warn of possible ground frost and its affect on rain gauge measurements (0 = internal rain gauge temperature is less than 2 °C, 1 = internal temperature is higher than 2 °C)
Heater status is used only in heated rain gauges and indicates when heater is running.
Rain Intensity correction is added to the amount of Rain Clicks of the above revolving counter. For each 10 minute data transmit interval, the rain intensity correction is equal to the difference between two consecutive values of this register times the rain gauge resolution. It is the amount of rain the rain gauge may have missed due to high rain intensities, usually above 100 mm/hr.
Applying the rain correction is as follows:
If the rain gauge resolution is 0.2 mm and if the difference in rain correction between two data transmissions is 0.67, then the rain correction in terms of millimeters of rain is 0.67 * 0.2mm = 0.134 mm of rain for that time interval.
Hence, 0.134 mm of extra rain needs to be added to the amount of rain in that 10-minute time interval. In essence, it is the amount of water as a fraction of the tipping bucket size that was missed.
MeteoRain® IoT Compact and MeteoRain® 200 Compact feature the lowest rain intensity error of any professional rain gauge on the market. Only weighing rain gauges for 10x the price are able to exceed the performance of the MeteoRain® self-balancing tipping bucket mechanism at high rain intensities. For rain intensities lower than 200 mm/hr a rain intensity correction is not required for MeteoRain® to meet the calibration standards.
How to change your rain gauge resolution on allMETEO?
QUESTION: How do I change the rain gauge resolution in the JavaScript decoder code when implementing it in my own web platform?
ANSWER: See FAQ article: Changing the rain gauge resolution: decoding the MeteoHelix® message format
Web based & Excel spreadsheet weather data message decoder/verifier
The Things Network Payload Decoder
MeteoHelix weather station payload message decoder JavaScript code can be pasted directly into your application on The Things Network LoRaWAN console.
Sigfox Network Payload Decoder
For Sigfox wireless network based MeteoHelix weather stations, this JavaScript code can be integrated into your application which receives the MeteoHelix message payload from the Sigfox Backend.
Open-Source Decoder JavaScript Code
Decoder for LoRaWAN and Sigfox MeteoRain automatic rain gauges:
var pos = 0; var bindata = ""; var ConvertBase = function (num) { return { from : function (baseFrom) { return { to : function (baseTo) { return parseInt(num, baseFrom).toString(baseTo); } }; } }; }; function pad(num) { var s = "0000000" + num; return s.slice(-8); } ConvertBase.dec2bin = function (num) { return pad(ConvertBase(num).from(10).to(2)); }; ConvertBase.bin2dec = function (num) { return ConvertBase(num).from(2).to(10); }; function data2bits(data) { var binary = ""; for(var i=0; i<data.length; i++) { binary += ConvertBase.dec2bin(data[i]); } return binary; } function bitShift(bits) { var num = ConvertBase.bin2dec(bindata.substr(pos, bits)); pos += bits; return Number(num); } function precisionRound(number, precision) { var factor = Math.pow(10, precision); return Math.round(number * factor) / factor; } function Decoder(bytes, port) { bindata = data2bits(bytes); if(bytes.length != 6) return {"status": "ERROR", "describtion": "6 bytes are required"}; Index = bitShift(8); Battery = precisionRound(bitShift(5)*0.05+3, 2); Rain = precisionRound(bitShift(12), 1); Rain_time = precisionRound(bitShift(8), 1); Frost_alert = 1 - precisionRound(bitShift(1)*1, 0); Heater_on = precisionRound(bitShift(1)*1, 0); RainIntensityCorrection = precisionRound(bitShift(12)*0.01,2) decoded = { "1_Index": Index, "2_Battery": Battery, "3_Rain": Rain, "4_Rain_time": Rain_time, "5_Frost_alert": Frost_alert, "6_Heater_on": Heater_on, "7_RainIntensityCorrection": RainIntensityCorrection, }; return decoded; }