Wiki source code of MDS200-NB -- NB-IoT Microwave Radar Distance Sensor User Manual
Last modified by Mengting Qiu on 2024/05/09 15:51
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | (% style="text-align:center" %) | ||
4 | [[image:image-20231008100025-1.png||height="412" width="626"]] | ||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | **Table of Contents:** | ||
13 | |||
14 | {{toc/}} | ||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | = 1. Introduction = | ||
22 | |||
23 | == 1.1 What is MDS200-NB NB-IoT Microwave Radar distance Sensor == | ||
24 | |||
25 | |||
26 | The Dragino MDS200-NB is a (% style="color:blue" %)**NB-IoT Microwave Radar distance Sensor**(%%) for Internet of Things solution. It uses (% style="color:blue" %)**24Ghz Microwave**(%%) to detect the (% style="color:blue" %)**distance between sensor and diferent objects**(%%). Diferent from ultrosonic or Lidar measurement. Microwave Radar is more reliable for (% style="color:blue" %)**condensation / dusty environment**(%%). It can sense correct distance even there is water or think dust on top of the sensor. | ||
27 | |||
28 | The MDS200-NB can be applied to scenarios such as horizontal distance measurement, parking management system, object proximity and presence detection, intelligent trash can management system, robot obstacle avoidance, automatic control, sewer, etc. | ||
29 | |||
30 | MDS200-NB can measure two distances: the closest object and next object behind the closest one. | ||
31 | |||
32 | MDS200-NB (% style="color:blue" %)**supports Alarm Feature**(%%), user can set the MDS200-NB to uplink data in a short interval when the distance is out of confgured range. | ||
33 | |||
34 | MDS200-NB supports different uplink methods including (% style="color:blue" %)**MQTT, MQTTs, UDP & TCP**(%%) for different application requirement, and support uplinks to various IoT Servers. | ||
35 | |||
36 | MDS200-NB (% style="color:blue" %)**supports BLE configure **(%%)and(% style="color:blue" %)** OTA update**(%%) which make user easy to use. | ||
37 | |||
38 | MDS200-NB is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long-term use up to several years. | ||
39 | |||
40 | MDS200-NB has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration. | ||
41 | |||
42 | [[image:image-20231008100832-2.png||height="315" width="934"]] | ||
43 | |||
44 | |||
45 | == 1.2 Features == | ||
46 | |||
47 | |||
48 | * NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD | ||
49 | * Ultra-low power consumption | ||
50 | * 24Ghz Microwave Radar for distance detection | ||
51 | * Measure Range: 0.5 ~~ 20m | ||
52 | * Accuracy: ±0.1m | ||
53 | * Resolution: 0.01m | ||
54 | * Measurement Angle: horizontal 78° and vertical 23° | ||
55 | * Multiply Sampling and one uplink | ||
56 | * Support Bluetooth v5.1 remote configure and update firmware | ||
57 | * Uplink on periodically | ||
58 | * Downlink to change configure | ||
59 | * 8500mAh Battery for long term use | ||
60 | * Nano SIM card slot for NB-IoT SIM | ||
61 | |||
62 | == 1.3 Specification == | ||
63 | |||
64 | |||
65 | (% style="color:blue" %)**Common DC Characteristics:** | ||
66 | |||
67 | * Supply Voltage: 2.5v ~~ 3.6v | ||
68 | * Operating Temperature: -40 ~~ 85°C | ||
69 | |||
70 | (% style="color:blue" %)**Radar probe Spec:** | ||
71 | |||
72 | * Measuring Method: FMCW | ||
73 | * Frequency: 24.000~~24.500 GHz | ||
74 | * Measurement output power: 6dBm | ||
75 | * Measure Range : 0.5 ~~ 20m | ||
76 | * Accuracy: ±0.1m | ||
77 | * Resolution: 0.01m | ||
78 | * Measurement Angle : 78 degrees horizontal and 23 degrees vertical | ||
79 | |||
80 | (% style="color:blue" %)**NB-IoT Spec:** | ||
81 | |||
82 | (% style="color:#037691" %)**NB-IoT Module: BC660K-GL** | ||
83 | |||
84 | (% style="color:#037691" %)**Support Bands:** | ||
85 | |||
86 | * B1 @H-FDD: 2100MHz | ||
87 | * B2 @H-FDD: 1900MHz | ||
88 | * B3 @H-FDD: 1800MHz | ||
89 | * B4 @H-FDD: 2100MHz | ||
90 | * B5 @H-FDD: 860MHz | ||
91 | * B8 @H-FDD: 900MHz | ||
92 | * B12 @H-FDD: 720MHz | ||
93 | * B13 @H-FDD: 740MHz | ||
94 | * B17 @H-FDD: 730MHz | ||
95 | * B18 @H-FDD: 870MHz | ||
96 | * B19 @H-FDD: 870MHz | ||
97 | * B20 @H-FDD: 790MHz | ||
98 | * B25 @H-FDD: 1900MHz | ||
99 | * B28 @H-FDD: 750MHz | ||
100 | * B66 @H-FDD: 2000MHz | ||
101 | * B70 @H-FDD: 2000MHz | ||
102 | * B85 @H-FDD: 700MHz | ||
103 | |||
104 | (% style="color:blue" %)**Battery:** | ||
105 | |||
106 | * Li/SOCI2 un-chargeable battery | ||
107 | * Capacity: 8500mAh | ||
108 | * Self Discharge: <1% / Year @ 25°C | ||
109 | * Max continuously current: 130mA | ||
110 | * Max boost current: 2A, 1 second | ||
111 | |||
112 | (% style="color:blue" %)**Power Consumption:** | ||
113 | |||
114 | * STOP Mode: 10uA @ 3.3v | ||
115 | * Max transmit power: 350mA@3.3v | ||
116 | |||
117 | == 1.4 Applications == | ||
118 | |||
119 | |||
120 | * Horizontal distance measurement | ||
121 | * Liquid level measurement | ||
122 | * Parking management system | ||
123 | * Object proximity and presence detection | ||
124 | * Intelligent trash can management system | ||
125 | * Robot obstacle avoidance | ||
126 | * Automatic control | ||
127 | * Sewer | ||
128 | * Bottom water level monitoring | ||
129 | |||
130 | == 1.5 Installation == | ||
131 | |||
132 | |||
133 | Sensor measure direction and angle is as below. When install the sensor, please make sure the sensor direct to object. | ||
134 | |||
135 | |||
136 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LMDS200%20-%20LoRaWAN%20Microwave%20Radar%20Distance%20%20Sensor%20User%20Manual/WebHome/image-20220615152454-3.png?rev=1.1||alt="image-20220615152454-3.png"]] | ||
137 | |||
138 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LMDS200%20-%20LoRaWAN%20Microwave%20Radar%20Distance%20%20Sensor%20User%20Manual/WebHome/image-20220615152454-4.png?width=731&height=398&rev=1.1||alt="image-20220615152454-4.png"]] | ||
139 | |||
140 | |||
141 | == 1.6 Sleep mode and working mode == | ||
142 | |||
143 | |||
144 | (% style="color:blue" %)**Deep Sleep Mode: **(%%)Sensor doesn't have any NB-IoT activate. This mode is used for storage and shipping to save battery life. | ||
145 | |||
146 | (% style="color:blue" %)**Working Mode:** (%%)In this mode, Sensor will work as NB-IoT Sensor to Join NB-IoT network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode. | ||
147 | |||
148 | |||
149 | == 1.7 Button & LEDs == | ||
150 | |||
151 | |||
152 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]] | ||
153 | |||
154 | |||
155 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
156 | |=(% style="width: 167px;background-color:#4F81BD;color:white" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width:226px;background-color:#4F81BD;color:white" %)**Action** | ||
157 | |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)((( | ||
158 | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once. | ||
159 | Meanwhile, BLE module will be active and user can connect via BLE to configure device. | ||
160 | ))) | ||
161 | |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)((( | ||
162 | (% style="color:green" %)**Green led**(%%) will fast blink 5 times, device will enter (% style="color:#037691" %)**OTA mode**(%%) for 3 seconds. And then start to attach NB-IoT network. | ||
163 | (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network. | ||
164 | Once sensor is active, BLE module will be active and user can connect via BLE to configure device, no matter if device attach NB-IoT network or not. | ||
165 | ))) | ||
166 | |(% style="width:167px" %)Fast press ACT 5 times.|(% style="width:117px" %)Deactivate Device|(% style="width:225px" %)(% style="color:red" %)**Red led**(%%) will solid on for 5 seconds. Means device is in Deep Sleep Mode. | ||
167 | |||
168 | (% style="color:red" %)**Note: When the device is executing a program, the buttons may become invalid. It is best to press the buttons after the device has completed the program execution.** | ||
169 | |||
170 | |||
171 | == 1.8 BLE connection == | ||
172 | |||
173 | |||
174 | MDS200-NB support BLE remote configure and firmware update. | ||
175 | |||
176 | |||
177 | BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case: | ||
178 | |||
179 | * Press button to send an uplink | ||
180 | * Press button to active device. | ||
181 | * Device Power on or reset. | ||
182 | |||
183 | If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode. | ||
184 | |||
185 | |||
186 | == 1.9 Pin Definitions , Switch & SIM Direction == | ||
187 | |||
188 | |||
189 | [[image:image-20230819104805-5.png]] | ||
190 | |||
191 | |||
192 | === 1.9.1 Jumper JP2 === | ||
193 | |||
194 | |||
195 | Power on Device when put this jumper. | ||
196 | |||
197 | |||
198 | === 1.9.2 BOOT MODE / SW1 === | ||
199 | |||
200 | |||
201 | **1)** (% style="color:blue" %)**ISP**(%%): upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware. LED won't work. Firmware won't run. | ||
202 | |||
203 | **2)** (% style="color:blue" %)**Flash**(%%): work mode, device starts to work and send out console output for further debug | ||
204 | |||
205 | |||
206 | === 1.9.3 Reset Button === | ||
207 | |||
208 | |||
209 | Press to reboot the device. | ||
210 | |||
211 | (% style="display:none" %) | ||
212 | |||
213 | |||
214 | === 1.9.4 SIM Card Direction === | ||
215 | |||
216 | |||
217 | See this link. [[How to insert SIM Card>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H2.AttachNetwork]]. | ||
218 | |||
219 | |||
220 | == 1.10 Mechanical == | ||
221 | |||
222 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143884058-338.png?rev=1.1||alt="1675143884058-338.png"]] | ||
223 | |||
224 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143899218-599.png?rev=1.1||alt="1675143899218-599.png"]] | ||
225 | |||
226 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143909447-639.png?rev=1.1||alt="1675143909447-639.png"]] | ||
227 | |||
228 | |||
229 | = 2. Use MDS200-NB to communicate with IoT Server = | ||
230 | |||
231 | == 2.1 Send data to IoT server via NB-IoT network == | ||
232 | |||
233 | |||
234 | The MDS200-NB is equipped with a NB-IoT module, the pre-loaded firmware in MDS200-NB will get environment data from sensors and send the value to local NB-IoT network via the NB-IoT module. The NB-IoT network will forward this value to IoT server via the protocol defined by MDS200-NB. | ||
235 | |||
236 | |||
237 | Below shows the network structure: | ||
238 | |||
239 | [[image:image-20231008100855-3.png||height="314" width="931"]] | ||
240 | |||
241 | |||
242 | There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1D**(%%) version of MDS200-NB. | ||
243 | |||
244 | |||
245 | (% style="color:blue" %)**GE Version**(%%): This version doesn't include SIM card or point to any IoT server. User needs to use AT Commands to configure below two steps to set MDS200-NB send data to IoT server. | ||
246 | |||
247 | * Install NB-IoT SIM card and configure APN. See instruction of [[Attach Network>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H2.AttachNetwork]]. | ||
248 | |||
249 | * Set up sensor to point to IoT Server. See instruction of [[Configure to Connect Different Servers>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.Configuretoconnecttodifferentservers]]. | ||
250 | |||
251 | Below shows result of different server as a glance. | ||
252 | |||
253 | (% border="1" cellspacing="4" style="width:515px" %) | ||
254 | |(% style="background-color:#4f81bd; color:white; width:100px" %)**Servers**|(% style="background-color:#4f81bd; color:white; width:300px" %)**Dash Board**|(% style="background-color:#4f81bd; color:white; width:115px" %)**Comments** | ||
255 | |(% style="width:127px" %)[[Node-Red>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.5A0Node-RedA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
256 | (% style="text-align:center" %) | ||
257 | [[image:image-20230819113244-8.png||height="183" width="367"]] | ||
258 | )))|(% style="width:170px" %) | ||
259 | |(% style="width:127px" %)[[DataCake>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.4Datacake]]|(% style="width:385px" %)((( | ||
260 | (% style="text-align:center" %) | ||
261 | [[image:image-20230819113244-9.png||height="119" width="367"]] | ||
262 | )))|(% style="width:170px" %) | ||
263 | |(% style="width:127px" %)[[Tago.IO>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.7A0Tago.ioA028viaA0MQTT29]]|(% style="width:385px" %) |(% style="width:170px" %) | ||
264 | |(% style="width:127px" %)[[General UDP>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.1GeneralA0UDPA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
265 | |(% style="width:127px" %)[[General MQTT>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.2GeneralA0MQTTA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
266 | |(% style="width:127px" %)[[ThingSpeak>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.3A0ThingSpeakA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
267 | (% style="text-align:center" %) | ||
268 | [[image:image-20230819113244-10.png||height="104" width="367"]] | ||
269 | )))|(% style="width:170px" %) | ||
270 | |(% style="width:127px" %)[[ThingsBoard>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.6A0ThingsBoard.CloudA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
271 | (% style="text-align:center" %) | ||
272 | [[image:image-20230819113244-11.png||height="141" width="367"]] | ||
273 | )))|(% style="width:170px" %) | ||
274 | |||
275 | (% style="color:blue" %)**1D Version**(%%): This version has 1NCE SIM card pre-installed and configure to send value to DataCake. User Just need to select the sensor type in DataCake and Activate MDS200-NB and user will be able to see data in DataCake. See here for [[DataCake Config Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.4Datacake]]. | ||
276 | |||
277 | |||
278 | == 2.2 Payload Types == | ||
279 | |||
280 | |||
281 | To meet different server requirement, MDS200-NB supports different payload type. | ||
282 | |||
283 | **Includes:** | ||
284 | |||
285 | * [[General JSON format payload>>||anchor="H2.2.1GeneralJsonFormat28Type3D529"]]. (Type=5) | ||
286 | |||
287 | * [[HEX format Payload>>||anchor="H2.2.2HEXformatPayload28Type3D029"]]. (Type=0) | ||
288 | |||
289 | * [[ThingSpeak Format>>||anchor="H2.2.4ThingSpeakPayload28Type3D129"]]. (Type=1) | ||
290 | |||
291 | * [[ThingsBoard Format>>||anchor="H2.2.3ThingsBoardPayload28Type3D329"]]. (Type=3) | ||
292 | |||
293 | User can specify the payload type when choose the connection protocol. Example: | ||
294 | |||
295 | (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Use UDP Connection & hex Payload | ||
296 | |||
297 | (% style="color:#037691" %)**AT+PRO=2,5** (%%) ~/~/ Use UDP Connection & Json Payload | ||
298 | |||
299 | (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload | ||
300 | |||
301 | |||
302 | === 2.2.1 General Json Format(Type~=5) === | ||
303 | |||
304 | |||
305 | This is the General Json Format. As below: | ||
306 | |||
307 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"MDS200-NB","distance1":77,"distance2":77,"battery":3.56,"signal":25,"1":{61441,61441,2023/10/18 06:10:23},"2":{61441,61441,2023/10/18 06:07:24},"3":{61441,61441,2023/10/18 06:04:24},"4":{61441,61441,2023/10/18 06:01:24},"5":{61441,61441,2023/10/18 05:58:24},"6":{61441,61441,2023/10/18 05:55:24},"7":{61441,61441,2023/10/18 05:52:24},"8":{61441,61441,2023/10/18 05:49:24}}** | ||
308 | |||
309 | |||
310 | [[image:image-20231018143349-2.png||height="726" width="981"]] | ||
311 | |||
312 | |||
313 | (% style="color:red" %)**Notice, from above payload:** | ||
314 | |||
315 | * Distance1,Distance2,Battery & Signal are the value at uplink time. | ||
316 | |||
317 | * Json entry 1 ~~ 8 are the last 1 ~~ 8 sampling data as specify by (% style="color:#037691" %)**AT+NOUD=8 ** (%%)Command. Each entry includes (from left to right): Distance1,Distance2,Sampling time. | ||
318 | |||
319 | === 2.2.2 HEX format Payload(Type~=0) === | ||
320 | |||
321 | |||
322 | This is the HEX Format. As below: | ||
323 | |||
324 | (% style="color:#4472c4" %)**f8662070583784430e640de4190100004d004d652f7d0ef001f001652f76cff001f001652f761cf001f001652f7568f001f001652f74b4f001f001652f7400f001f001652f734cf001f001652f7298f001f001652f71e4** | ||
325 | |||
326 | [[image:image-20231018140532-1.png||height="169" width="1050"]] | ||
327 | |||
328 | |||
329 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
330 | |||
331 | [[image:image-20231018143953-3.png||height="720" width="972"]] | ||
332 | |||
333 | |||
334 | (% style="color:blue" %)**Version:** | ||
335 | |||
336 | These bytes include the hardware and software version. | ||
337 | |||
338 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x0e for MDS200-NB | ||
339 | |||
340 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x64=100, means firmware version 1.0.0 | ||
341 | |||
342 | |||
343 | (% style="color:blue" %)**BAT (Battery Info):** | ||
344 | |||
345 | Ex1: 0x0DD2 = 3538mV | ||
346 | |||
347 | |||
348 | (% style="color:blue" %)**Signal Strength:** | ||
349 | |||
350 | NB-IoT Network signal Strength. | ||
351 | |||
352 | **Ex1: 0x15 = 21** | ||
353 | |||
354 | **0** -113dBm or less | ||
355 | |||
356 | **1** -111dBm | ||
357 | |||
358 | **2...30** -109dBm... -53dBm | ||
359 | |||
360 | **31** -51dBm or greater | ||
361 | |||
362 | **99** Not known or not detectable | ||
363 | |||
364 | |||
365 | (% style="color:blue" %)**Distance:** | ||
366 | |||
367 | Distance between sensor probe to the first object. (unit: mm) | ||
368 | |||
369 | For example, if the data you get from the register is** __0x0D 0xC6__**, the distance between the sensor and the measured object is** 0DC6(H) = 3526 (D) = 3526 mm.** | ||
370 | |||
371 | (% style="color:red" %)**Notice: The distance has a special value :** | ||
372 | |||
373 | ((( | ||
374 | (% style="color:blue" %)**0x3FFF**(%%): Reading Invalid (exceed the valid range of the probe) or Probe not detected. | ||
375 | |||
376 | |||
377 | |||
378 | ))) | ||
379 | |||
380 | (% style="color:blue" %)**TimeStamp: ** | ||
381 | |||
382 | Unit TimeStamp Example: 650d02ff(H) = 1695351551(D) | ||
383 | |||
384 | Put the decimal value into this link([[https:~~/~~/www.epochconverter.com)>>https://www.epochconverter.com]]) to get the time. | ||
385 | |||
386 | |||
387 | === 2.2.3 ThingsBoard Payload(Type~=3) === | ||
388 | |||
389 | |||
390 | Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard. | ||
391 | |||
392 | (% style="color:#4472c4" %)**{"IMEI": "866207058378443","Model": "MDS200-NB","distance1": 79,"distance2": 146,"battery": 3.56,"signal": 24}** | ||
393 | |||
394 | [[image:image-20231018153712-5.png||height="483" width="998"]] | ||
395 | |||
396 | |||
397 | === 2.2.4 ThingSpeak Payload(Type~=1) === | ||
398 | |||
399 | |||
400 | This payload meets ThingSpeak platform requirement. It includes only four fields. Form 1~~4 are: | ||
401 | |||
402 | Distance1, Distance2,Battery & Signal. This payload type only valid for ThingsSpeak Platform. | ||
403 | |||
404 | As below: | ||
405 | |||
406 | (% style="color:#4472c4" %)**field1=Distance 1 value&field2=Distance 2 value&field3=Battery value &field4=Signal value** | ||
407 | |||
408 | [[image:image-20231018150934-4.png||height="628" width="975"]] | ||
409 | |||
410 | |||
411 | |||
412 | |||
413 | |||
414 | == 2.3 Test Uplink and Change Update Interval == | ||
415 | |||
416 | |||
417 | By default, Sensor will send uplinks (% style="color:blue" %)**every 2 hours**(%%) & AT+NOUD=8 | ||
418 | |||
419 | User can use below commands to change the (% style="color:blue" %)**uplink interval**. | ||
420 | |||
421 | (% style="color:#037691" %)**AT+TDC=600 ** (%%) ~/~/ Set Update Interval to 600s | ||
422 | |||
423 | User can also push the button for more than 1 seconds to activate an uplink. | ||
424 | |||
425 | |||
426 | == 2.4 Multi-Samplings and One uplink == | ||
427 | |||
428 | (% style="color:red" %)Notice: The AT+NOUD feature is upgraded to Clock Logging, please refer [[Clock Logging Feature>>||anchor="H2.11Clocklogging28Sincefirmwareversionv1.2.129"]] | ||
429 | |||
430 | To save battery life, MDS200-NB will sample temperature & humidity data every 15 minutes and send one uplink every 2 hours. So each uplink it will include 8 stored data + 1 real-time data. They are defined by: | ||
431 | |||
432 | * (% style="color:#037691" %)**AT+TR=900** (%%) ~/~/ The unit is seconds, and the default is to record data once every 900 seconds (15 minutes, the minimum can be set to 180 seconds) | ||
433 | |||
434 | * (% style="color:#037691" %)**AT+NOUD=8** (%%)~/~/ The device uploads 8 sets of recorded data by default. Up to 32 sets of record data can be uploaded. | ||
435 | |||
436 | The diagram below explains the relationship between TR, NOUD, and TDC more clearly: | ||
437 | |||
438 | [[image:1692424376354-959.png]] | ||
439 | |||
440 | |||
441 | == 2.5 Trggier an uplink by external interrupt == | ||
442 | |||
443 | |||
444 | MDS200-NB has an external trigger interrupt function. Users can use the PB15 pin to trigger the upload of data packets. | ||
445 | |||
446 | (% style="color:blue" %)**AT command:** | ||
447 | |||
448 | * (% style="color:#037691" %)**AT+INTMOD **(%%) ~/~/ Set the trigger interrupt mode | ||
449 | |||
450 | * (% style="color:#037691" %)**AT+INTMOD=0 **(%%) ~/~/ Disable Interrupt | ||
451 | |||
452 | * (% style="color:#037691" %)**AT+INTMOD=1 **(%%) ~/~/ Trigger by rising and falling edge | ||
453 | |||
454 | * (% style="color:#037691" %)**AT+INTMOD=2 **(%%) ~/~/ Trigger by falling edge | ||
455 | |||
456 | * (% style="color:#037691" %)**AT+INTMOD=3 **(%%) ~/~/ Trigger by rising edge | ||
457 | |||
458 | == 2.6 Set Transmit Interval Time(0x01) == | ||
459 | |||
460 | |||
461 | Feature: Change nb-IoT End Node Transmit Interval. | ||
462 | |||
463 | (% style="color:#037691" %)**AT Command: AT+TDC** | ||
464 | |||
465 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
466 | |=(% style="width: 156px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 137px;background-color:#4F81BD;color:white" %)**Function**|=(% style="background-color:#4F81BD;color:white" %)**Response** | ||
467 | |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|((( | ||
468 | 30000 | ||
469 | OK | ||
470 | the interval is 30000ms = 30s | ||
471 | ))) | ||
472 | |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|((( | ||
473 | OK | ||
474 | Set transmit interval to 60000ms = 60 seconds | ||
475 | ))) | ||
476 | |||
477 | (% style="color:#037691" %)**Downlink Command: 0x01** | ||
478 | |||
479 | ((( | ||
480 | Format: Command Code (0x01) followed by 3 bytes time value. | ||
481 | |||
482 | ((( | ||
483 | If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01. | ||
484 | ))) | ||
485 | |||
486 | * Example 1: Downlink Payload: 0100001E ~/~/ Set Transmit Interval (TDC) = 30 seconds | ||
487 | |||
488 | * Example 2: Downlink Payload: 0100003C ~/~/ Set Transmit Interval (TDC) = 60 seconds | ||
489 | ))) | ||
490 | |||
491 | |||
492 | |||
493 | == 2.7 Set Alarm Transmit Interval Time(0x0D) == | ||
494 | |||
495 | |||
496 | Feature: Change NB-IoT End Node Alarm Transmit Interval. Default Value: 1 minute | ||
497 | |||
498 | (% style="color:#037691" %)**AT Command: AT+ATDC** | ||
499 | |||
500 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
501 | |=(% style="width: 156px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 137px;background-color:#4F81BD;color:white" %)**Function**|=(% style="background-color:#4F81BD;color:white" %)**Response** | ||
502 | |(% style="width:156px" %)AT+ATDC=?|(% style="width:139px" %)Show current alarm transmit Interval|(% style="width:213px" %)((( | ||
503 | 1 | ||
504 | OK | ||
505 | the interval is 1 minute | ||
506 | ))) | ||
507 | |(% style="width:156px" %)AT+ATDC=1|(% style="width:139px" %)Set Alarm Transmit Interval|(% style="width:213px" %)((( | ||
508 | OK | ||
509 | Set alarm transmit interval to 1 minute | ||
510 | ))) | ||
511 | |||
512 | (% style="color:#037691" %)**Downlink Command: 0x0D** | ||
513 | |||
514 | Format: Command Code (0x0D) followed by 1 byte for time value. | ||
515 | |||
516 | If the downlink payload=0D02, it means set the END Node's Alarm Transmit Interval to 2 minutes, while type code is 0D. | ||
517 | |||
518 | |||
519 | == 2.8 Set Alarm Distance (0xA2) == | ||
520 | |||
521 | |||
522 | MDS200-NB supports Alarm Feature, when MDS200-NB detect the distance exceed the alarm settings, MDS200-NB will Enter Alarm Mode and use the [[ATDC interval>>||anchor="H3.3.2SetAlarmTransmitIntervalTime280x0D29"]] (default is 1 minute) to uplink Distance value. Alarm mode will last for 60 uplinks (default 1 hour) and can be close by downlink command 0xA300. | ||
523 | |||
524 | (% style="color:red" %)**Note: Alarm mode only valid for the Distance 1(the Closest Object)** | ||
525 | |||
526 | |||
527 | User can set Alarm Distance to enable/disable Alarm Mode. | ||
528 | |||
529 | (% style="color:#037691" %)**AT+ALARMC=AA,BB** | ||
530 | |||
531 | * AA: Dec value for Alarm low threshold, BB: Dec value for Alarm high threshold | ||
532 | * When 0xAA=0, and 0xBB≠0, Alarm trigger when higher than max | ||
533 | * When 0xAA≠0, and 0xBB =0xFFFF, Alarm trigger when lower than min | ||
534 | * When 0xAA≠0 and 0xBB≠0, Alarm trigger when higher than max or lower than min | ||
535 | |||
536 | **Example:** | ||
537 | |||
538 | AT+ALARMC=100,200 ~/~/ Alarm when < 100 or higher than 200.(Min:50cm, Max:2000cm) | ||
539 | |||
540 | |||
541 | (% style="color:#037691" %)**Downlink Payload:** | ||
542 | |||
543 | 0x(A2 00 64 00 C8) ~/~/ Same as AT+ALARMC=100,200 | ||
544 | |||
545 | |||
546 | == 2.9 Enter/Exit Alarm Mode (0xA3) == | ||
547 | |||
548 | |||
549 | Feature: Enter/Exit Alarm mode: | ||
550 | |||
551 | (% style="color:#037691" %)**AT Command: AT+ALARM=0(Exit Alarm Mode or AT+ALARM=1 (Enter Alarm Mode)** | ||
552 | |||
553 | |||
554 | (% style="color:#037691" %)**Downlink Command:** | ||
555 | |||
556 | 0xA3 00 ~/~/ Exit Alarm Mode. | ||
557 | |||
558 | 0xA3 01 ~/~/ Enter Alarm Mode. Enter Alarm mode will use ATDC interval in the next 59 uplinks. | ||
559 | |||
560 | |||
561 | == 2.10 Set Interrupt Mode(0x06) == | ||
562 | |||
563 | |||
564 | ((( | ||
565 | Feature, Set Interrupt mode for GPIO_EXIT. | ||
566 | ))) | ||
567 | |||
568 | ((( | ||
569 | (% style="color:#037691" %)**AT Command: AT+INTMOD** | ||
570 | ))) | ||
571 | |||
572 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
573 | |=(% style="width: 154px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 196px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 160px;background-color:#4F81BD;color:white" %)**Response** | ||
574 | |(% style="width:154px" %)AT+INTMOD=?|(% style="width:196px" %)Show current interrupt mode|(% style="width:157px" %)((( | ||
575 | 0 | ||
576 | OK | ||
577 | the mode is 0 = No interruption | ||
578 | ))) | ||
579 | |(% style="width:154px" %)AT+INTMOD=2|(% style="width:196px" %)((( | ||
580 | Set Transmit Interval | ||
581 | 0. (Disable Interrupt), | ||
582 | ~1. (Trigger by rising and falling edge) | ||
583 | 2. (Trigger by falling edge) | ||
584 | 3. (Trigger by rising edge) | ||
585 | )))|(% style="width:157px" %)OK | ||
586 | |||
587 | (% style="color:#037691" %)**Downlink Command: 0x06** | ||
588 | |||
589 | ((( | ||
590 | Format: Command Code (0x06) followed by 3 bytes. | ||
591 | ))) | ||
592 | |||
593 | ((( | ||
594 | This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06. | ||
595 | ))) | ||
596 | |||
597 | * ((( | ||
598 | Example 1: Downlink Payload: 06000000 ~/~/ Turn off interrupt mode | ||
599 | ))) | ||
600 | |||
601 | * ((( | ||
602 | Example 2: Downlink Payload: 06000003 ~/~/ Set the interrupt mode to rising edge trigger | ||
603 | |||
604 | |||
605 | |||
606 | ))) | ||
607 | |||
608 | == 2.11 Clock logging (Since firmware version v1.2.1) == | ||
609 | |||
610 | |||
611 | Sometimes when we deploy lots of end nodes in field. We want all sensors sample data at the same time, and upload these data together for analyze. In such case, we can use clock loging feature. | ||
612 | |||
613 | We can use this command to set the start time of data recording and the time interval to meet the requirements of the specific collection time of data. | ||
614 | |||
615 | * (% style="color:#037691" %)**AT Command: AT+CLOCKLOG=a,b,c,d** | ||
616 | |||
617 | (% style="color:#037691" %)**a:**(%%)** 0:** Disable Clock logging. ** 1: **Enable Clock Logging | ||
618 | |||
619 | (% style="color:#037691" %)**b: **(%%)Specify First sampling start second: range **(0 ~~ 3599, 65535) ** ~/~/ (% style="color:red" %)**Note:**(%%)** **If parameter b is set to 65535, the log period starts after the node accesses the network and sends packets. | ||
620 | |||
621 | (% style="color:#037691" %)**c:**(%%)** **Specify the sampling interval: range **(0 ~~ 255 minutes)** | ||
622 | |||
623 | (% style="color:#037691" %)**d:**(%%)** **How many entries should be uplink on every TDC **(max 32)** | ||
624 | |||
625 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SPH01-NB_NB-IoT_Soil_pH_Sensor_User_Manual/WebHome/image-20240315141254-1.png?rev=1.1||alt="image-20240315141254-1.png"]] | ||
626 | |||
627 | |||
628 | **Example:** | ||
629 | |||
630 | **AT+CLOCKLOG=1,65535,1,5** | ||
631 | |||
632 | After the node sends the first packet, data is recorded to the memory at intervals of 1 minute. For each TDC uplink, the uplink load will include: battery information + the last 5 memory records (payload + timestamp). | ||
633 | |||
634 | (% class="wikigeneratedid" %) | ||
635 | [[image:image-20240315164601-1.png||height="618" width="1279"]] | ||
636 | |||
637 | (% style="color:red" %)**Note: Users need to synchronize the server time before configuring this command. If the server time is not synchronized before this command is configured, the command takes effect only after the node is reset.** | ||
638 | |||
639 | |||
640 | == 2.12 Example Query saved historical records == | ||
641 | |||
642 | |||
643 | * (% style="color:#037691" %)**AT Command: AT+CDP** | ||
644 | |||
645 | This command can be used to search the saved history, recording up to 32 groups of data, each group of historical data contains a maximum of 100 bytes. | ||
646 | |||
647 | (% class="wikigeneratedid" %) | ||
648 | [[image:image-20240315164725-2.png||height="652" width="847"]] | ||
649 | |||
650 | |||
651 | |||
652 | == 2.13 Uplink log query == | ||
653 | |||
654 | |||
655 | * (% style="color:#037691" %)**AT Command: AT+GETLOG** | ||
656 | |||
657 | This command can be used to query upstream logs of data packets. | ||
658 | |||
659 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-NB-NA_NB-IoT_Analog_Sensor_User_Manual/WebHome/image-20240407191922-2.png?width=903&height=631&rev=1.1||alt="image-20240407191922-2.png"]] | ||
660 | |||
661 | |||
662 | |||
663 | |||
664 | = 3. Configure MDS200-NB = | ||
665 | |||
666 | == 3.1 Configure Methods == | ||
667 | |||
668 | |||
669 | MDS200-NB supports below configure method: | ||
670 | |||
671 | * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]. | ||
672 | |||
673 | * AT Command via UART Connection : See [[UART Connection>>http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H2.3UARTConnectionforSN50v3basemotherboard]]. | ||
674 | |||
675 | == 3.2 AT Commands Set == | ||
676 | |||
677 | |||
678 | AT+<CMD>? : Help on <CMD> | ||
679 | |||
680 | AT+<CMD> : Run <CMD> | ||
681 | |||
682 | AT+<CMD>=<value> : Set the value | ||
683 | |||
684 | AT+<CMD>=? : Get the value | ||
685 | |||
686 | |||
687 | (% style="color:blue" %)**General Commands** | ||
688 | |||
689 | AT : Attention | ||
690 | |||
691 | AT? : Short Help | ||
692 | |||
693 | ATZ : MCU Reset | ||
694 | |||
695 | AT+TDC : Application Data Transmission Interval | ||
696 | |||
697 | AT+CFG : Print all configurations | ||
698 | |||
699 | AT+CFGMOD : Working mode selection | ||
700 | |||
701 | AT+DEUI : Get or set the Device ID | ||
702 | |||
703 | AT+INTMOD : Set the trigger interrupt mode | ||
704 | |||
705 | AT+5VT : Set extend the time of 5V power | ||
706 | |||
707 | AT+PRO : Choose agreement | ||
708 | |||
709 | AT+RXDL : Extend the sending and receiving time | ||
710 | |||
711 | AT+DNSCFG : Get or Set DNS Server | ||
712 | |||
713 | AT+GETSENSORVALUE : Returns the current sensor measurement | ||
714 | |||
715 | AT+NOUD : Get or Set the number of data to be uploaded | ||
716 | |||
717 | AT+CDP : Read or Clear cached data | ||
718 | |||
719 | AT+SHTEMP: Get or Set alarm of temp | ||
720 | |||
721 | AT+SHHUM: Get or Set alarm of moisture | ||
722 | |||
723 | AT+SERVADDR : Server Address | ||
724 | |||
725 | |||
726 | |||
727 | (% style="color:blue" %)**MQTT Management** | ||
728 | |||
729 | AT+CLIENT : Get or Set MQTT client | ||
730 | |||
731 | AT+UNAME : Get or Set MQTT Username | ||
732 | |||
733 | AT+PWD : Get or Set MQTT password | ||
734 | |||
735 | AT+PUBTOPIC : Get or Set MQTT publish topic | ||
736 | |||
737 | AT+SUBTOPIC : Get or Set MQTT subscription topic | ||
738 | |||
739 | |||
740 | (% style="color:blue" %)**Information** | ||
741 | |||
742 | AT+FDR : Factory Data Reset | ||
743 | |||
744 | AT+PWORD : Serial Access Password | ||
745 | |||
746 | AT+LDATA : Get the last upload data | ||
747 | |||
748 | AT+CDP : Read or Clear cached data | ||
749 | |||
750 | |||
751 | = 4. Battery & Power Consumption = | ||
752 | |||
753 | |||
754 | MDS200-NB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
755 | |||
756 | [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
757 | |||
758 | |||
759 | = 5. Firmware update = | ||
760 | |||
761 | |||
762 | User can change device firmware to:: | ||
763 | |||
764 | * Update with new features. | ||
765 | |||
766 | * Fix bugs. | ||
767 | |||
768 | Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/ti0d5usr68g9nfm/AADZU82hXliJ6q_zJzw4SUCma?dl=0]]** | ||
769 | |||
770 | Methods to Update Firmware: | ||
771 | |||
772 | * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]]. | ||
773 | |||
774 | * Update through UART TTL interface : **[[Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**. | ||
775 | |||
776 | = 6. FAQ = | ||
777 | |||
778 | == 6.1 How can I access t BC660K-GL AT Commands? == | ||
779 | |||
780 | |||
781 | User can access to BC660K-GL directly and send AT Commands. | ||
782 | |||
783 | [[See BC660K-GL AT Command set>>url:https://www.dropbox.com/sh/5f6ssda5fum8rvs/AABT68l8ZzWOvZ5eg2qwOoFda?dl=0]] | ||
784 | |||
785 | |||
786 | = 7. Order Info = | ||
787 | |||
788 | |||
789 | Part Number: (% style="color:blue" %)**MDS200-NB-XX** | ||
790 | |||
791 | (% style="color:red" %)**XX**(%%): | ||
792 | |||
793 | * (% style="color:#037691" %)**GE**(%%): General version ( Exclude SIM card) | ||
794 | |||
795 | * (% style="color:#037691" %)**1D**(%%): with 1NCE* 10 years 500MB SIM card and Pre-configure to DataCake server | ||
796 | |||
797 | (% style="color:#037691" %)**1NCE SIM Card NB-IoT network coverage**(%%): Austria, Belgium, Bulgaria, Croatia, Czech Republic, Denmark, Finland, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Latvia, Malta, Netherlands, Norway, Puerto Rico, Russia, Slovak , Republic, Slovenia, Spain, Sweden, Switzerland, Taiwan, USA, US Virgin Islands | ||
798 | |||
799 | |||
800 | = 8. Packing Info = | ||
801 | |||
802 | |||
803 | (% style="color:#037691" %)**Package Includes**: | ||
804 | |||
805 | * MDS200-NB NB-IoT Microwave Radar distance sensor x 1 | ||
806 | |||
807 | * External antenna x 1 | ||
808 | |||
809 | (% style="color:#037691" %)**Dimension and weight**: | ||
810 | |||
811 | * Device Size: 13.0 x 5 x 4.5 cm | ||
812 | |||
813 | * Device Weight: 150g | ||
814 | |||
815 | * Package Size / pcs : 14.0 x 8x 5 cm | ||
816 | |||
817 | * Weight / pcs : 180g | ||
818 | |||
819 | = 9. Support = | ||
820 | |||
821 | |||
822 | * Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule. | ||
823 | |||
824 | * Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to [[Support@dragino.cc>>mailto:Support@dragino.cc]]. | ||
825 | |||
826 | (% style="display:none" %) (%%) |