NiceRF | IOT-THS010 IOT temperature and humidity and switch acquisition node

The ultra-low power sensor acquisition star network system is mainly used for sensor data acquisition and control of the Internet of Things. The entire network system is composed of gateway IOT-G010 and node IOT-N010/ IOT-THS010, which adopts the networking mode of wireless star network. A good coordination mechanism and precise scheduling algorithm are used internally between the node and the gateway to avoid collisions between data packets in the air. The communication protocol between the node and the gateway has been implemented by the system, and customers can build a reliable sensor acquisition and control network as long as they follow a simple configuration. The node module IOT-THS010, as the node end of the network, uses a high-performance low-power MCU and a wireless communication module, integrated temperature sensor DS18B20 or temperature and humidity sensor SHT20 and Hall devices. Setting a proper collection interval can achieve a life span of several years. Especially suitable for battery-powered temperature and humidity acquisition and switch state detection systems.

Password ×
Features&Application

Features

 Node low power consumption

 Star network

 Multi-point data collection (up to 255 for a single gateway)

 Multi-point switch collection (up to 255 for a single gateway)

 Data anti-collision mechanism

 Serial port firmware upgrade 

 Dynamically modify the upload interval

 OTA parameter modification


Application

 Temperature and humidity collection                             

 Switch status detection

Specification

Electrical Specifications:

function description

Function

1 Node working mode

The node has two working states, namely: setting mode and working mode.

1.1 Set mode

The setting mode is used to modify various parameters of the node. There are two ways to enter the setting mode, namely local entry and remote entry.

a) Local access settings:

The local access setting method is to facilitate the setting of various parameters before product installation. Long press the SET_MODE pin for 3s to enter the setting mode. At this time, both the transceiver indicators output low level (the two LEDs remain on for a long time) to indicate the current setting mode. If you keep pressing the SET_MODE pin for a long time, the module will restore the factory settings after 15s.

b) Local exit settings:

In the setting mode, press and hold the SET_MODE pin for 3s to exit the setting mode, and the transceiver indicators will return to high level (the two LEDs remain off).

c) Remote access settings:

After the node is installed, you can use the remote access setting to change the parameters. During system operation, the server sends specific setting commands to the node through the gateway to modify various parameters of the node. There is a prerequisite for using remote access, that is, the node and the gateway can now communicate. The method to make the node remotely enter the setting module is as follows:

Send the OTA_SET command to the gateway through the serial port at the gateway. The gateway will buffer the setting command. When the next wake-up time of the node arrives, the gateway will send the setting command to the node, and the node will enter the setting mode after receiving it. After entering the setting mode, all setting operations of the node are the same as the local setting.

Enter the settings to send commands:

send (HEX): 24 8B 02 01 01 B3

reply(HEX): 24 8B 02 4F 4B 4B

After the node enters the setting mode remotely, it will automatically exit the setting mode without receiving any operation instructions within 30s. When any setting instruction is received, the timing starts again. Therefore, if you want to stay in the setting mode all the time, you should send any commands, such as querying the version number, before the 30s timeout. If you want to exit the setting mode immediately, you can also issue the following exit command.

Exit setting sending command:

send (HEX): 24 8B 02 01 00 B2

reply(HEX): 24 8B 02 4F 4B 4B

Note: When entering the setting mode locally, it will not automatically exit. You need to press and hold the setting pin for 3s to exit.

After the node enters the setting mode, it can modify its related parameters by sending corresponding setting commands to the gateway. For specific setting commands, please refer to "Acquisition Network Node Parameter Setting Protocol".

1.2 Operating mode

In working mode, the node stays in a sleep state most of the time to save power consumption. When the timing wake-up time arrives, the node automatically wakes up, automatically collects temperature or temperature and humidity data and the state of the Hall switch, and sends the collected results to the gateway, and then enters again and enters sleep again, so as to reciprocate.

1.3 Set sensor type

The node can select the type of temperature sensor through the following command.

Set command:

send :0x23 + 0x8D + length(1byte) + sensor_type(1byte) + checksum(1byte)

reply:0x23 + 0x8D + 0x02 + 'O' + 'K' + checksum(1byte)

Description:

sensor_type: sensor type; default: 0 (DS18B20)

0: The current sensor type is temperature sensor DS18B20;

1: The current sensor type is temperature and humidity sensor SHT20;

Example: (Select SHT20)

send (HEX): 23 8D 01 01 B2

reply(HEX): 23 8D 02 4F 4B 4C

Read current settings

send :0x23 + 0x0D + length(1byte) + checksum(1byte)

reply:0x23 + 0x0D + length(1byte) + sensor_type(1byte) + checksum(1byte)

Example:

send (HEX): 23 0D 00 30

reply(HEX): 23 0D 01 01 32

2 Node parameter description and modification

Gateway ID (GW_ID): Used for network identification, nodes with the same gateway ID belong to the same network.

Node ID (Node_ID): used to distinguish nodes.

Wireless channel (rf_channel): used to set the wireless frequency, which can reduce co-frequency interference when multiple networks.

Wireless rate (data_rate): used to set the wireless transmission rate.

Transmit power (tx_power): used to modify the transmit power of the module.

Serial port baud rate (baud_rate): used to modify the baud rate of the node and external MCU serial communication.

Effective data packet length (payload_len): used to calculate the air transmission time of the data, and used as the basis for judging the transmission timeout during retransmission.

Repeater_num: used to set the number of retransmissions.

Sensor type (sensor_type): used to select temperature sensor DS18B20 or temperature and humidity sensor SHT20.

Note: The range of node parameters and commands refer to the document "Acquisition Network Node Parameter Setting Protocol".

3 Modify node upload interval at runtime

The upload interval of all nodes in the same network must be the same. Therefore, when the gateway parameter "poll_interval" is modified, it is equivalent to changing the upload interval of all nodes. The gateway will automatically modify this parameter when the next upload time of all nodes arrives.

The polling interval (poll_interval) is in seconds and the maximum range is 65535. The minimum polling interval is related to the number of nodes in the network. In order to prevent data collision between nodes, the transmission interval between two nodes should be at least 1s. Therefore, the polling interval of the same node should be the number of nodes N times 1s. For example, if the number of nodes in the network is 5, the minimum polling interval is 5 seconds, and when the number of nodes is 64, the minimum polling interval is 64 seconds.

4 Node resend

The node allows the retransmission mechanism to be enabled or disabled. When no response from the gateway is received after transmitting the data packet, the node will retransmit. The number of retransmissions can be set to 0~3. If the number of retransmissions is 0, retransmission is turned off. The number of retransmissions is set through the "re_tx_num" command. For details, refer to "11 re_tx_num" in the "Acquisition Network Node Parameter Setting Protocol".

5 About the choice of rate

The wireless rate of the system supports 1200bps~1 Mbps. The choice of rate requires a trade-off between power consumption and distance according to the actual application. Choosing a low rate can achieve a longer distance, but it will increase the transmission time, which is equivalent to increased power consumption.

6 Data analysis in normal working mode

The node sends the collected data to the gateway, and the gateway outputs it in the following format after receiving it:

Data format: 0x5A + length(1byte) + gw_id(1byte) + node_id(1byte) + 0xFF + latch_rssi(1byte) + payload(6bytes) + checksum(1byte)

0x5A: Frame header, fixed at 5A;

length(1byte): Data length, the length indicated is the number of data bytes after the length byte and before the checksum (not including the length itself and the checksum).

gw_id(1byte): The gateway ID of the node to which the frame data belongs

node_id(1byte): The node ID of the node to which the frame data belongs

latch_rssi: The received signal strength indication received by the corresponding node last time;

The formula to convert the signal strength value to dBm is: RF_Input_dBm = (latch_rssi / 2)–64–70

The format of payload (6bytes): Hall switch status (1byte) + sensor type (1byte) + temperature value (2bytes) + humidity value (2bytes)

Hall switch status (1byte): 0: magnetic 1: no magnetic

Sensor type(1byte):

0x00: The current sensor type is temperature sensor DS18B20.

0x01: The current sensor type is temperature and humidity sensor SHT20.

Temperature value(2bytes):

The high byte comes first, and the low byte comes after.

The highest bit represents the sign, 0 represents a positive value, and 1 represents a negative value.

The values other than the sign bit are 10 times the actual temperature value.

For example, 0x010B = 267, which means 26.7℃.

The highest bit of 0x800A is 1 to indicate a negative value, except that the sign bit has a value of 10, which means -1.0°C.

Humidity value(2bytes):

Only valid when the sensor type = SHT20, otherwise it is fixed to 0xFFFF;

The high byte comes first, and the low byte comes after.

The value is 10 times the actual humidity value.

For example: 0x02D5 = 725, which means RH = 72.5%.

checksum(1byte): Checksum, the calculation method is the sum of all the bytes before the byte.

Example 1:The data output by the gateway is (HEX): 5A 0A 01 01 FF 78 01 01 01 11 02 D5 C8

     5A ---- frame header;

     0A ---- data length;

     01 ---- Gateway ID;

     01 ---- Node ID;

     FF ---- fixed as 0xFF;

     78 ---- Wireless signal strength indicator, corresponding to -74dbm after conversion;

     01 ---- Hall switch state = no magnetic attraction;

     01 ---- Sensor type = temperature and humidity sensor SHT20;

     01 11 ---- Temperature value = 0x0111 -> 27.3℃;

     02 D5 ---- temperature value = 0x02D5 -> 72.5%RH;

     C8 ---- checksum;

Example 2:The data output by the gateway is (HEX): 5A 0A 01 02 FF 65 01 00 01 0B FF FF D6

     5A ---- frame header;

     0A ---- data length;

     01 ---- Gateway ID;

     02 ---- Node ID;

     FF ---- fixed as 0xFF;

     65 ---- Wireless signal strength indicator, corresponding to -83.5dbm after conversion;

     01 ---- Hall switch state = no magnetic attraction;

     00 ---- sensor type = temperature sensor DS18B20;

     01 0B ---- temperature value = 0x010B -> 26.7℃;

     FF FF ---- sensor type = fixed to 0xFFFF for temperature sensor DS18B20;

     D6 ---- checksum;

7 Node offline indication

The gateway can monitor the working status of the node in real time. When the gateway fails to receive node information for 3 consecutive transmission cycles, it will send a corresponding alarm message to the server.

The alarm message is analyzed as follows:

Alarm message format: 0x6A + length(1byte) + 0x02 + gw_id(1byte) + node_id(1byte) + alarm_type(1byte) + checksum(1byte)

Description of each field of alarm message:

0x6A: Frame header, indicating notification;

length: After the length byte, the number of all bytes before the checksum.

0x02: indicates the node communication alarm;

gw_id: current gateway ID;

node_id: the node ID of the communication alarm;

alarm_type: alarm type, currently only 0x01;

checksum: checksum, the calculation range is the sum of all bytes before the byte;

Example:

send(HEX): 6A 04 02 01 05 01 77

6A - The data type is notification;

04-effective length;

02 - Node communication alarm;

01 - Gateway ID;

05 - The node ID of the alarm;

01 - Alarm type 0x01;

77 - checksum;

8 OTA firmware upgrade

Nodes can perform firmware upgrades (OTA) through wireless transmission. The specific upgrade method refers to the document "OTA Firmware Upgrade Tutorial".

9 Node battery life

The node adopts a low-power operating mode to maximize battery life. In suitable scenarios, a 1000mAh lithium battery can easily achieve a service life of more than 5 years.


Pin & Dimension

Pin definition

Mechanical Dimensions

×