Mini Weather Sensor(KBQ-Weather Sonic X-70)
KBQ-WSX ultrasonic anemometer has advantage of light weigh, robust,no moving parts, free of maintenance and calibration on site, simultaneously output wind speed and direction. KBQ-WSX can be connected to computer or any other data acquisition module which has compatible communication protocol with it. KBQ-WSX has two communication interfaces for option, RS232 or RS485
Technical Specifications
Model |
KBQ-WSX |
Signal Output |
RS232/RS485 |
Power Supply |
DC:7-24V |
Data Output |
1 per second |
Power Consumption |
120mA@12V |
Material of Body |
ASA |
Communication Protocol |
Modbus/NMEA-0183 |
Dimension |
Ø144 * 248 mm |
Operating Temperature |
-40℃ - +70℃ |
Operating Humidity |
0 - 100% |
|
Principle |
Range |
Accuracy |
Resolution |
Wind Speed |
Ultrasonic |
0-70m/s |
±2% |
0.01m/s |
Wind Direction |
Ultrasonic |
0-359 |
<3 degree |
1 degree |
Air Temperature |
MEMS sensor |
-40℃ - +80℃ |
±0.5℃ |
0.1℃ |
Air Humidity |
MEMS sensor |
-40 -+80 |
±0.5 |
0.1 |
Precipitation (Type : Rain/Hail/Snow ; Intensity : Rain) |
Radar |
0-100mm/hr |
±10% |
0.01mm |
Solar Radiation |
Silicon |
0-2000 W/m2 |
±5% |
1 W/m2 |
Apperance Sketch
There has two north arrow markers on ASA shell for easy observation from downward, front upward. ”N” on the top should be pointed toward to north, it’s also zero direction for the anemometer.
WIRING
For RS485 output, communication cable is four cores, connected as below:
Power |
RS485 |
Red |
Black |
Yellow |
Green |
V+ |
GND |
RS485 DA+ |
RS485 DB- |
Procedure of confirmation of communication and wiring
3 seconds after wiring of our Device and correctly configuring serial communication tool, our instrument will output characters “>System Startup” in ASCII(0A 3E 53 79 73 74 65 6D 20 53 74 61 72 74 75 70 0D 0A in HEX), which indicate that our instrument is powered up. We can simply test its response by inputting “enter setting mode” command “3E 2A 0D 0A”. Our instrument will immediately respond “>CONFIGURE MODE” in ASCII(3E 43 4F 4E 46 49 47 55 52 45 20 4D 4F 44 45 0D 0A in HEX). So far , the communication test is finished, device is proven to be communicated successfully .
Installation Guidelines
The KBQ-WSX has been designed to meet and exceed the stringent standards listed in its specification. Operating in diverse environments all over the world, KBQ-WSX requires no calibration and adjustment whatsoever .
As with any sophisticated electronics, good engineering practice should be followed to ensure correct operation. Always check the installation to ensure the KBQ-WSX is not af fected by other equipment operating locally , which may not conform to current standards, e.g. radio/radar transmitters, boat engines, generators etc.
A void mounting in the plane of any radar scanner – a vertical separation of at least 2m should be achieved
·Radio transmitting antennas, the following minimum separations (all round) are suggested VHF
IMM – 1m
MF/HF – 5m
Satcom – 5m (avoid likely lines of sight)
- Use cables recommended by us. If cables are cut and re-connected incorrectly (perhaps in a junction box) then EMC performance may be compromised if cable screen integrity is not maintained.
- Earth loops should not be created – wire the system in accordance with the installation guidelines.
- Ensure the power supply operates to the KBQ-WSX specification at all times.
- Avoid turbulence caused by surrounding structures that will affect the accuracy of the KBQ-WSX such as trees, masts and buildings. Ideally sensors should be mounted on the prevailing wind side of the site
The WMO make the following recommendations: The standard exposure of wind instruments over level open terrain is 2m above the ground. Open terrain is defined as an area where the distance between the sensor and any obstruction is at least 10 times the height of the obstruction. If the sensor is to be mounted on a mast boom, part way up a tower or mast , then the boom should be at least twice as long as the minimum diameter or diagonal of the tower . The boom should be positioned on the prevailing wind side of the tower
Communication Protocol
ModBus-RTU
Modbus specification
Start Bit |
1 Bit |
Data Bit |
8 Bit |
Parity Bit |
NONE |
Stop Bit |
1 Bit |
Baud Rate |
9600 Baud |
Communication interface
Communication interface:RS485 or RS232, default interface: RS485°
Communication protocol
MODBUS Protocol - RTU Mode
Protocol description
MODBUS protocol defines a simple protocol data unit(PDU) independent from basic communication layer
MODBUS has two transmission mode: RTU and ASCII. Our sensor adopts RTU mode.
RTU transmission Mode
When controllers are setup to communicate on a Modbus network using RTU (Remote Terminal Unit) mode, each eight-bit byte in a message contains two four-bit hexadecimal characters. The main advantage of this mode is that its greater character density allows better data throughput than ASCII for the same baud rate. Each message must be transmitted in a continuous stream.
RTU mode serial bits
ModBus RTU message frame
CRC check
RTU Mode has Cyclical Redundancy Checking(CRC) on all content of message, no matter if there is an odd-even check or not. CRC check code is a 16 bits value composed by two 8 bits value and added as tail of message. After calculation, lower byte first then high byte. CRC higher byte is the last byte of message.
The CRC check code is calculated by sender . Receiver will recalculate CRC check code and compare it with CRC code received, if they are dif ferent, then there is an error happen during transmission.
ModBus Communication mode
Data Coding
MODBUS use ”big-Endian” to indicate address and data, which means when there is several bytes be sent out, the most significant bit is sent and received first
Register Size |
Value |
16 Bit |
0 * 1234 |
Protocol of Device
Function code supported
Function Code Type |
Length |
Function Code (HEX) |
Description |
Data Access |
16 Bit |
03 |
Read data from internal register |
Data Access |
16 Bit |
10 |
Write data from multiple register |
Error code supported
Error Code |
Description |
01 |
Function Code Error |
02 |
Register Address Error |
03 |
Register Value Error |
04 |
Device Busy |
Internal Register Description
Register |
Length |
Data Type |
Definition |
Range |
Register 1 |
16 Bit |
16 Bit int |
Device State |
0x0000 ~ 0xFFFF Refer to AppendixI |
Register 2 |
16 Bit |
16 Bit int |
Wind Direction |
0 - 359 |
Register 3 |
16 Bit |
32 Bit float |
Wind Speed |
0 - +70m/s |
Register 4 |
16 Bit |
Register 5 |
16 Bit |
32 Bit float |
Temperature |
-40 - +80°C |
Register 6 |
16 Bit |
Register 7 |
16 Bit |
32 Bit float |
Humidity |
0 - 100% |
Register 8 |
16 Bit |
Register 13 |
16 Bit |
32 Bit float |
Precipitation intensity |
Single - precision |
Register 14 |
16 Bit |
Register 15 |
16 Bit |
32 Bit float |
Accumulated precipitation |
Single - precision |
Register 16 |
16 Bit |
Register 34 |
16 Bit |
32 Bit float |
Solar Radiation Power |
W/m² |
Register 35 |
16 Bit |
Note: Starting address of registers is from zero, E.g. address of register 1 is 0x0000
32 bit float type formate
D3 |
D2 |
D1 |
D0 |
Higher byte |
Middle byte 1 |
Middle byte 2 |
Lower byte |
Format of data stored in register
Definition |
Register |
Bit |
Byte position |
Wind Speed |
Register 2-higher byte |
Register 2-lower byte |
Register 3-higher byte |
Register 3-lower byte |
8 bit |
8 bit |
8 bit |
8 bit |
D1 |
D0 |
D3 |
D2 |
Parameters Setting Commands
Following parameters can be set by users.
Commands |
Content |
Response |
Instruction1 |
ASCII |
>*\r\n |
>CONFIGUREMODE\r\n |
HEX |
3E 2A 0D 0A |
0A 3E 43 4F 4E 46 49 47 55 52 45 20 4D 4F 44 45 0D 0A |
Remark |
Enter Setting Mode |
Instruction2 |
ASCII |
>CUS96008-N-1 |
>CMD IS SET |
HEX |
3E 43 55 53 20 39 36 30 30 20 38 2D 4E 2D 31 0D 0A |
3E 43 4D 44 20 49 53 20 53 45 54 0D 0A |
Remark |
Configure serial port configuration as Baud Rate 9600bps ; Data bits : 8 bits ; Parity : NONE ; Stop bits : 1 bit |
Instruction3 |
ASCII |
>ID2\r\n |
>CMD IS SET |
HEX |
3E 49 44 20 32 0D 0A |
3E 43 4D 44 20 49 53 20 53 45 54 0D 0A |
Remark |
Configure address of device as 2. Inquiry address command is HEX : 3E 49 44 0D 0A |
Instruction4 |
ASCII |
>RESET\r\n |
System Start ok! \r\n |
HEX |
3E 52 45 53 45 54 0D 0A |
53 79 73 74 65 6D 20 73 74 61 72 74 20 6F 6B 21 0D 0A |
Remark |
Reboot device |
Instruction5 |
ASCII |
>!\r\n |
>NORMAL MODE \r\n |
HEX |
3E 21 0D 0A |
3E 4E 4F 52 4D 41 4C 20 4D 4F 44 45 0D 0A |
Remark |
Exit Setting Mode to Normal Mode |
Instruction6 |
ASCII |
>DEBUGEN\r\n |
Ustart In Debug Mode\r\n |
HEX |
3E 44 45 42 55 47 45 4E 0D 0A |
55 73 61 72 74 20 49 6E 20 44 65 62 75 67 20 4D 6F 64 65 0D 0A |
Remark |
Enter Secondary Setting Mode (only for WDS Series, WDS Series don't need to enter this mode) |
Setting Procedures
Function |
Instructions |
Set Communication Address |
SA / KBQ :1→3→16 KBQ :1→3→5→4 |
Set Serial Port Parameters |
SA / KBQ :1→2→16 KBQ :1→2→5→4 |
Set System Time |
SA / KBQ :7→16 KBQ :1→6→7→17→5→4 |
Set accumulated precipitation automatic clear period |
SA / KBQ :9→16 KBQ :1→6→9→17→5→4 |
Manually reset Accumulated precipitation(to zero) |
10 |
Change2 minutes calculate period |
SA / KBQ :1→11→16→4 KBQ :1→11→5→4 |
Change10 minutes calculate period |
SA / KBQ :1→12→16→4 KBQ :1→12→5→4 |
Change output wind speed unit |
SA / KBQ :1→13→16→4 KBQ :1→13→5→4 |
Change Gust calculate period |
SA / KBQ :1→14→16→4 SA / KBQ :1→14→16→4 |
Inquiry System time |
SA / KBQ :15 KBQ :1→6→15→17→5→4 |
NOTE
Above commands are applicable on our weather station. System time is a key parameter,since accumulated daily solar radiation will be reset to zero at 00:00 by internalsystem ofour device. Accumulated precipitation automatic clear period is counting down from the moment Device is poweredon, notfrom the momentyou changeaccumulated precipitation automatic Clear period (FunctionNo.4). Accumulated solar radiation is automatically reset as zero at 00:00 every day. Default precipitation automatic reset period is 3600 days. Once you enter secondarysetting mode, you have to exit it by inputting command 17 Or power off-on sensor,otherwise it will keep staying in setting mode where you can’t access to any data.
Appendix CRC Varification
The CRC we are using is 16 bits, lower byte comes first. The cyclic redundancy check (CRC) field is two bytes which contain 16 bits binary v a l u e . T h e value of the CRC appended to the message is calculated by the transmitting device. When receiving the message, the receiving device recalculates the CRC value and compares the calculated result with the actual received CRC value. If the two values are not equal, it is an error . During the generation of CRC, each 8-bits characters are XOR with the value in the register . The result then shifts 1 bit in the LSB direction, while the MSB position is charged to zero. Then extract and check LSB: if LSB is 1, the value in the register is XOR with a fixed preset value; if LSB is 0, no XOR operation is performed. This process will be repeated until 8 shifts have been performed. After the last (8th) shift and related operations, the next 8-bit byte is XOR with the current value of the register , and then repeat 8 times as described above. The final value in the register obtained after all sub sections of the message are calculated is CRC
Procedure of calculating a CRC:
- Load a 16 bit register with hexadecimal FFFF (all 1). Call it CRC register
- XOR the first byte of 8 bits in message with the low er byte of the 16 bit CRC register, and place the result in the CRC register
- Move the CRC register to the right by 1 bit (in the direction of LSB), fill the MSB with zero, extract and detect LSB
- If LSB is 0: repeat step 3 (do another shift) (if LSB is 1): conduct XOR operation with CRC register
- Repeat steps 3 and 4 until 8 shifts have been completed. When this is done, the full 8-bit byte operation will be completed.
- Repeat steps 2 to 5 for the next byte in the message, and continue the operation until all messages are processed.
- The final content in CRC register is CRC value
- When placing CRC value in message, as described below, higher and lower byte must be exchanged.
Appendix transform HEX to float data.
Use C language’s subfunction to transform 4 bytes(HEX) as float data( C language) union
{
float TestData_Float; unsigned char TestArray[4];
}TData;
Analysis example:
D3 |
D2 |
D1 |
D0 |
Higher byte of resgister 2 |
Lower byte of register 2 |
Higher byte of resgister 1 |
Lower byte of register 1 |
40 |
AC |
19 |
DF |
Higher byte |
Middle byte 1 |
Middle byte 2 |
Lower byte |
- After transformed to float data, value: 5.378
- Subfunction: float Tempfloat;
TData. TestArray [3]= 0x40; //input higher byte
TData.T estArray [2]= 0xac; //
TData.TestArray [1]= 0x19; //
TData.TestArray [0]= 0xdf; //input lower byte
Tempfloat = TData.T estData_Float;