Skip to content

Commit eab0098

Browse files
committed
Content update
1 parent 5c32a60 commit eab0098

File tree

1 file changed

+13
-13
lines changed
  • content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/tank-level-app-note

1 file changed

+13
-13
lines changed

content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/tank-level-app-note/content.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ Small Tank (ST) and Big Tank (BT) each have a specific monitoring routine to mon
7272

7373
The Opta™ in the Big Tank (BT) performs the following actions:
7474

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.
7676
- 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.
7878

79-
The Opta™ in the Small Tank performs the following actions:
79+
The Opta™ in the Small Tank (ST) performs the following actions:
8080

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.
8282
- It sends Small Tank's current maximum level state to Big Tank while seeking Big Tank's minimum level state.
8383

8484
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.
8585

86-
### Example Code for Small Tank (ST)
86+
### Understanding the Small Tank (ST) Code
8787

8888
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.
8989

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.
9191

9292
```arduino
9393
#include "thingProperties.h"
@@ -204,15 +204,15 @@ void ST_Param_Share(){
204204
}
205205
```
206206

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.
208208

209209
```arduino
210210
RS485.beginTransmission();
211211
RS485.println('');
212212
RS485.endTransmission();
213213
```
214214

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™.
216216

217217
```arduino
218218
uint8_t RS485_parser(){
@@ -330,11 +330,11 @@ void rs485_interface(){
330330

331331
We will now continue with Big Tank's Opta™ to understand its main role.
332332

333-
### Example Code for Big Tank (BT)
333+
### Understanding the Big Tank (BT) Code
334334

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.
336336

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.
338338

339339
```arduino
340340
uint8_t BT_System_Off(){
@@ -406,7 +406,7 @@ void BT_Param_Share(){
406406
}
407407
```
408408

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™.
410410

411411
```arduino
412412
uint8_t RS485_parser(){
@@ -429,7 +429,7 @@ uint8_t RS485_parser(){
429429
}
430430
```
431431

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.
433433

434434
```arduino
435435
void loop() {

0 commit comments

Comments
 (0)