Wiki source code of Water Quality Sensors

Version 16.3 by Karry Zhuang on 2024/07/18 18:57

Show last authors
1 **Table of Contents:**
2
3 {{toc/}}
4
5
6 = 1. DR-ECK Water EC Probe =
7
8 == 1.1 Specification: ==
9
10 * **Power Input**: DC7~~30
11 * **Power Consumption** : < 0.5W
12 * **Interface**: RS485. 9600 Baud Rate
13 * **EC Range & Resolution:**
14 ** **ECK0.01** : 0.02 ~~ 20 μS/cm
15 ** **ECK0.1**: 0.2 ~~ 200.0 μS/cm
16 ** **ECK1.0** : 2 ~~ 2,000 μS/cm  Resolution: 1 μS/cm
17 ** **ECK10.0** : 20 ~~ 20,000 μS/cm  Resolution: 10 μS/cm
18 * **EC Accuracy**: ±1% FS
19 * **Temperature Measure Range**: -20 ~~ 60 °C
20 * **Temperature Accuracy: **±0.5 °C
21 * **IP Rated**: IP68
22 * **Max Pressure**: 0.6MPa
23
24 == 1.2 Application for Different Range ==
25
26 [[image:image-20240714173018-1.png]]
27
28
29 == 1.3 Wiring ==
30
31
32 == 1.4 Mechinical Drawing ==
33
34 [[image:image-20240714174241-2.png]]
35
36
37 == 1.5 Installation ==
38
39
40 Do not power on while connect the cables. Double check the wiring before power on.
41
42 Installation Photo as reference:
43
44 **~ Submerged installation:**
45
46 The lead wire of the equipment passes through the waterproof pipe, and the 3/4 thread on the top of the equipment is connected to the 3/4 thread of the waterproof pipe with raw tape. Ensure that the top of the equipment and the equipment wire are not flooded.
47
48 [[image:image-20240715181933-4.png||height="281" width="258"]]
49
50 **~ Pipeline installation:**
51
52 Connect the equipment to the pipeline through the 3/4 thread.
53
54 [[image:image-20240715182122-6.png||height="291" width="408"]]
55
56 **Sampling:**
57
58 Take representative water samples according to sampling requirements. If it is inconvenient to take samples, you can also put the electrode into the solution to be tested and read the output data. After a period of time, take out the electrode and clean it.
59
60 **Measure the pH of the water sample:**
61
62 First rinse the electrode with distilled water, then rinse it with the water sample, then immerse the electrode in the sample, carefully shake the test cup or stir it to accelerate the electrode balance, let it stand, and record the pH value when the reading is stable.
63
64
65 == 1.6 Maintain ==
66
67
68 * The equipment itself generally does not require daily maintenance. When an obvious fault occurs, please do not open it and repair it yourself. Contact us as soon as possible!
69 * There is an appropriate amount of soaking solution in the protective bottle at the front end of the electrode. The electrode head is soaked in it to keep the glass bulb and the liquid junction activated. When measuring, loosen the bottle cap, pull out the electrode, and rinse it with pure water before use.
70 * Preparation of electrode soaking solution: Take a packet of PH4.00 buffer, dissolve it in 250 ml of pure water, and soak it in 3M potassium chloride solution. The preparation is as follows: Take 25 grams of analytical pure potassium chloride and dissolve it in 100 ml of pure water.
71 * The glass bulb at the front end of the electrode cannot come into contact with hard objects. Any damage and scratches will make the electrode ineffective.
72 * Before measurement, the bubbles in the electrode glass bulb should be shaken off, otherwise it will affect the measurement. When measuring, the electrode should be stirred in the measured solution and then placed still to accelerate the response.
73 * The electrode should be cleaned with deionized water before and after measurement to ensure accuracy.
74 * After long-term use, the pH electrode will become passivated, which is characterized by a decrease in sensitivity gradient, slow response, and inaccurate readings. At this time, the bulb at the bottom of the electrode can be soaked in 0.1M dilute hydrochloric acid for 24 hours (0.1M dilute hydrochloric acid preparation: 9 ml of hydrochloric acid is diluted to 1000 ml with distilled water), and then soaked in 3.3M potassium chloride solution for 24 hours. If the pH electrode is seriously passivated and soaking in 0.1M hydrochloric acid has no effect, the pH electrode bulb can be soaked in 4% HF (hydrofluoric acid) for 3-5 seconds, washed with pure water, and then soaked in 3.3M potassium chloride solution for 24 hours to restore its performance.
75 * Glass bulb contamination or liquid junction blockage can also cause electrode passivation. At this time, it should be cleaned with an appropriate solution according to the nature of the contaminant.
76 * (((
77 The equipment should be calibrated before each use. For long-term use, it is recommended to calibrate once every 3 months. The calibration frequency should be adjusted appropriately according to different application conditions (degree of dirt in the application, deposition of chemical substances, etc.). After aging, the electrodes should be replaced in time.
78 )))
79
80 == 1.7 RS485 Commands ==
81
82
83 RS485 signal (K1 default address 0x12; K10 default address 0x11):
84 Standard Modbus-RTU protocol, baud rate: 9600; check bit: none; data bit: 8; stop bit: 1
85
86
87 === 1.7.1 Query address ===
88
89 send
90
91 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
92 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Original address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
93 |(% style="width:99px" %)0XFE |(% style="width:112px" %)0X03|(% style="width:135px" %)0X00|(% style="width:126px" %)0X50|(% style="width:85px" %)0X00|(% style="width:1px" %)0X00|(% style="width:1px" %)0X51|(% style="width:1px" %)0XD4
94
95 If you forget the original address of the sensor, you can use the broadcast address 0XFE instead. When using 0XFE, the host can only connect to one slave, which can be used as a method of address query.
96
97
98 response
99
100 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:561.333px" %)
101 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)New address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 106px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 93px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 104px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
102 |(% style="width:99px" %)0X1|(% style="width:112px" %)0X3|(% style="width:106px" %)0X00|(% style="width:93px" %)0X20|(% style="width:104px" %)0XF0
103
104 === 1.7.2 Change address ===
105
106 For example: Change the address of the sensor with address 1 to 2, master → slave
107
108 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
109 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Original address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
110 |(% style="width:99px" %)0X01|(% style="width:112px" %)0X06|(% style="width:135px" %)0X00|(% style="width:126px" %)0X50|(% style="width:85px" %)0X00|(% style="width:1px" %)0X02|(% style="width:1px" %)0X08|(% style="width:1px" %)0X1A
111
112 If the sensor receives correctly, the data is returned along the original path.
113 Note: If you forget the original address of the sensor, you can use the broadcast address 0XFE instead. When using 0XFE, the host can only connect to one slave, and the return address is still the original address, which can be used as a method of address query.
114
115
116 === 1.7.3 Modify intercept ===
117
118
119 send
120
121 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
122 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
123 |(% style="width:99px" %)0X01|(% style="width:112px" %)0X06|(% style="width:135px" %)0X00|(% style="width:126px" %)0X23|(% style="width:85px" %)0X00|(% style="width:1px" %)0X01|(% style="width:1px" %)0XFA|(% style="width:1px" %)(((
124 0X97
125 )))
126
127 Change the intercept of the sensor with address 1 to 10 (default 0), which is 0X000A in the command.
128
129 response
130
131 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
132 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
133 |(% style="width:99px" %)0X01|(% style="width:112px" %)0X06|(% style="width:135px" %)(((
134 0X02
135 )))|(% style="width:126px" %)0X00|(% style="width:85px" %)0X00|(% style="width:1px" %)0X0A|(% style="width:1px" %)0X0A|(% style="width:1px" %)(((
136 0XE5
137 )))
138
139
140 === 1.7.4 Query data ===
141
142 The address of the EC K10 sensor is 11
143
144 The query data command is 11 03 00 00 00 02 C6 9B
145
146 For example, the returned data is 11 03 04 (% style="color:red" %)**02 AE**(%%) 01 64 8B D0. 02 AE is converted to decimal 686,  K=10, EC: 6860uS/cm
147
148
149 The address of the EC K1 sensor is 12
150
151 The query data command is 12 03 00 00 00 02 C6 A8
152
153 For example, the returned data is 12 03 04 (% style="color:red" %)**02 AE**(%%) 01 64 B8 D0. 02 AE is converted to decimal 686,  K=1, EC: 686uS/cm
154
155
156 === 1.7.5 Calibration Method ===
157
158
159 This device uses one-point calibration, and you need to prepare a known E standard solution. When mileage K=1, 1~~2000 uses 1413μS/cm standard solution, and when mileage K=10, 10~~20000 uses 12.88mS/cm standard solution.
160
161 The calibration steps are as follows:
162 (1) Place the electrode in distilled water and clean it. When mileage 1~~2000 uses 1413μS/cm standard solution, enter the following calibration command after the data is stable.
163
164 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
165 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 139.083px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Data|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
166 |(% style="width:99px" %)0X12|(% style="width:112px" %)0X10|(% style="width:135px" %)0X00|(% style="width:126px" %)0X26|(% style="width:85px" %)0X00|(% style="width:1px" %)0X02|(% style="width:1px" %)0X04|(% style="width:1px" %)(((
167 0X00
168
169 0X00
170
171 0X37
172
173 0X32
174 )))|(% style="width:1px" %)0XBD|(% style="width:1px" %)0XFC
175
176 1413*10 gives 0X00003732
177
178 response
179
180 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
181 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
182 |(% style="width:99px" %)0X12|(% style="width:112px" %)0X10|(% style="width:135px" %)0X00|(% style="width:126px" %)0X26|(% style="width:85px" %)0X00|(% style="width:1px" %)0X02|(% style="width:1px" %)0XA2|(% style="width:1px" %)0XA0
183
184 (2) Place the electrode in distilled water to clean it. Use 12.88mS/cm standard solution for the range of 10~~20000. After the data is stable, enter the following calibration command
185
186 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
187 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 139.083px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Data|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
188 |(% style="width:99px" %)0X11|(% style="width:112px" %)0X10|(% style="width:135px" %)0X00|(% style="width:126px" %)0X26|(% style="width:85px" %)0X00|(% style="width:1px" %)0X02|(% style="width:1px" %)0X04|(% style="width:1px" %)(((
189 0X00
190
191 0X01
192
193 0XF7
194
195 0X20
196 )))|(% style="width:1px" %)0X33|(% style="width:1px" %)0X75
197
198 12880*10 gives 0X01F720
199
200 response
201
202 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:676.25px" %)
203 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address high|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Quantity high|=(% style="width: 1px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 low|=(% style="width: 50px;background-color:#4F81BD;color:white" %)CRC16 high
204 |(% style="width:99px" %)0X11|(% style="width:112px" %)0X06|(% style="width:135px" %)0X00|(% style="width:126px" %)0X26|(% style="width:85px" %)0X00|(% style="width:1px" %)0X02|(% style="width:1px" %)0XEB|(% style="width:1px" %)0X50
205
206
207
208
209
210 = 2. DR-PH01 Water PH Sensor =
211
212 == 2.7 RS485 Commands ==
213
214
215 The address of the pH  sensor is 10
216
217 The query data command is 10 03 00 00 00 01 87 4B. After the query, 7 bytes will be returned.
218
219 For example, the returned data is 10 03 02 (% style="color:red" %)**02 AE**(%%) C4 9B.
220
221 02 AE is the pH value, which is converted into decimal to get 686, and then two decimal places are added to get the actual value. 02 AE means the current pH value is 6.86.
222
223
224 = 3. DR-ORP1 Water ORP Sensor =
225
226 == 3.7 RS485 Commands ==
227
228
229 The address of the ORP sensor is 13
230
231 The query data command is 13 03 00 00 00 01 87 78
232
233 For example, the returned data is 13 03 02 (% style="color:red" %)**02 AE**(%%) 80 9B.
234
235 02 AE is the ORP value, converted to decimal, the actual value is 686, 02 AE means the current ORP value is 686mV
236
237
238 = 4. DR-DO1 Dissolved Oxygen Sensor =
239
240 == 4.7 RS485 Commands ==
241
242
243 The address of the dissolved oxygen sensor is 14
244
245 The query data command is 14 03 00 14 00 01 C6 CB
246
247 After the query, 7 bytes will be returned. For example, the returned data is 14 03 02 (% style="color:red" %)**03 78**(%%) B5 55. 03 78 is the value of dissolved oxygen.
248
249 Converted to decimal, it is 888. Add two decimal places to get the actual value. 03 78 means the current dissolved oxygen is 8.88mg/L
250
251
252 = 5. DR-TS1 Water Turbidity Sensor =
253
254 == 5.7 RS485 Commands ==
255
256
257 The address of the dissolved oxygen sensor is 15
258
259 The query data command is 15 03 00 00 00 01 87 1E
260
261 For example, the returned data is 15 03 02 (% style="color:red" %)**02 9A**(%%) 09 4C
262
263 02 9A is the turbidity value, converted to decimal, it is 666, and then divided by 10, the actual value is 66.6, 02 9A means the current turbidity value is 66.6 NTU
264
265