Last modified by Xiaoling on 2024/09/24 15:37

Show last authors
1 **Table of Contents:**
2
3 {{toc/}}
4
5
6
7
8
9 = 1. RS485-LB connects to third-party sensors =
10
11 == 1.1 How to connect RS485-LB node to UART distance sensor? ==
12
13
14 Take the A16-15 as an example, but the same setup can support different distance sensors, compare specifications see this [[link>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/DDS04-LB_LoRaWAN_4-Channels_Distance_Detection_Sensor_User_Manual/#H1.4ProbeOptions]] to DDS04-LB.
15
16 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20240703151202-1.png?rev=1.1||alt="image-20240703151202-1.png"]]
17
18 * (((
19 **Connection:**
20 )))
21
22 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20240703153033-2.jpeg?width=687&height=364&rev=1.1||alt="image-20240703153033-2.jpeg" height="364" width="687"]]
23
24 * **AT command configuration:  **
25
26 **AT+MOD=2    **
27
28 **AT+COMMAND1=01 02 03 04 05 ,0  AT+SEARCH1=1,ff  AT+DATACUT1=4,2,2~~3  AT+CMDDL1=1000**
29
30 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20240703153540-3.png?rev=1.1||alt="image-20240703153540-3.png"]]
31
32 * **Decoder:  Decoding refer to this [[link>>url:https://github.com/dragino/dragino-end-node-decoder/tree/main/RS485-LB_A16-15]].**
33 * **Example in TTN:**
34
35 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20240703161941-4.png?width=1357&height=619&rev=1.1||alt="image-20240703161941-4.png" height="619" width="1357"]]
36
37
38 = 2. SN50v3-LB connects to third-party sensors =
39
40 == 2.1 Working Modes & Sensor Data. Uplink via FPORT~=2 ==
41
42
43 SN50v3-LB/LS has different working mode for the connections of different type of sensors. This section describes these modes. Use can use the AT Command (% style="color:blue" %)**AT+MOD**(%%) to set SN50v3-LB/LS to different working modes.
44
45 For example:
46
47 (% style="color:blue" %)**AT+MOD=2  ** (%%) ~/~/ will set the SN50v3 to work in MOD=2 distance mode which target to measure distance via Ultrasonic Sensor.
48
49
50 (% style="color:red" %)**Important Notice:**
51
52 ~1. Some working modes has payload more than 12 bytes, The US915/AU915/AS923 frequency bands' definition has maximum 11 bytes in (% style="color:blue" %)**DR0**(%%). Server sides will see NULL payload while SN50v3-LB/LS transmit in DR0 with 12 bytes payload.
53
54 2. All modes share the same Payload Explanation from HERE.
55
56 3. By default, the device will send an uplink message every 20 minutes.
57
58
59 === 2.1.1 MOD~=1 (Default Mode) ===
60
61
62 In this mode, uplink payload includes in total 11 bytes. Uplink packets use FPORT=2.
63
64 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
65 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:20px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**2**|(% style="background-color:#4f81bd; color:white; width:50px" %)**2**|(% style="background-color:#4f81bd; color:white; width:90px" %)**1**|(% style="background-color:#4f81bd; color:white; width:128px" %)**2**|(% style="background-color:#4f81bd; color:white; width:79px" %)**2**
66 |Value|Bat|(% style="width:191px" %)(((
67 Temperature(DS18B20)(PC13)
68 )))|(% style="width:78px" %)(((
69 ADC(PA4)
70 )))|(% style="width:216px" %)(((
71 Digital in(PB15)&Digital Interrupt(PA8)
72 )))|(% style="width:308px" %)(((
73 Temperature(SHT20 or SHT31 or BH1750 Illumination Sensor)
74 )))|(% style="width:154px" %)(((
75 Humidity(SHT20 or SHT31)
76 )))
77
78 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/image-20220627150949-6.png?rev=1.1||alt="image-20220627150949-6.png"]]
79
80
81 === 2.1.2 MOD~=2 (Distance Mode) ===
82
83
84 This mode is target to measure the distance. The payload of this mode is totally 11 bytes. The 8^^th^^ and 9^^th^^ bytes is for the distance.
85
86 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
87 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:29px" %)**2**|(% style="background-color:#4f81bd; color:white; width:108px" %)**2**|(% style="background-color:#4f81bd; color:white; width:40px" %)**2**|(% style="background-color:#4f81bd; color:white; width:110px" %)**1**|(% style="background-color:#4f81bd; color:white; width:140px" %)**2**|(% style="background-color:#4f81bd; color:white; width:40px" %)**2**
88 |Value|BAT|(% style="width:196px" %)(((
89 Temperature(DS18B20)(PC13)
90 )))|(% style="width:87px" %)(((
91 ADC(PA4)
92 )))|(% style="width:189px" %)(((
93 Digital in(PB15) & Digital Interrupt(PA8)
94 )))|(% style="width:208px" %)(((
95 Distance measure by: 1) LIDAR-Lite V3HP
96 Or 2) Ultrasonic Sensor
97 )))|(% style="width:117px" %)Reserved
98
99 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656324539647-568.png?rev=1.1||alt="1656324539647-568.png"]]
100
101 (% style="color:blue" %)**Connection of LIDAR-Lite V3HP:**
102
103 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512173758-5.png?width=712&height=563&rev=1.1||alt="image-20230512173758-5.png"]]
104
105 (% style="color:blue" %)**Connection to Ultrasonic Sensor:**
106
107 (% style="color:red" %)**Need to remove R1 and R2 resistors to get low power,otherwise there will be 240uA standby current.**
108
109 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512173903-6.png?width=715&height=596&rev=1.1||alt="image-20230512173903-6.png"]]
110
111 For the connection to TF-Mini or TF-Luna , MOD2 payload is as below:
112
113 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
114 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:20px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**1**|(% style="background-color:#4f81bd; color:white; width:50px" %)**2**|(% style="background-color:#4f81bd; color:white; width:120px" %)**2**|(% style="background-color:#4f81bd; color:white; width:77px" %)**2**
115 |Value|BAT|(% style="width:183px" %)(((
116 Temperature(DS18B20)(PC13)
117 )))|(% style="width:173px" %)(((
118 Digital in(PB15) & Digital Interrupt(PA8)
119 )))|(% style="width:84px" %)(((
120 ADC(PA4)
121 )))|(% style="width:323px" %)(((
122 Distance measure by:1)TF-Mini plus LiDAR
123 Or 2) TF-Luna LiDAR
124 )))|(% style="width:188px" %)Distance signal  strength
125
126 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656376779088-686.png?rev=1.1||alt="1656376779088-686.png"]]
127
128 **Connection to [[TF-Mini plus>>url:http://en.benewake.com/product/detail/5c345cd0e5b3a844c472329b.html]] LiDAR(UART version):**
129
130 (% style="color:red" %)**Need to remove R3 and R4 resistors to get low power,otherwise there will be 400uA standby current**[[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512180609-7.png?width=802&height=555&rev=1.1||alt="image-20230512180609-7.png"]]
131
132 **Connection to [[TF-Luna>>url:http://en.benewake.com/product/detail/5e1c1fd04d839408076b6255.html]] LiDAR (UART version):**
133
134 (% style="color:red" %)**Need to remove R3 and R4 resistors to get low power,otherwise there will be 400uA standby current**
135
136 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230610170047-1.png?width=799&height=452&rev=1.1||alt="image-20230610170047-1.png"]]
137
138
139 === 2.1.3 MOD~=3 (3 ADC + I2C) ===
140
141
142 This mode has total 12 bytes. Include 3 x ADC + 1x I2C
143
144 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
145 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)(((
146 **Size(bytes)**
147 )))|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 110px;background-color:#4F81BD;color:white" %)2|=(% style="width: 97px;background-color:#4F81BD;color:white" %)2|=(% style="width: 20px;background-color:#4F81BD;color:white" %)1
148 |Value|(% style="width:68px" %)(((
149 ADC1(PA4)
150 )))|(% style="width:75px" %)(((
151 ADC2(PA5)
152 )))|(((
153 ADC3(PA8)
154 )))|(((
155 Digital Interrupt(PB15)
156 )))|(% style="width:304px" %)(((
157 Temperature(SHT20 or SHT31 or BH1750 Illumination Sensor)
158 )))|(% style="width:163px" %)(((
159 Humidity(SHT20 or SHT31)
160 )))|(% style="width:53px" %)Bat
161
162 === 2.1.4 MOD~=4 (3 x DS18B20) ===
163
164
165 This mode has total 11 bytes. As shown below:
166
167 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
168 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:20px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**2**|(% style="background-color:#4f81bd; color:white; width:50px" %)**2**|(% style="background-color:#4f81bd; color:white; width:99px" %)**1**|(% style="background-color:#4f81bd; color:white; width:99px" %)**2**|(% style="background-color:#4f81bd; color:white; width:99px" %)**2**
169 |Value|BAT|(% style="width:186px" %)(((
170 Temperature1(DS18B20)(PC13)
171 )))|(% style="width:82px" %)(((
172 ADC(PA4)
173 )))|(% style="width:210px" %)(((
174 Digital in(PB15) & Digital Interrupt(PA8) 
175 )))|(% style="width:191px" %)Temperature2(DS18B20)
176 (PB9)|(% style="width:183px" %)Temperature3(DS18B20)(PB8)
177
178 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656377606181-607.png?rev=1.1||alt="1656377606181-607.png"]]
179
180 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230513134006-1.png?width=736&height=559&rev=1.1||alt="image-20230513134006-1.png"]]
181
182
183 === 2.1.5 MOD~=5 (Weight Measurement by HX711) ===
184
185
186 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512164658-2.png?width=729&height=532&rev=1.1||alt="image-20230512164658-2.png"]]
187
188 Each HX711 need to be calibrated before used. User need to do below two steps:
189
190 1. Zero calibration. Don't put anything on load cell and run (% style="color:blue" %)**AT+WEIGRE**(%%) to calibrate to Zero gram.
191 1. Adjust calibration factor (default value 400): Put a known weight thing on load cell and run (% style="color:blue" %)**AT+WEIGAP**(%%) to adjust the Calibration Factor.
192 1. (((
193 Weight has 4 bytes, the unit is g.
194
195
196 )))
197
198 For example:
199
200 (% style="color:blue" %)**AT+GETSENSORVALUE =0**
201
202 Response:  Weight is 401 g
203
204 Check the response of this command and adjust the value to match the real value for thing.
205
206 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
207 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)(((
208 **Size(bytes)**
209 )))|=(% style="width: 20px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 150px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 198px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 49px;background-color:#4F81BD;color:white" %)**4**
210 |Value|BAT|(% style="width:193px" %)(((
211 Temperature(DS18B20)(PC13)
212 )))|(% style="width:85px" %)(((
213 ADC(PA4)
214 )))|(% style="width:186px" %)(((
215 Digital in(PB15) & Digital Interrupt(PA8)
216 )))|(% style="width:100px" %)Weight
217
218 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/image-20220820120036-2.png?width=1003&height=469&rev=1.1||alt="image-20220820120036-2.png" height="469" width="1003"]]
219
220
221 === 2.1.6 MOD~=6 (Counting Mode) ===
222
223
224 In this mode, the device will work in counting mode. It counts the interrupt on the interrupt pins and sends the count on TDC time.
225
226 Connection is as below. The PIR sensor is a count sensor, it will generate interrupt when people come close or go away. User can replace the PIR sensor with other counting sensors.
227
228 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512181814-9.png?width=697&height=543&rev=1.1||alt="image-20230512181814-9.png"]]
229
230 (% style="color:red" %)**Note:** **LoRaWAN wireless transmission will infect the PIR sensor. Which cause the counting value increase +1 for every uplink. User can change PIR sensor or put sensor away of the SN50_v3 to avoid this happen.**
231
232 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
233 |=(% style="width: 60px;background-color:#4F81BD;color:white" %)**Size(bytes)**|=(% style="width: 40px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 180px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 60px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 100px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 77px;background-color:#4F81BD;color:white" %)**4**
234 |Value|BAT|(% style="width:256px" %)(((
235 Temperature(DS18B20)(PC13)
236 )))|(% style="width:108px" %)(((
237 ADC(PA4)
238 )))|(% style="width:126px" %)(((
239 Digital in(PB15)
240 )))|(% style="width:145px" %)(((
241 Count(PA8)
242 )))
243
244 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656378441509-171.png?rev=1.1||alt="1656378441509-171.png"]]
245
246
247 === 2.1.7 MOD~=7 (Three interrupt contact modes) ===
248
249
250 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
251 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)(((
252 **Size(bytes)**
253 )))|=(% style="width: 20px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 89px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 89px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 89px;background-color:#4F81BD;color:white" %)1|=(% style="width: 40px;background-color:#4F81BD;color:white" %)2
254 |Value|BAT|(% style="width:188px" %)(((
255 Temperature(DS18B20)
256 (PC13)
257 )))|(% style="width:83px" %)(((
258 ADC(PA5)
259 )))|(% style="width:184px" %)(((
260 Digital Interrupt1(PA8)
261 )))|(% style="width:186px" %)Digital Interrupt2(PA4)|(% style="width:197px" %)Digital Interrupt3(PB15)|(% style="width:100px" %)Reserved
262
263 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230513111203-7.png?width=975&height=324&rev=1.1||alt="image-20230513111203-7.png"]]
264
265
266 === 2.1.8 MOD~=8 (3ADC+1DS18B20) ===
267
268
269 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
270 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)(((
271 **Size(bytes)**
272 )))|=(% style="width: 30px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 110px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 70px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 119px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 69px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 69px;background-color:#4F81BD;color:white" %)2
273 |Value|BAT|(% style="width:207px" %)(((
274 Temperature(DS18B20)
275 (PC13)
276 )))|(% style="width:94px" %)(((
277 ADC1(PA4)
278 )))|(% style="width:198px" %)(((
279 Digital Interrupt(PB15)
280 )))|(% style="width:84px" %)(((
281 ADC2(PA5)
282 )))|(% style="width:82px" %)(((
283 ADC3(PA8)
284 )))
285
286 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230513111231-8.png?width=900&height=335&rev=1.1||alt="image-20230513111231-8.png"]]
287
288
289 === 2.1.9 MOD~=9 (3DS18B20+ two Interrupt count mode) ===
290
291
292 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
293 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)(((
294 **Size(bytes)**
295 )))|=(% style="width: 20px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 60px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 89px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 59px;background-color:#4F81BD;color:white" %)4|=(% style="width: 59px;background-color:#4F81BD;color:white" %)4
296 |Value|BAT|(((
297 Temperature
298 (DS18B20)(PC13)
299 )))|(((
300 Temperature2
301 (DS18B20)(PB9)
302 )))|(((
303 Digital Interrupt
304 (PB15)
305 )))|(% style="width:193px" %)(((
306 Temperature3
307 (DS18B20)(PB8)
308 )))|(% style="width:78px" %)(((
309 Count1(PA8)
310 )))|(% style="width:78px" %)(((
311 Count2(PA4)
312 )))
313
314 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230513111255-9.png?width=899&height=341&rev=1.1||alt="image-20230513111255-9.png"]]
315
316 (% style="color:blue" %)**The newly added AT command is issued correspondingly:**
317
318 (% style="color:#037691" %)** AT+INTMOD1 PA8**(%%)  pin:  Corresponding downlink:  (% style="color:#037691" %)**06 00 00 xx**
319
320 (% style="color:#037691" %)** AT+INTMOD2 PA4**(%%)  pin:  Corresponding downlink: (% style="color:#037691" %)**06 00 01 xx**
321
322 (% style="color:#037691" %)** AT+INTMOD3 PB15**(%%)  pin:  Corresponding downlink:  (% style="color:#037691" %)** 06 00 02 xx**
323
324
325 (% style="color:blue" %)**AT+SETCNT=aa,bb** 
326
327 When AA is 1, set the count of PA8 pin to BB Corresponding downlink:09 01 bb bb bb bb
328
329 When AA is 2, set the count of PA4 pin to BB Corresponding downlink:09 02 bb bb bb bb
330
331
332 === 2.1.10 MOD~=10 (PWM input capture and output mode,Since firmware v1.2) ===
333
334
335 (% style="color:red" %)**Note: Firmware not release, contact Dragino for testing.**
336
337 In this mode, the uplink can perform PWM input capture, and the downlink can perform PWM output.
338
339 [[It should be noted when using PWM mode.>>||anchor="H2.3.3.12A0PWMMOD"]]
340
341
342 ==== 2.1.10.1 Uplink, PWM input capture ====
343
344
345 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817172209-2.png?width=683&height=439&rev=1.1||alt="image-20230817172209-2.png"]]
346
347 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:515px" %)
348 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:20px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**2**|(% style="background-color:#4f81bd; color:white; width:50px" %)**2**|(% style="background-color:#4f81bd; color:white; width:135px" %)**1**|(% style="background-color:#4f81bd; color:white; width:70px" %)**2**|(% style="background-color:#4f81bd; color:white; width:90px" %)**2**
349 |Value|Bat|(% style="width:191px" %)(((
350 Temperature(DS18B20)(PC13)
351 )))|(% style="width:78px" %)(((
352 ADC(PA4)
353 )))|(% style="width:135px" %)(((
354 PWM_Setting
355 &Digital Interrupt(PA8)
356 )))|(% style="width:70px" %)(((
357 Pulse period
358 )))|(% style="width:89px" %)(((
359 Duration of high level
360 )))
361
362 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817170702-1.png?width=1044&height=161&rev=1.1||alt="image-20230817170702-1.png"]]
363
364 When the device detects the following PWM signal ,decoder will converts the pulse period and high-level duration to frequency and duty cycle.
365
366 **Frequency:**
367
368 (% class="MsoNormal" %)
369 (% lang="EN-US" %)If (% style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial; color:blue; font-family:Arial,sans-serif" %)**AT+PWMSET**(%%)**=0, **(% lang="EN-US" %)Frequency= 1000000/(%%)Pulse period(HZ);
370
371 (% class="MsoNormal" %)
372 (% lang="EN-US" %)If (% style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial; color:blue; font-family:Arial,sans-serif" %)**AT+PWMSET**(%%)**=1, **(% lang="EN-US" %)Frequency= 1000/(%%)Pulse period(HZ);
373
374
375 (% class="MsoNormal" %)
376 **Duty cycle:**
377
378 Duty cycle= Duration of high level/ Pulse period*100 ~(%).
379
380 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230818092200-1.png?width=627&height=344&rev=1.1||alt="image-20230818092200-1.png"]]
381
382
383 ==== 2.1.10.2 Uplink, PWM output ====
384
385 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817172209-2.png?width=683&height=439&rev=1.1||alt="image-20230817172209-2.png"]]
386
387 (% style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial; color:blue; font-family:Arial,sans-serif" %)**AT+PWMOUT=a,b,c**
388
389 a is the time delay of the output, the unit is ms.
390
391 b is the output frequency, the unit is HZ.
392
393 c is the duty cycle of the output, the unit is %.
394
395 (% style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial; color:blue; font-family:Arial,sans-serif" %)**Downlink**(%%):  (% style="color:#037691" %)**0B 01 bb cc aa **
396
397 aa is the time delay of the output, the unit is ms.
398
399 bb is the output frequency, the unit is HZ.
400
401 cc is the duty cycle of the output, the unit is %.
402
403
404 For example, send a AT command: AT+PWMOUT=65535,1000,50  The PWM is always out, the frequency is 1000HZ, and the duty cycle is 50.
405
406 The oscilloscope displays as follows:
407
408 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817172209-2.png?width=683&height=439&rev=1.1||alt="image-20230817172209-2.png"]]
409
410
411 ==== 2.1.10.3 Downlink, PWM output ====
412
413 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817173800-3.png?width=685&height=412&rev=1.1||alt="image-20230817173800-3.png"]]
414
415 Downlink:  (% style="color:#037691" %)**0B xx xx xx yy zz zz**
416
417 xx xx xx is the output frequency, the unit is HZ.
418
419 yy is the duty cycle of the output, the unit is %.
420
421 zz zz is the time delay of the output, the unit is ms.
422
423
424 For example, send a downlink command: 0B 00 61 A8 32 13 88, the frequency is 25KHZ, the duty cycle is 50, and the output time is 5 seconds.
425
426 The oscilloscope displays as follows:
427
428 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817173858-5.png?width=843&height=634&rev=1.1||alt="image-20230817173858-5.png"]]
429
430
431 === 2.1.11 MOD~=11 (TEMP117) ===
432
433
434 In this mode, uplink payload includes in total 11 bytes. Uplink packets use FPORT=2.
435
436 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
437 |(% style="background-color:#4f81bd; color:white; width:50px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:20px" %)**2**|(% style="background-color:#4f81bd; color:white; width:100px" %)**2**|(% style="background-color:#4f81bd; color:white; width:50px" %)**2**|(% style="background-color:#4f81bd; color:white; width:90px" %)**1**|(% style="background-color:#4f81bd; color:white; width:128px" %)**2**|(% style="background-color:#4f81bd; color:white; width:79px" %)**2**
438 |Value|Bat|(% style="width:191px" %)(((
439 Temperature(DS18B20)(PC13)
440 )))|(% style="width:78px" %)(((
441 ADC(PA4)
442 )))|(% style="width:216px" %)(((
443 Digital in(PB15)&Digital Interrupt(PA8)
444 )))|(% style="width:308px" %)(((
445 Temperature
446
447 (TEMP117)
448 )))|(% style="width:154px" %)(((
449 Reserved position, meaningless
450
451 (0x0000)
452 )))
453
454 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20240717113113-1.png?width=793&height=352&rev=1.1||alt="image-20240717113113-1.png"]]
455
456 Connection:
457
458 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20240717141528-2.jpeg?width=654&height=430&rev=1.1||alt="image-20240717141528-2.jpeg"]]
459
460
461 === 2.1.12 MOD~=12 (Count+SHT31) ===
462
463
464 This mode has total 11 bytes. As shown below:
465
466 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:517px" %)
467 |=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**Size(bytes)**|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**2**|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**2**|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**2**|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**1**|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**4**
468 |Value|BAT|(% style="width:86px" %)(((
469 Temperature_SHT31
470 )))|(% style="width:86px" %)(((
471 Humidity_SHT31
472 )))|(% style="width:86px" %)(((
473 Digital in(PB15)
474 )))|(% style="width:86px" %)(((
475 Count(PA8)
476 )))
477
478 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20240717150948-5.png?width=979&height=389&rev=1.1||alt="image-20240717150948-5.png"]]
479
480 Wiring example:
481
482 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20240717152224-6.jpeg?width=680&height=359&rev=1.1||alt="image-20240717152224-6.jpeg"]]
483
484
485 == 2.2 ​Decode payload ==
486
487
488 While using TTN V3 network, you can add the payload format to decode the payload.
489
490 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656378466788-734.png?rev=1.1||alt="1656378466788-734.png"]]
491
492 The payload decoder function for TTN V3 are here:
493
494 The payload decoder function for TTN V3 are here:
495
496 SN50v3-LB/LS TTN V3 Payload Decoder:  [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>url:https://github.com/dragino/dragino-end-node-decoder]]
497
498
499 === 2.2.1 Battery Info ===
500
501
502 Check the battery voltage for SN50v3-LB/LS.
503
504 Ex1: 0x0B45 = 2885mV
505
506 Ex2: 0x0B49 = 2889mV
507
508
509 === 2.2.2 Temperature (DS18B20) ===
510
511
512 If there is a DS18B20 connected to PC13 pin. The temperature will be uploaded in the payload.
513
514 More DS18B20 can check the [[3 DS18B20 mode>>||anchor="H2.3.2.4MOD3D4283xDS18B2029"]]
515
516 (% style="color:blue" %)**Connection:**
517
518 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512180718-8.png?width=647&height=538&rev=1.1||alt="image-20230512180718-8.png"]]
519
520 (% style="color:blue" %)**Example**:
521
522 If payload is: 0105H:  (0105 & 8000 == 0), temp = 0105H /10 = 26.1 degree
523
524 If payload is: FF3FH :  (FF3F & 8000 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
525
526 (FF3F & 8000:Judge whether the highest bit is 1, when the highest bit is 1, it is negative)
527
528
529 === 2.2.3 Digital Input ===
530
531
532 The digital input for pin PB15,
533
534 * When PB15 is high, the bit 1 of payload byte 6 is 1.
535 * When PB15 is low, the bit 1 of payload byte 6 is 0.
536
537 (% class="wikigeneratedid" id="H2.3.3.4A0AnalogueDigitalConverter28ADC29" %)
538 (((
539 When the digital interrupt pin is set to AT+INTMODx=0, this pin is used as a digital input pin.
540
541 (% style="color:red" %)**Note: The maximum voltage input supports 3.6V.**
542
543
544 )))
545
546 === 2.2.4 Analogue Digital Converter (ADC) ===
547
548
549 The measuring range of the ADC is only about 0.1V to 1.1V The voltage resolution is about 0.24mv.
550
551 When the measured output voltage of the sensor is not within the range of 0.1V and 1.1V, the output voltage terminal of the sensor shall be divided The example in the following figure is to reduce the output voltage of the sensor by three times If it is necessary to reduce more times, calculate according to the formula in the figure and connect the corresponding resistance in series.
552
553 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LHT65N%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20Manual/WebHome/image-20220628150112-1.png?width=285&height=241&rev=1.1||alt="image-20220628150112-1.png" height="241" width="285"]]
554
555 (% style="color:red" %)**Note: If the ADC type sensor needs to be powered by SN50_v3, it is recommended to use +5V to control its switch.Only sensors with low power consumption can be powered with VDD.**
556
557
558 The position of PA5 on the hardware after **LSN50 v3.3** is changed to the position shown in the figure below, and the collected voltage becomes one-sixth of the original.
559
560 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230811113449-1.png?width=608&height=370&rev=1.1||alt="image-20230811113449-1.png"]]
561
562
563 === 2.2.5 Digital Interrupt ===
564
565
566 Digital Interrupt refers to pin PA8, and there are different trigger methods. When there is a trigger, the SN50v3-LB/LS will send a packet to the server.
567
568 (% style="color:blue" %)** Interrupt connection method:**
569
570 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230513105351-5.png?width=485&height=147&rev=1.1||alt="image-20230513105351-5.png"]]
571
572 (% style="color:blue" %)**Example to use with door sensor :**
573
574 The door sensor is shown at right. It is a two wire magnetic contact switch used for detecting the open/close status of doors or windows.
575
576 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656379210849-860.png?rev=1.1||alt="1656379210849-860.png"]]
577
578 When the two pieces are close to each other, the 2 wire output will be short or open (depending on the type), while if the two pieces are away from each other, the 2 wire output will be the opposite status. So we can use SN50v3-LB/LS interrupt interface to detect the status for the door or window.
579
580
581 (% style="color:blue" %)**Below is the installation example:**
582
583 Fix one piece of the magnetic sensor to the door and connect the two pins to SN50v3-LB/LS as follows:
584
585 * (((
586 One pin to SN50v3-LB/LS's PA8 pin
587 )))
588 * (((
589 The other pin to SN50v3-LB/LS's VDD pin
590 )))
591
592 Install the other piece to the door. Find a place where the two pieces will be close to each other when the door is closed. For this particular magnetic sensor, when the door is closed, the output will be short, and PA8 will be at the VCC voltage.
593
594 Door sensors have two types: (% style="color:blue" %)** NC (Normal close)**(%%) and (% style="color:blue" %)**NO (normal open)**(%%). The connection for both type sensors are the same. But the decoding for payload are reverse, user need to modify this in the IoT Server decoder.
595
596 When door sensor is shorted, there will extra power consumption in the circuit, the extra current is 3v3/R14 = 3v3/1Mohm = 3uA which can be ignored.
597
598 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656379283019-229.png?rev=1.1||alt="1656379283019-229.png"]]
599
600 The above photos shows the two parts of the magnetic switch fitted to a door.
601
602 The software by default uses the falling edge on the signal line as an interrupt. We need to modify it to accept both the rising edge (0v ~-~-> VCC , door close) and the falling edge (VCC ~-~-> 0v , door open) as the interrupt.
603
604 The command is:
605
606 (% style="color:blue" %)**AT+INTMOD1=1   ** (%%) ~/~/  (more info about INMOD please refer** **[[**AT Command Manual**>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/&file=DRAGINO_LSN50_AT_Commands_v1.5.1.pdf]]**. **)
607
608 Below shows some screen captures in TTN V3:
609
610 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656379339508-835.png?rev=1.1||alt="1656379339508-835.png"]]
611
612 In **MOD=1**, user can use byte 6 to see the status for door open or close. TTN V3 decoder is as below:
613
614 door= (bytes[6] & 0x80)? "CLOSE":"OPEN";
615
616
617 === 2.2.6 I2C Interface (SHT20 & SHT31) ===
618
619
620 The SDA and SCK are I2C interface lines. You can use these to connect to an I2C device and get the sensor data.
621
622 We have made an example to show how to use the I2C interface to connect to the SHT20/ SHT31 Temperature and Humidity Sensor.
623
624 (% style="color:red" %)**Notice: Different I2C sensors have different I2C commands set and initiate process, if user want to use other I2C sensors, User need to re-write the source code to support those sensors. SHT20/ SHT31 code in SN50v3-LB/LS will be a good reference.**
625
626
627 Below is the connection to SHT20/ SHT31. The connection is as below:
628
629 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230610170152-2.png?width=846&height=501&rev=1.1||alt="image-20230610170152-2.png"]]
630
631 The device will be able to get the I2C sensor data now and upload to IoT Server.
632
633 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/1656379664142-345.png?rev=1.1||alt="1656379664142-345.png"]]
634
635 Convert the read byte to decimal and divide it by ten.
636
637 **Example:**
638
639 Temperature:  Read:0116(H) = 278(D)  Value:  278 /10=27.8℃;
640
641 Humidity:    Read:0248(H)=584(D)  Value:  584 / 10=58.4, So 58.4%
642
643 If you want to use other I2C device, please refer the SHT20 part source code as reference.
644
645
646 === 2.2.7 Distance Reading ===
647
648
649 Refer [[Ultrasonic Sensor section>>||anchor="H2.3.3.8UltrasonicSensor"]].
650
651
652 === 2.2.8 Ultrasonic Sensor ===
653
654
655 This Fundamental Principles of this sensor can be found at this link: [[https:~~/~~/wiki.dfrobot.com/Weather_-_proof_Ultrasonic_Sensor_with_Separate_Probe_SKU~~_~~__SEN0208>>url:https://wiki.dfrobot.com/Weather_-_proof_Ultrasonic_Sensor_with_Separate_Probe_SKU___SEN0208]]
656
657 The SN50v3-LB/LS detects the pulse width of the sensor and converts it to mm output. The accuracy will be within 1 centimeter. The usable range (the distance between the ultrasonic probe and the measured object) is between 24cm and 600cm.
658
659 The working principle of this sensor is similar to the (% style="color:blue" %)**HC-SR04**(%%) ultrasonic sensor.
660
661 The picture below shows the connection:
662
663 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512173903-6.png?width=715&height=596&rev=1.1||alt="image-20230512173903-6.png"]]
664
665 Connect to the SN50v3-LB/LS and run (% style="color:blue" %)**AT+MOD=2**(%%) to switch to ultrasonic mode (ULT).
666
667 The ultrasonic sensor uses the 8^^th^^ and 9^^th^^ byte for the measurement value.
668
669 **Example:**
670
671 Distance:  Read: 0C2D(Hex) = 3117(D)  Value:  3117 mm=311.7 cm
672
673
674 === 2.2.9 Battery Output - BAT pin ===
675
676
677 The BAT pin of SN50v3-LB/LS is connected to the Battery directly. If users want to use BAT pin to power an external sensor. User need to make sure the external sensor is of low power consumption. Because the BAT pin is always open. If the external sensor is of high power consumption. the battery of SN50v3-LB/LS will run out very soon.
678
679
680 === 2.2.10 +5V Output ===
681
682
683 SN50v3-LB/LS will enable +5V output before all sampling and disable the +5v after all sampling. 
684
685 The 5V output time can be controlled by AT Command.
686
687 (% style="color:blue" %)**AT+5VT=1000**
688
689 Means set 5V valid time to have 1000ms. So the real 5V output will actually have 1000ms + sampling time for other sensors.
690
691 By default the **AT+5VT=500**. If the external sensor which require 5v and require more time to get stable state, user can use this command to increase the power ON duration for this sensor.
692
693
694 === 2.2.11 BH1750 Illumination Sensor ===
695
696
697 MOD=1 support this sensor. The sensor value is in the 8^^th^^ and 9^^th^^ bytes.
698
699 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230512172447-4.png?width=712&height=416&rev=1.1||alt="image-20230512172447-4.png"]]
700
701 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50%20%26%20LSN50-V2%20-%20LoRaWAN%20Sensor%20Node%20User%20Manual/WebHome/image-20220628110012-12.png?rev=1.1||alt="image-20220628110012-12.png" height="361" width="953"]]
702
703
704 === 2.2.12 PWM MOD ===
705
706
707 * (((
708 The maximum voltage that the SDA pin of SN50v3 can withstand is 3.6V, and it cannot exceed this voltage value, otherwise the chip may be burned.
709 )))
710 * (((
711 If the PWM pin connected to the SDA pin cannot maintain a high level when it is not working, you need to remove the resistor R2 or replace it with a resistor with a larger resistance, otherwise a sleep current of about 360uA will be generated. The position of the resistor is shown in the figure below:
712 )))
713
714 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SN50v3-LB/WebHome/image-20230817183249-3.png?width=417&height=320&rev=1.1||alt="image-20230817183249-3.png"]]
715
716 * (((
717 The signal captured by the input should preferably be processed by hardware filtering and then connected in. The software processing method is to capture four values, discard the first captured value, and then take the middle value of the second, third, and fourth captured values.
718 )))
719 * (((
720 Since the device can only detect a pulse period of 50ms when [[AT+PWMSET=0>>||anchor="H3.3.8PWMsetting"]] (counting in microseconds), it is necessary to change the value of PWMSET according to the frequency of input capture.
721 )))
722 * (((
723 PWM Input allows low power consumption. PWM Output to achieve real-time control, you need to go to class C. Power consumption will not be low.
724
725 For PWM Output Feature, there are two consideration to see if the device can be powered by battery or have to be powered by external DC.
726
727 a) If real-time control output is required, the SN50v3-LB/LS is already operating in class C and an external power supply must be used.
728
729 b) If the output duration is more than 30 seconds, better to use external power source. 
730
731
732 )))
733
734 === 2.2.13 Working MOD ===
735
736
737 The working MOD info is contained in the Digital in & Digital Interrupt byte (7^^th^^ Byte).
738
739 User can use the 3^^rd^^ ~~ 7^^th^^  bit of this byte to see the working mod:
740
741 Case 7^^th^^ Byte >> 2 & 0x1f:
742
743 * 0: MOD1
744 * 1: MOD2
745 * 2: MOD3
746 * 3: MOD4
747 * 4: MOD5
748 * 5: MOD6
749 * 6: MOD7
750 * 7: MOD8
751 * 8: MOD9
752 * 9: MOD10
753
754
755
756 = 3. PS-LB-NA connects to third-party sensors =
757
758
759 PS-LB-NA might connect to different kind of probes, 4~~20mA represent the full scale of the measuring range. So a 12mA output means different meaning for different probe. 
760
761
762 **For example.**
763
764 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:500px" %)
765 |(% style="background-color:#4f81bd; color:white; width:150px" %)**Probe Type**|(% style="background-color:#4f81bd; color:white; width:150px" %)**4~~20mA scale for this probe**|(% style="background-color:#4f81bd; color:white; width:200px" %)**Example: 12mA actually meaning for this probe**
766 |(% style="background-color:#f2f2f2; width:206px" %)PH Combination Electrodes|(% style="background-color:#f2f2f2; width:222px" %)0 ~~ 14 pH|(% style="background-color:#f2f2f2; width:356px" %)PH Value: 7
767 |(% style="background-color:#f2f2f2; width:206px" %)Water Pressure Sensor|(% style="background-color:#f2f2f2; width:222px" %)0~~5 meters|(% style="background-color:#f2f2f2; width:356px" %)2.5 meters pure water
768 |(% style="background-color:#f2f2f2; width:206px" %)Pressure transmitter probe|(% style="background-color:#f2f2f2; width:222px" %)0~~1MPa|(% style="background-color:#f2f2f2; width:356px" %)0.5MPa air / gas or water pressure
769
770 User can set different probe model for above probes. So IoT server is able to se identical how it should parse the 4~~20mA or 0~~30v sensor value and get the correct value.
771
772
773 == 3.1 0~~20mA value (IDC_IN) ==
774
775
776 (% style="color:#037691" %)**Payload Example**:
777
778 27AE(H) = 10158 (D)/1000 = 10.158mA.
779
780
781 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-LB-NA--LoRaWAN_Analog_Sensor_User_Manual/WebHome/image-20230821150704-1.png?width=609&height=180&rev=1.1||alt="image-20230821150704-1.png"]]
782
783 **Connect to a 2 wire 4~~20mA sensor.**
784
785 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-LB-NA--LoRaWAN_Analog_Sensor_User_Manual/WebHome/image-20230225154759-1.png?width=741&height=408&rev=1.1||alt="image-20230225154759-1.png"]]
786
787
788 == 3.2 0~~30V value ( pin VDC_IN) ==
789
790
791 Measure the voltage value. The range is 0 to 30V.
792
793 (% style="color:#037691" %)**Example**:
794
795 138E(H) = 5006(D)/1000= 5.006V
796
797
798 == 3.3 IN1&IN2&INT pin ==
799
800
801 IN1 and IN2 are used as digital input pins.
802
803 (% style="color:#037691" %)**Example**:
804
805 09 (H): (0x09&0x08)>>3=1    IN1 pin is high level.
806
807 09 (H): (0x09&0x04)>>2=0    IN2 pin is low level.
808
809
810 This data field shows if this packet is generated by (% style="color:blue" %)**Interrupt Pin** (%%)or not. [[Click here>>||anchor="H3.3.2SetInterruptMode"]] for the hardware and software set up. Note: The Internet Pin is a separate pin in the screw terminal.
811
812 (% style="color:#037691" %)**Example:**
813
814 09 (H): (0x09&0x02)>>1=1    The level of the interrupt pin.
815
816 09 (H): 0x09&0x01=1              0x00: Normal uplink packet.
817
818 0x01: Interrupt Uplink Packet.
819
820
821 == 3.4 Sensor value, FPORT~=7 ==
822
823
824 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:504px" %)
825 |(% style="background-color:#4f81bd; color:white; width:94px" %)(((
826 **Size(bytes)**
827 )))|(% style="background-color:#4f81bd; color:white; width:43px" %)**2**|(% style="background-color:#4f81bd; color:white; width:367px" %)**n**
828 |(% style="background-color:#f2f2f2; width:94px" %)Value|(% style="background-color:#f2f2f2; width:43px" %)[[BAT>>||anchor="H2.3.3BatteryInfo"]]|(% style="background-color:#f2f2f2; width:367px" %)(((
829 Voltage value, each 2 bytes is a set of voltage values.
830 )))
831
832 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-LB-NA--LoRaWAN_Analog_Sensor_User_Manual/WebHome/image-20230220171300-1.png?width=863&height=207&rev=1.1||alt="image-20230220171300-1.png"]]
833
834 Multiple sets of data collected are displayed in this form:
835
836 [voltage value1], [voltage value2], [voltage value3],…[voltage value n/2]
837
838
839 == 3.5 ​Decode payload in The Things Network ==
840
841
842 While using TTN network, you can add the payload format to decode the payload.
843
844
845 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-LB-NA--LoRaWAN_Analog_Sensor_User_Manual/WebHome/1675144839454-913.png?rev=1.1||alt="1675144839454-913.png"]]
846
847
848 PS-LB-NA TTN Payload Decoder: [[https:~~/~~/github.com/dragino/dragino-end-node-decode>>url:https://github.com/dragino/dragino-end-node-decoder]]
849
850
851 = 4. Differences between three different motherboards =
852
853
854 [[image:image-20240924102931-1.png||height="365" width="1210"]]
855
856