You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/tank-level-app-note/content.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -72,22 +72,22 @@ Small Tank (ST) and Big Tank (BT) each have a specific monitoring routine to mon
72
72
73
73
The Opta™ in the Big Tank (BT) performs the following actions:
74
74
75
-
- It activates the pump if its maximum level alarm is triggered; this will cause liquid migration from Big Tank (BT) to Small Tank (ST).
75
+
- It activates the pump if its maximum level alarm is triggered; this will cause liquid migration from Big Tank to Small Tank.
76
76
- It shuts off the system completely, halting any activity on it.
77
-
- It sends the current minimum level state to Small Tank (ST) while also seeking for Small Tank (ST) maximum level state.
77
+
- It sends the current minimum level state to Small Tank while also seeking for Small Tank's maximum level state.
78
78
79
-
The Opta™ in the Small Tank performs the following actions:
79
+
The Opta™ in the Small Tank (ST) performs the following actions:
80
80
81
-
- It manages the gate valve given the Small Tank (ST) level and Big Tank minimum level state.
81
+
- It manages the gate valve given the Small Tank level and Big Tank minimum level state.
82
82
- It sends Small Tank's current maximum level state to Big Tank while seeking Big Tank's minimum level state.
83
83
84
84
In addition to the functionalities explained before, both Opta™ are connected to Arduino IoT Cloud via Wi-Fi. Through Arduino IoT Cloud, both tanks can be monitored and controlled online.
85
85
86
-
### Example Code for Small Tank (ST)
86
+
### Understanding the Small Tank (ST) Code
87
87
88
88
We will highlight the important details of the sketch that makes up part of the Opta™ in charge of the Small Tank. Notice that some of the functions in the code were generated by Arduino IoT Cloud during the dashboard configuration. We will begin with the required libraries.
89
89
90
-
These following headers are required to enable the RS-485 interface, connection with the Arduino IoT Cloud, and the scheduler. The scheduler is used to handle the data exchange over RS-485 interface, while keeping the `loop()` to manage local parameters of the Small Tank.
90
+
These following headers are required to enable the RS-485 interface, connection with the Arduino IoT Cloud, and the scheduler. The scheduler handles the data exchange over RS-485 interface, while keeping the `loop()` to manage local parameters of the Small Tank.
91
91
92
92
```arduino
93
93
#include "thingProperties.h"
@@ -204,15 +204,15 @@ void ST_Param_Share(){
204
204
}
205
205
```
206
206
207
-
It is possible to notice whenever an Opta™ exchanges information with an another Opta™ over RS-485 interface, subsequent structure of code can be observed. In this sketch, it uses a single character to represent a flag state of a certain module to be recognized by receiving device to use this flag as a conditional for designed operations.
207
+
It is possible to notice whenever an Opta™ exchanges information with another Opta™ over RS-485 interface with subsequent code structure. The sketch uses a single character to represent a flag state of a certain module to be recognized by receiving device to use this flag as a conditional for designed operations.
208
208
209
209
```arduino
210
210
RS485.beginTransmission();
211
211
RS485.println('');
212
212
RS485.endTransmission();
213
213
```
214
214
215
-
Thus, when such characters are received and decoded, it can be used to determine whether to activate certain module or if a certain module attached to sender has been activated. In this example, if we receive `V` from the Big Tank Opta™, the Small Tank's valve must be turned off. If it receives the character `1` or `2`, the Small Tank will have the information regarding Big Tank's minimum level. Following simple parser does this task inside the Small Tank's Opta™.
215
+
Thus, when such characters are received and decoded, they can be used to determine whether to activate a certain module or if it has been activated. In this example, if we receive `V` from the Big Tank Opta™, the Small Tank turns off the valve. If it receives the character `1` or `2`, the Small Tank will have the information regarding Big Tank's minimum level. The following simple parser does this task inside the Small Tank's Opta™.
216
216
217
217
```arduino
218
218
uint8_t RS485_parser(){
@@ -330,11 +330,11 @@ void rs485_interface(){
330
330
331
331
We will now continue with Big Tank's Opta™ to understand its main role.
332
332
333
-
### Example Code for Big Tank (BT)
333
+
### Understanding the Big Tank (BT) Code
334
334
335
-
The Opta™ in charge of Big Tank has a very similar structure to Small Tank's Opta™, as well as some of the functions in the code were generated by Arduino IoT Cloud during the dashboard configuration. Since it has a similar backbone code, we will focus on main tasks that only Big Tank is in charge of.
335
+
The Opta™ in charge of Big Tank has a very similar structure to Small Tank's Opta™, as well as some of the functions in the code, were generated by Arduino IoT Cloud during the dashboard configuration. Since it has a similar code backbone, we will focus on the main tasks that only Big Tank is in charge of.
336
336
337
-
The Big Tank's Opta™ has 2 main tasks. They are to stop the system operation or to control the attached pump. The `BT_System_Off()` is triggered if minimum level flag is turned off, in which will halt the Pump and send the valve off command for Small Tank's Opta™. This is the emergency stop for the system. The `BT_Pump_CTRL()` will send the valve off command whenever Big Tank's maximum level is reached and activate the pump to avoid reservoir overfill.
337
+
The Big Tank's Opta™ has 2 main tasks. They are to stop the system operation or to control the attached pump. The `BT_System_Off()` is triggered if the minimum level flag is turned off, in which will halt the Pump and send the valve off command for Small Tank's Opta™. This is the emergency stop for the system. The `BT_Pump_CTRL()` will send the valve off command whenever Big Tank's maximum level is reached and activate the pump to avoid reservoir overfill.
338
338
339
339
```arduino
340
340
uint8_t BT_System_Off(){
@@ -406,7 +406,7 @@ void BT_Param_Share(){
406
406
}
407
407
```
408
408
409
-
In this example, if we receive `P` from the Small Tank Opta™, the Big Tank's pump must be turned off. If it receives the character `6` or `7`, the Big Tank will have the information regarding Small Tank's maximum level. Following simple parser does this task inside the Big Tank's Opta™.
409
+
In this example, if we receive `P` from the Small Tank Opta™, the Big Tank turns off the pump. If it captures the character `6` or `7`, the Big Tank will have the information regarding Small Tank's maximum level. The following simple parser does this task inside the Big Tank's Opta™.
410
410
411
411
```arduino
412
412
uint8_t RS485_parser(){
@@ -429,7 +429,7 @@ uint8_t RS485_parser(){
429
429
}
430
430
```
431
431
432
-
There are no major differences in setup between Opta™ managing Small and Big Tank. In loop and assigned scheduler function, the only difference is that the Big Tank's Opta™ will share its local parameters with Small Tank's Opta™, while it consistently checks for pump activation or if the system must activate emergency stop.
432
+
There are no major differences in setup between Opta™ managing Small and Big Tank. In the loop and assigned scheduler function, the only difference is that the Big Tank's Opta™ will share its local parameters with Small Tank's Opta™, while it consistently checks for pump activation or if the system must activate emergency stop.
0 commit comments