Wiki source code of SPH01-NB -- NB-IoT Soil pH Sensor User Manual
Last modified by Mengting Qiu on 2024/05/09 11:29
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | (% style="text-align:center" %) | ||
4 | [[image:image-20231013171842-1.png||height="506" width="780"]] | ||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | **Table of Contents:** | ||
14 | |||
15 | {{toc/}} | ||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | |||
22 | = 1. Introduction = | ||
23 | |||
24 | == 1.1 What is NB-IoT Soil pH Sensor == | ||
25 | |||
26 | |||
27 | The Dragino SPH01-NB is a (% style="color:blue" %)**NB-IoT Soil pH Sensor**(%%) for IoT of Agriculture. It is designed to measure the (% style="color:blue" %)**soil PH and soil temperature**,(%%) so to send to the platform to analyze the soil acid or alkali level. The probe is IP68 waterproof. | ||
28 | |||
29 | SPH01-NB probe is made by Solid AgCl reference electrode and Pure metal pH sensitive electrode. It can detect(% style="color:blue" %) **soil's pH **(%%)with high accuracy and stable value. The SPH01-NB probe can be buried into soil for long time use. | ||
30 | |||
31 | SPH01-NB supports different uplink methods including (% style="color:blue" %)**MQTT, MQTTs, UDP & TCP**(%%) for different application requirement, and support uplinks to various IoT Servers. | ||
32 | |||
33 | SPH01-NB (% style="color:blue" %)**supports BLE configure and OTA update**(%%) which make user easy to use. | ||
34 | |||
35 | SPH01-NB is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long-term use up to several years. | ||
36 | |||
37 | SPH01-NB has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration. | ||
38 | |||
39 | [[image:image-20231013172128-2.png||height="345" width="880"]](% style="display:none" %) | ||
40 | |||
41 | |||
42 | == 1.2 Features == | ||
43 | |||
44 | |||
45 | * NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD | ||
46 | * Ultra-low power consumption | ||
47 | * Monitor soil pH with temperature compensation. | ||
48 | * Monitor soil temperature | ||
49 | * Support pH calibration by end user | ||
50 | * Multiply Sampling and one uplink | ||
51 | * Support Bluetooth v5.1 remote configure and update firmware | ||
52 | * Uplink on periodically | ||
53 | * Downlink to change configure | ||
54 | * 8500mAh Battery for long term use | ||
55 | * Nano SIM card slot for NB-IoT SIM | ||
56 | |||
57 | == 1.3 Specification == | ||
58 | |||
59 | |||
60 | (% style="color:blue" %)**Common DC Characteristics:** | ||
61 | |||
62 | * Supply Voltage: 2.5v ~~ 3.6v | ||
63 | * Operating Temperature: -40 ~~ 85°C | ||
64 | |||
65 | (% style="color:blue" %)**Soil pH:** | ||
66 | |||
67 | * Range: 3 ~~ 10 pH | ||
68 | * Resolution: 0.01 pH | ||
69 | * Accuracy: ±2% under (0~~50 °C, Accuracy will poor under 0 due to frozen) | ||
70 | * Temperature Compensation Range: 0 ~~ 50°C | ||
71 | * IP68 Protection | ||
72 | * Length: 3.5 meters | ||
73 | |||
74 | (% style="color:blue" %)**Soil Temperature:** | ||
75 | |||
76 | * Range -40°C ~~ 85°C | ||
77 | * Resolution: 0.1°C | ||
78 | * Accuracy: <±0.5°C(-10°C ~~ 40°C),<±0.8°C (others) | ||
79 | * IP68 Protection | ||
80 | * Length: 3.5 meters | ||
81 | |||
82 | (% style="color:blue" %)**NB-IoT Spec:** | ||
83 | |||
84 | (% style="color:#037691" %)**NB-IoT Module: BC660K-GL** | ||
85 | |||
86 | (% style="color:#037691" %)**Support Bands:** | ||
87 | |||
88 | * B1 @H-FDD: 2100MHz | ||
89 | * B2 @H-FDD: 1900MHz | ||
90 | * B3 @H-FDD: 1800MHz | ||
91 | * B4 @H-FDD: 2100MHz | ||
92 | * B5 @H-FDD: 860MHz | ||
93 | * B8 @H-FDD: 900MHz | ||
94 | * B12 @H-FDD: 720MHz | ||
95 | * B13 @H-FDD: 740MHz | ||
96 | * B17 @H-FDD: 730MHz | ||
97 | * B18 @H-FDD: 870MHz | ||
98 | * B19 @H-FDD: 870MHz | ||
99 | * B20 @H-FDD: 790MHz | ||
100 | * B25 @H-FDD: 1900MHz | ||
101 | * B28 @H-FDD: 750MHz | ||
102 | * B66 @H-FDD: 2000MHz | ||
103 | * B70 @H-FDD: 2000MHz | ||
104 | * B85 @H-FDD: 700MHz | ||
105 | |||
106 | (% style="color:blue" %)**Battery:** | ||
107 | |||
108 | * Li/SOCI2 un-chargeable battery | ||
109 | * Capacity: 8500mAh | ||
110 | * Self Discharge: <1% / Year @ 25°C | ||
111 | * Max continuously current: 130mA | ||
112 | * Max boost current: 2A, 1 second | ||
113 | |||
114 | (% style="color:blue" %)**Power Consumption** | ||
115 | |||
116 | * STOP Mode: 10uA @ 3.3v | ||
117 | * Max transmit power: 350mA@3.3v | ||
118 | |||
119 | (% class="wikigeneratedid" %) | ||
120 | (% style="display:none" %) (%%) | ||
121 | |||
122 | |||
123 | == 1.4 Applications == | ||
124 | |||
125 | |||
126 | * Smart Agriculture | ||
127 | |||
128 | == 1.5 Sleep mode and working mode == | ||
129 | |||
130 | |||
131 | (% 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. | ||
132 | |||
133 | (% 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. | ||
134 | |||
135 | |||
136 | == 1.6 Button & LEDs == | ||
137 | |||
138 | |||
139 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]] | ||
140 | |||
141 | |||
142 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
143 | |=(% style="width: 167px;background-color:#4F81BD;color:white" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width:225px;background-color:#4F81BD;color:white" %)**Action** | ||
144 | |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)((( | ||
145 | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once. | ||
146 | Meanwhile, BLE module will be active and user can connect via BLE to configure device. | ||
147 | ))) | ||
148 | |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)((( | ||
149 | (% 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. | ||
150 | (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network. | ||
151 | 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. | ||
152 | ))) | ||
153 | |(% 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. | ||
154 | |||
155 | (% 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.** | ||
156 | |||
157 | |||
158 | == 1.7 BLE connection == | ||
159 | |||
160 | |||
161 | SPH01-NB support BLE remote configure and firmware update. | ||
162 | |||
163 | |||
164 | 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: | ||
165 | |||
166 | * Press button to send an uplink | ||
167 | * Press button to active device. | ||
168 | * Device Power on or reset. | ||
169 | |||
170 | If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode. | ||
171 | |||
172 | |||
173 | == 1.8 Pin Definitions , Switch & SIM Direction == | ||
174 | |||
175 | |||
176 | [[image:image-20231028160106-1.png]] | ||
177 | |||
178 | |||
179 | === 1.8.1 Jumper JP2 === | ||
180 | |||
181 | |||
182 | Power on Device when put this jumper. | ||
183 | |||
184 | |||
185 | === 1.8.2 BOOT MODE / SW1 === | ||
186 | |||
187 | |||
188 | **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. | ||
189 | |||
190 | **2)** (% style="color:blue" %)**Flash**(%%): work mode, device starts to work and send out console output for further debug | ||
191 | |||
192 | |||
193 | === 1.8.3 Reset Button === | ||
194 | |||
195 | |||
196 | Press to reboot the device. | ||
197 | |||
198 | |||
199 | === 1.8.4 SIM Card Direction === | ||
200 | |||
201 | |||
202 | 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]]. | ||
203 | |||
204 | |||
205 | = 2. Use SPH01-NB to communicate with IoT Server = | ||
206 | |||
207 | == 2.1 Send data to IoT server via NB-IoT network == | ||
208 | |||
209 | |||
210 | The SPH01-NB is equipped with a NB-IoT module, the pre-loaded firmware in SPH01-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 SPH01-NB. | ||
211 | |||
212 | Below shows the network structure: | ||
213 | |||
214 | [[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-20231013172128-2.png?width=880&height=345&rev=1.1||alt="image-20231013172128-2.png"]] | ||
215 | |||
216 | |||
217 | There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1D**(%%) version of SPH01-NB. | ||
218 | |||
219 | |||
220 | (% 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 SPH01-NB send data to IoT server. | ||
221 | |||
222 | * 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]]. | ||
223 | |||
224 | * 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]]. | ||
225 | |||
226 | Below shows result of different server as a glance. | ||
227 | |||
228 | (% border="1" cellspacing="4" style="width:515px" %) | ||
229 | |(% 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** | ||
230 | |(% 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" %)((( | ||
231 | (% style="text-align:center" %) | ||
232 | [[image:image-20230819113244-8.png||height="183" width="367"]] | ||
233 | )))|(% style="width:170px" %) | ||
234 | |(% 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" %)((( | ||
235 | (% style="text-align:center" %) | ||
236 | [[image:image-20230819113244-9.png||height="119" width="367"]] | ||
237 | )))|(% style="width:170px" %) | ||
238 | |(% 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" %) | ||
239 | |(% 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" %) | ||
240 | |(% 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" %) | ||
241 | |(% 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" %)((( | ||
242 | (% style="text-align:center" %) | ||
243 | [[image:image-20230819113244-10.png||height="104" width="367"]] | ||
244 | )))|(% style="width:170px" %) | ||
245 | |(% 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" %)((( | ||
246 | (% style="text-align:center" %) | ||
247 | [[image:image-20230819113244-11.png||height="141" width="367"]] | ||
248 | )))|(% style="width:170px" %) | ||
249 | |||
250 | (% 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 SPH01-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]]. | ||
251 | |||
252 | |||
253 | == 2.2 Payload Types == | ||
254 | |||
255 | |||
256 | To meet different server requirement, SPH01-NB supports different payload type. | ||
257 | |||
258 | **Includes:** | ||
259 | |||
260 | * [[General JSON format payload>>||anchor="H2.2.1GeneralJsonFormat28Type3D529"]]. (Type=5) | ||
261 | |||
262 | * [[HEX format Payload>>||anchor="H2.2.2HEXformatPayload28Type3D029"]]. (Type=0) | ||
263 | |||
264 | * [[ThingSpeak Format>>||anchor="H2.2.4ThingSpeakPayload28Type3D129"]]. (Type=1) | ||
265 | |||
266 | * [[ThingsBoard Format>>||anchor="H2.2.3ThingsBoardPayload28Type3D329"]]. (Type=3) | ||
267 | |||
268 | User can specify the payload type when choose the connection protocol. Example: | ||
269 | |||
270 | (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Use UDP Connection & hex Payload | ||
271 | |||
272 | (% style="color:#037691" %)**AT+PRO=2,5** (%%) ~/~/ Use UDP Connection & Json Payload | ||
273 | |||
274 | (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload | ||
275 | |||
276 | |||
277 | === 2.2.1 General Json Format(Type~=5) === | ||
278 | |||
279 | |||
280 | This is the General Json Format. As below: | ||
281 | |||
282 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"SPH01-NB","ph":5.38,"temperature":22.5,"battery":3.55,"signal":26,"1":{24.8,0.08,2023/10/28 07:24:59},"2":{25.2,0.07,2023/10/28 07:09:59},"3":{25.2,0.12,2023/10/28 06:54:59},"4":{25.1,1.52,2023/10/28 06:39:59},"5":{25.1,0.09,2023/10/28 06:23:25},"6":{25.0,0.09,2023/10/28 03:59:06},"7":{26.8,0.12,2023/10/28 03:25:20},"8":{0.0,0.00,2023/10/26 03:41:52}}** | ||
283 | |||
284 | |||
285 | [[image:image-20231028155522-1.png||height="737" width="995"]] | ||
286 | |||
287 | |||
288 | (% style="color:red" %)**Notice, from above payload:** | ||
289 | |||
290 | * PH,Temperature, Battery & Signal are the value at uplink time. | ||
291 | |||
292 | * 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): PH, Temperature, Sampling time. | ||
293 | |||
294 | === 2.2.2 HEX format Payload(Type~=0) === | ||
295 | |||
296 | |||
297 | This is the HEX Format. As below: | ||
298 | |||
299 | (% style="color:#4472c4" %)**f86620705837844306640ddf190100021c00e3653cc1f800e2021c653cc18400f80008653cb74b00fc0007653cb3c700fc000c653cb04300fb0098653cacbf00fb0009653ca8dd00fa0009653c870a010c000c653c7f20** | ||
300 | |||
301 | [[image:image-20231028161904-5.png||height="173" width="1047"]] | ||
302 | |||
303 | |||
304 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
305 | |||
306 | |||
307 | [[image:image-20231028161347-3.png||height="772" width="1035"]] | ||
308 | |||
309 | |||
310 | (% style="color:blue" %)**Version:** | ||
311 | |||
312 | These bytes include the hardware and software version. | ||
313 | |||
314 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x06 for SPH01-NB | ||
315 | |||
316 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x64=100, means firmware version 100 | ||
317 | |||
318 | |||
319 | (% style="color:blue" %)**BAT (Battery Info):** | ||
320 | |||
321 | Ex1: 0x0CC6 = 3270mV | ||
322 | |||
323 | |||
324 | (% style="color:blue" %)**Signal Strength:** | ||
325 | |||
326 | NB-IoT Network signal Strength. | ||
327 | |||
328 | **Ex1: 0x18 = 24** | ||
329 | |||
330 | **0** -113dBm or less | ||
331 | |||
332 | **1** -111dBm | ||
333 | |||
334 | **2...30** -109dBm... -53dBm | ||
335 | |||
336 | **31** -51dBm or greater | ||
337 | |||
338 | **99** Not known or not detectable | ||
339 | |||
340 | |||
341 | (% style="color:blue" %)**DS18B20 Temperature sensor** | ||
342 | |||
343 | This is optional, user can connect external DS18B20 sensor to the +3.3v, 1-wire and GND pin . and this field will report temperature. | ||
344 | |||
345 | |||
346 | **Example**: | ||
347 | |||
348 | If payload is: 0105H: (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree | ||
349 | |||
350 | If payload is: FF3FH : (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees. | ||
351 | |||
352 | |||
353 | (% style="color:blue" %)**Soil pH** | ||
354 | |||
355 | Range: 0 ~~ 14 pH | ||
356 | |||
357 | **Example:** | ||
358 | |||
359 | (% style="color:#037691" %)** 0x02B7(H) = 695(D) = 6.95pH** | ||
360 | |||
361 | |||
362 | (% style="color:blue" %)**Soil Temperature** | ||
363 | |||
364 | Get Soil Temperature | ||
365 | |||
366 | **Example**: | ||
367 | |||
368 | If payload is: **0105H**: (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree | ||
369 | |||
370 | If payload is: **FF3FH** : (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees. | ||
371 | |||
372 | |||
373 | (% style="color:blue" %)**TimeStamp: ** | ||
374 | |||
375 | Unit TimeStamp Example: 64d49439(H) = 1691653177(D) | ||
376 | |||
377 | Put the decimal value into this link([[https:~~/~~/www.epochconverter.com)>>https://www.epochconverter.com]]) to get the time. | ||
378 | |||
379 | |||
380 | === 2.2.3 ThingsBoard Payload(Type~=3) === | ||
381 | |||
382 | |||
383 | Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard. | ||
384 | |||
385 | (% style="color:#4472c4" %)** { | ||
386 | "IMEI": "866207058378443", | ||
387 | "Model": "SPH01-NB", | ||
388 | "ph": 5.4, | ||
389 | "temperature": 22.9, | ||
390 | "battery": 3.55, | ||
391 | "signal": 18 | ||
392 | }** | ||
393 | |||
394 | |||
395 | [[image:image-20231028162708-6.png||height="502" width="1118"]] | ||
396 | |||
397 | |||
398 | === 2.2.4 ThingSpeak Payload(Type~=1) === | ||
399 | |||
400 | |||
401 | This payload meets ThingSpeak platform requirement. It includes only four fields. Form 1~~4 are: | ||
402 | |||
403 | PH, Temperature, Battery & Signa. This payload type only valid for ThingsSpeak Platform. | ||
404 | |||
405 | As below: | ||
406 | |||
407 | (% style="color:#4472c4" %)**field1=PH value&field2=Temperature value&&field3=Battery value&field4=Signal value** | ||
408 | |||
409 | [[image:image-20231028165224-7.png||height="680" width="1047"]] | ||
410 | |||
411 | |||
412 | == 2.3 Test Uplink and Change Update Interval == | ||
413 | |||
414 | |||
415 | By default, Sensor will send uplinks (% style="color:blue" %)**every 2 hours**(%%) & AT+NOUD=8 | ||
416 | |||
417 | User can use below commands to change the (% style="color:blue" %)**uplink interval**. | ||
418 | |||
419 | (% style="color:#037691" %)**AT+TDC=600 ** (%%) ~/~/ Set Update Interval to 600s | ||
420 | |||
421 | User can also push the button for more than 1 seconds to activate an uplink. | ||
422 | |||
423 | |||
424 | == 2.4 Multi-Samplings and One uplink == | ||
425 | |||
426 | (% style="color:red" %)Notice: The AT+NOUD feature is upgraded to Clock Logging, please refer [[Clock Logging Feature>>||anchor="H2.8A0Clocklogging28Sincefirmwareversionv1.2.129"]] | ||
427 | |||
428 | To save battery life, SPH01-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: | ||
429 | |||
430 | * (% 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) | ||
431 | |||
432 | * (% 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. | ||
433 | |||
434 | The diagram below explains the relationship between TR, NOUD, and TDC more clearly: | ||
435 | |||
436 | [[image:1692424376354-959.png]] | ||
437 | |||
438 | |||
439 | == 2.5 Trggier an uplink by external interrupt == | ||
440 | |||
441 | |||
442 | SPH01-NB has an external trigger interrupt function. Users can use the PB15 pin to trigger the upload of data packets. | ||
443 | |||
444 | (% style="color:blue" %)**AT command:** | ||
445 | |||
446 | * (% style="color:#037691" %)**AT+INTMOD **(%%) ~/~/ Set the trigger interrupt mode | ||
447 | |||
448 | * (% style="color:#037691" %)**AT+INTMOD=0 **(%%) ~/~/ Disable Interrupt | ||
449 | |||
450 | * (% style="color:#037691" %)**AT+INTMOD=1 **(%%) ~/~/ Trigger by rising and falling edge | ||
451 | |||
452 | * (% style="color:#037691" %)**AT+INTMOD=2 **(%%) ~/~/ Trigger by falling edge | ||
453 | |||
454 | * (% style="color:#037691" %)**AT+INTMOD=3 **(%%) ~/~/ Trigger by rising edge | ||
455 | |||
456 | == 2.6 Installation and Maintain == | ||
457 | |||
458 | === 2.6.1 Before measurement === | ||
459 | |||
460 | |||
461 | ((( | ||
462 | If the SPH01-NB has more than 7 days not use or just clean the pH probe. User should put the probe inside pure water for more than 24 hours for activation. If no put in water, user need to put inside soil for more than 24 hours to ensure the measurement accuracy. | ||
463 | ))) | ||
464 | |||
465 | |||
466 | === 2.6.2 Measurement === | ||
467 | |||
468 | |||
469 | ((( | ||
470 | (% style="color:blue" %)**Measurement the soil surface:** | ||
471 | ))) | ||
472 | |||
473 | ((( | ||
474 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSPH01-LoRaWAN%20Soil%20pH%20Sensor%20User%20Manual/WebHome/1654592946732-634.png?rev=1.1||alt="1654592946732-634.png"]] | ||
475 | ))) | ||
476 | |||
477 | ((( | ||
478 | Choose the proper measuring position. Split the surface soil according to the measured deep. | ||
479 | ))) | ||
480 | |||
481 | ((( | ||
482 | Put pure water, or rainwater to make the soil of measurement point to moist mud. Remove rocks or hard things. | ||
483 | ))) | ||
484 | |||
485 | ((( | ||
486 | Slowly insert the probe to the measure point. Don't use large force which will break the probe. Make sure not shake when inserting. | ||
487 | ))) | ||
488 | |||
489 | ((( | ||
490 | Put soil over the probe after insert. And start to measure. | ||
491 | ))) | ||
492 | |||
493 | |||
494 | ((( | ||
495 | (% style="color:blue" %)**Measurement inside soil:** | ||
496 | ))) | ||
497 | |||
498 | ((( | ||
499 | Dig a hole with diameter > 20CM. | ||
500 | ))) | ||
501 | |||
502 | ((( | ||
503 | Insert the probe inside, method like measure the surface. | ||
504 | ))) | ||
505 | |||
506 | |||
507 | === 2.6.3 Maintain Probe === | ||
508 | |||
509 | |||
510 | ((( | ||
511 | ~1. pH probe electrode is fragile and no strong. User must avoid strong force or hitting it. | ||
512 | ))) | ||
513 | |||
514 | ((( | ||
515 | 2. After long time use (3~~ 6 months). The probe electrode needs to be clean; user can use high grade sandpaper to polish it or put in 5% hydrochloric acid for several minutes. After the metal probe looks like new, user can use pure water to wash it. | ||
516 | ))) | ||
517 | |||
518 | ((( | ||
519 | 3. Probe reference electrode is also no strong, need to avoid strong force or hitting. | ||
520 | ))) | ||
521 | |||
522 | ((( | ||
523 | 4. User should keep reference electrode wet while not use. | ||
524 | ))) | ||
525 | |||
526 | ((( | ||
527 | 5. Avoid the probes to touch oily matter. Which will cause issue in accuracy. | ||
528 | ))) | ||
529 | |||
530 | ((( | ||
531 | 6. The probe is IP68 can be put in water. | ||
532 | ))) | ||
533 | |||
534 | |||
535 | == 2.7 Calibration == | ||
536 | |||
537 | |||
538 | ((( | ||
539 | User can do calibration for the probe. It is limited to use below pH buffer solution to calibrate: 4.00, 6.86, 9.18. When calibration, user need to clean the electrode and put the probe in the pH buffer solution to wait the value stable ( a new clean electrode might need max 24 hours to be stable). | ||
540 | ))) | ||
541 | |||
542 | ((( | ||
543 | After stable, user can use below command to calibrate. | ||
544 | |||
545 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:520px" %) | ||
546 | |(% style="background-color:#4f81bd; color:white; width:120px" %)**pH buffer solution**|(% style="background-color:#4f81bd; color:white; width:150px" %)**AT Command to calibrate**|(% style="background-color:#4f81bd; color:white; width:150px" %)**Downlink Command**|(% style="background-color:#4f81bd; color:white; width:100px" %)**Read Cal Value** | ||
547 | |(% style="width:149px" %)4.00|(% style="width:197px" %)AT+PHCAL=4|(% style="width:206px" %)((( | ||
548 | 0x13 04 | ||
549 | Reply with Calibrate payload | ||
550 | )))|(% style="width:136px" %)((( | ||
551 | AT+PHCAL=? | ||
552 | Example 41,61,91 | ||
553 | ))) | ||
554 | |(% style="width:149px" %)6.86|(% style="width:197px" %)AT+PHCAL=6|(% style="width:206px" %)((( | ||
555 | 0x13 06 | ||
556 | Reply with Calibrate payload | ||
557 | )))|(% style="width:136px" %)AT+PHCAL=? | ||
558 | |(% style="width:149px" %)9.18|(% style="width:197px" %)AT+PHCAL=9|(% style="width:206px" %)((( | ||
559 | 0x13 09 | ||
560 | Reply with Calibrate payload | ||
561 | )))|(% style="width:136px" %)AT+PHCAL=? | ||
562 | |(% style="width:149px" %)Factory Default|(% style="width:197px" %)AT+PHCAL=15|(% style="width:206px" %)((( | ||
563 | 0x13 15 | ||
564 | Reply with Calibrate payload | ||
565 | )))|(% style="width:136px" %)((( | ||
566 | AT+PHCAL=? | ||
567 | Example 151 | ||
568 | ))) | ||
569 | ))) | ||
570 | |||
571 | |||
572 | (% style="color:#037691" %)**Calibration Payload** | ||
573 | |||
574 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %) | ||
575 | |=(% style="width: 60px;background-color:#4F81BD;color:white" %)((( | ||
576 | **Size(bytes)** | ||
577 | )))|=(% style="width: 100px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 100px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 100px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**7**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**1** | ||
578 | |Value|((( | ||
579 | PH4 Calibrate value | ||
580 | )))|PH6.86 Calibrate value|((( | ||
581 | PH9.18 Calibrate value | ||
582 | )))|Reserve|((( | ||
583 | Message Type | ||
584 | Always 0x03 | ||
585 | ))) | ||
586 | |||
587 | User can also send 0x14 downlink command to poll the current calibration payload. | ||
588 | |||
589 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:480px" %) | ||
590 | |=(% style="width: 183px; background-color:#4F81BD;color:white" %)**Downlink Control Type**|=(% style="width: 55px; background-color:#4F81BD;color:white" %)FPort|=(% style="width: 93px; background-color:#4F81BD;color:white" %)**Type Code**|=(% style="width: 149px; background-color:#4F81BD;color:white" %)**Downlink payload size(bytes)** | ||
591 | |(% style="width:183px" %)Get Calibration Version Info|(% style="width:55px" %)Any|(% style="width:93px" %)14|(% style="width:146px" %)2 | ||
592 | |||
593 | * Reply to the confirmation package: 14 01 | ||
594 | |||
595 | * Reply to non-confirmed packet: 14 00 | ||
596 | |||
597 | == 2.8 Clock logging (Since firmware version v1.2.1) == | ||
598 | |||
599 | |||
600 | 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. | ||
601 | |||
602 | 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. | ||
603 | |||
604 | * (% style="color:blue" %)**AT Command: **(% style="color:#037691" %)**AT+CLOCKLOG=a,b,c,d** | ||
605 | |||
606 | (% style="color:#037691" %)**a:**(%%)** 0:** Disable Clock logging. ** 1: **Enable Clock Logging | ||
607 | |||
608 | (% 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. | ||
609 | |||
610 | (% style="color:#037691" %)**c: **(%%)Specify the sampling interval: range **(0 ~~ 255 minutes)** | ||
611 | |||
612 | (% style="color:#037691" %)**d: **(%%)How many entries should be uplink on every TDC **(max 32)** | ||
613 | |||
614 | [[image:image-20240315141254-1.png]] | ||
615 | |||
616 | |||
617 | **Example:** | ||
618 | |||
619 | **AT+CLOCKLOG=1,65535,1,5** | ||
620 | |||
621 | 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). | ||
622 | |||
623 | [[image:image-20240315144442-2.png||height="499" width="1273"]] | ||
624 | (% 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.** | ||
625 | |||
626 | |||
627 | == 2.9 Example Query saved historical records == | ||
628 | |||
629 | |||
630 | * (% style="color:blue" %)**AT Command: **(% style="color:#037691" %)**AT+CDP** | ||
631 | |||
632 | 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. | ||
633 | |||
634 | [[image:image-20240315145116-3.png||height="625" width="803"]] | ||
635 | |||
636 | |||
637 | == 2.10 Uplink log query == | ||
638 | |||
639 | * (% style="color:blue" %)**AT Command: **(% style="color:#037691" %)**AT+GETLOG** | ||
640 | |||
641 | This command can be used to query upstream logs of data packets. | ||
642 | |||
643 | [[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"]] | ||
644 | |||
645 | |||
646 | = 3. Configure SPH01-NB = | ||
647 | |||
648 | == 3.1 Configure Methods == | ||
649 | |||
650 | |||
651 | SPH01-NB supports below configure method: | ||
652 | |||
653 | * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]. | ||
654 | |||
655 | * 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]]. | ||
656 | |||
657 | == 3.2 AT Commands Set == | ||
658 | |||
659 | |||
660 | AT+<CMD>? : Help on <CMD> | ||
661 | |||
662 | AT+<CMD> : Run <CMD> | ||
663 | |||
664 | AT+<CMD>=<value> : Set the value | ||
665 | |||
666 | AT+<CMD>=? : Get the value | ||
667 | |||
668 | |||
669 | (% style="color:blue" %)**General Commands** | ||
670 | |||
671 | AT : Attention | ||
672 | |||
673 | AT? : Short Help | ||
674 | |||
675 | ATZ : MCU Reset | ||
676 | |||
677 | AT+TDC : Application Data Transmission Interval | ||
678 | |||
679 | AT+CFG : Print all configurations | ||
680 | |||
681 | AT+CFGMOD : Working mode selection | ||
682 | |||
683 | AT+DEUI : Get or set the Device ID | ||
684 | |||
685 | AT+INTMOD : Set the trigger interrupt mode | ||
686 | |||
687 | AT+5VT : Set extend the time of 5V power | ||
688 | |||
689 | AT+PRO : Choose agreement | ||
690 | |||
691 | AT+RXDL : Extend the sending and receiving time | ||
692 | |||
693 | AT+DNSCFG : Get or Set DNS Server | ||
694 | |||
695 | AT+GETSENSORVALUE : Returns the current sensor measurement | ||
696 | |||
697 | AT+NOUD : Get or Set the number of data to be uploaded | ||
698 | |||
699 | AT+CDP : Read or Clear cached data | ||
700 | |||
701 | AT+SHTEMP: Get or Set alarm of temp | ||
702 | |||
703 | AT+SHHUM: Get or Set alarm of moisture | ||
704 | |||
705 | AT+SERVADDR : Server Address | ||
706 | |||
707 | |||
708 | (% style="color:blue" %)**MQTT Management** | ||
709 | |||
710 | AT+CLIENT : Get or Set MQTT client | ||
711 | |||
712 | AT+UNAME : Get or Set MQTT Username | ||
713 | |||
714 | AT+PWD : Get or Set MQTT password | ||
715 | |||
716 | AT+PUBTOPIC : Get or Set MQTT publish topic | ||
717 | |||
718 | AT+SUBTOPIC : Get or Set MQTT subscription topic | ||
719 | |||
720 | |||
721 | (% style="color:blue" %)**Information** | ||
722 | |||
723 | AT+FDR : Factory Data Reset | ||
724 | |||
725 | AT+PWORD : Serial Access Password | ||
726 | |||
727 | AT+LDATA : Get the last upload data | ||
728 | |||
729 | AT+CDP : Read or Clear cached data | ||
730 | |||
731 | |||
732 | = 4. Battery & Power Consumption = | ||
733 | |||
734 | |||
735 | SPH01-NB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
736 | |||
737 | [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
738 | |||
739 | |||
740 | = 5. Firmware update = | ||
741 | |||
742 | |||
743 | User can change device firmware to:: | ||
744 | |||
745 | * Update with new features. | ||
746 | |||
747 | * Fix bugs. | ||
748 | |||
749 | Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/f3vg7jji24y011j/AACoNBWZqGNpAcaJx3tGbkLLa?dl=0]]** | ||
750 | |||
751 | Methods to Update Firmware: | ||
752 | |||
753 | * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]]. | ||
754 | |||
755 | * Update through UART TTL interface : **[[Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**. | ||
756 | |||
757 | = 6. FAQ = | ||
758 | |||
759 | == 6.1 How can I access t BC660K-GL AT Commands? == | ||
760 | |||
761 | |||
762 | User can access to BC660K-GL directly and send AT Commands. | ||
763 | |||
764 | [[See BC660K-GL AT Command set>>url:https://www.dropbox.com/sh/5f6ssda5fum8rvs/AABT68l8ZzWOvZ5eg2qwOoFda?dl=0]] | ||
765 | |||
766 | |||
767 | = 7. Order Info = | ||
768 | |||
769 | |||
770 | Part Number: (% style="color:blue" %)**SPH01-NB-XX** | ||
771 | |||
772 | (% style="color:red" %)**XX**(%%): | ||
773 | |||
774 | * (% style="color:#037691" %)**GE**(%%): General version ( Exclude SIM card) | ||
775 | |||
776 | * (% style="color:#037691" %)**1D**(%%): with 1NCE* 10 years 500MB SIM card and Pre-configure to DataCake server | ||
777 | |||
778 | (% 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 | ||
779 | |||
780 | |||
781 | = 8. Packing Info = | ||
782 | |||
783 | |||
784 | (% style="color:#037691" %)**Package Includes**: | ||
785 | |||
786 | * SPH01-NB NB-IoT Soil pH Sensor x 1 | ||
787 | |||
788 | * External antenna x 1 | ||
789 | |||
790 | (% style="color:#037691" %)**Dimension and weight**: | ||
791 | |||
792 | * Device Size: cm | ||
793 | |||
794 | * Device Weight: g | ||
795 | |||
796 | * Package Size / pcs : cm | ||
797 | |||
798 | * Weight / pcs : g | ||
799 | |||
800 | = 9. Support = | ||
801 | |||
802 | |||
803 | * 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. | ||
804 | |||
805 | * 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]]. | ||
806 | |||
807 | (% style="display:none" %) (%%) |