Controlled Fluid Flow Without Controlling Pump Through Arduino

: Various Industries like Chemical, Energy, Nuclear, Process, Manufacturing, Healthcare, and Agriculture require the flow rate to be controlled. It may be constant, steady state, or between the specific upper and lower range. The article explained the development of a cost-effective fluid flow control system using an Arduino microcontroller. The direct use of the pump is not good because there are a lot of challenges (Corrosion, Power fluctuations, Pressure leak) with the pump and with time as it gets old, the chances of getting good, desired flow from it are not possible. We achieved the controlled flow rate (volume rate and mass rate) in a very precise and cost-effective manner. Because the flow corresponding to the height is steadier and more constant than getting steady flow from the pump. Hence, our solution is that we don’t get direct flow from the pump but from Tank B. Tank B must be very carefully designed (especially its height and cross section) to get the desired value of the flow rate from it, as per Bernoulli’s Theorem the flow velocity has a direct relation with the height. We just used the pump to refill tank B up to the desired level. In this case, the flow rate only varies when there is a larger change in the head of the tank from which it is coming (It is tank B in our case). The pump automatically becomes ON when the flow rate drops below 2 and fills tank B again to the height which corresponds to the flow rate 3 and when the flow rate becomes 3 the pump becomes OFF automatically. The process is repeated until the desired process is completed. After Completion the valve from Tank B can be closed. The Hardware integrations, Software Programming Logic, and Physical experimental setup are discussed.


Introduction
In the Process and Petrochemical industry, maintaining a steady controlled flow is a must for ensuring stoichiometry, which is mandatory for the accurate mixing of chemicals [1].In fluid dynamics research, precise control of fluid flow enables scientists to develop steady-state conditions and study phenomena like turbulence, Pressure, Friction, Viscosity, and other important properties.In the oil and gas sector, controlled flow is essential for efficient extraction, transportation, and refining processes, optimizing production, Crude oil feeding to fractional distillation, and minimizing waste [2].Similarly, in the nuclear sector, maintaining precise fluid flow is vital for reactor cooling systems and safety measures, ensuring stable and reliable operation [3].Thus, the importance of steady controlled flow extends across multiple industries, driving innovation and progress.
The pump is usually used directly for the controlled flow desire.But there are issues with using the pump, it is not easy to get the pump of your choice, capacity, and power because the manufacturer produces them according to some specific standard.Let's assume according to your calculations you need a pump to maintain the continuous flow rate of 2.5 m 3 /s, but if that specification is not available in the market, then you have to compromise on the process control which is not good.Its maintenance costs are bulky also.Moreover, as a machine, it has many operating problems and risks.With electricity fluctuations, it may become shot, and due to pressure leakage, the controlled flow is disturbed, Corrosion problems in the impeller reduces the efficiency.Due to all these circumstances, we can say that using the pump for very sensitive processes (where very high-cost chemicals are used as fluid) is highly risky.
The article dives into the development of sustainable and affordable systems for managing fluid flow, powered by an Arduino microcontroller.It focuses on maintaining the controlled flow of the fluid by maintaining/Controlling the height level in tank B (shown in Figure 1 & 2).Controlled flow means that the speed, mass flow rate and volume flow rate is constant or steady state or in specific upper and lower limit (i.e. in this work the desired range is 2 m 3 /sec to 3 m 3 /second) [4].
Volume flow rate is the volume of the fluid passed through a point in a second.Unit is (meter 3 /second).Mass Flow rate is the mass of the fluid passed through a point in a second.Unit is (Kilogram/ second).Speed of the fluid means that the distance covered by the fluid in a second.Unit is (meter/ second).
Controlled, continuous, and Steady-state flow is achieved whose speed and flow rate are in the desired range in our case the flow rate is precisely between 2 to 3 (m 3 /s) and only varies when there is a larger variation in the head of the tank from which it is coming (It is tank B in our case).The pump automatically becomes ON when the flow rate drops below 2 and fills the tank B again to the height which corresponds to the flow rate 3 and when the flow rate becomes 3 the pump becomes OFF automatically.The process is cyclic and repeated again and again until the desired process is completed (process means any chemical, mechanical, or research process where controlled flow is needed).When the process is complete the valve of the flow from Tank B can be closed.The Hardware integrations, Software Programming Logic, and Physical experimental setup are discussed in the next sections.
In Tank C (shown in Figure 1 & 2), we also fitted a water temperature sensor to closely monitor temperature, because tank C our main targeted and the place where the most sensitive process/ reaction is going on.And in engineering temperature measurement is one of the most important factors.The Physical setup, hardware and software components discussed in detail.The system's versatility across various industries is highlighted, showcasing its potential in sectors like manufacturing, healthcare, and agriculture.Industry 4.0 refers to the integration of modern technologies such as the Internet of Things (IoT), autonomous control, artificial intelligence, and robotics into various industries including manufacturing, healthcare, and agriculture, replacing old and traditional industrial manufacturing techniques and practices.Additionally, exploring alternative methods like flow control valves and investing in higher-sensitivity equipment, improved actuators, and advanced microprocessors could greatly enhance performance [5].The article suggests the potential integration of Proportional Integral Differential (PID) control to boost accuracy by continuously correcting errors, paving the way for a more responsive and adaptable system.As industries increasingly adopt automation and precision in their processes, the outlook for fluid flow control systems appears promising, offering opportunities for innovation and optimization.
Some important aspects of fluid control in industries include [6]: • Precision: The requirement for precise control over fluid flow rates is crucial in many industrial sectors such as pharmaceuticals, chemicals, and beverages where small variations in flow can impact product quality.
• Process Optimization: Fluid flow control is essential for optimizing various industrial processes.For instance, in petrochemical and pharmaceutical industries maintaining precise control over the flow of fluid is necessary for maintaining the correct composition of chemicals and liquids in a tank.0 • Temperature regulation: Alongside fluid flow control, temperature regulation is also crucial in applications such as heat exchangers, chemical reactions, and materials processing.
• Safety: Automating industrial processes such as mixing harmful substances ensures safety and reliability, preventing damage and injuries from harmful substances.
Instead of Controlling the pump directly this research focus on the setup of a tank (which is Tank B in this case) in which the water head is "h" and the speed/flow rate is directly associated with the "h" by the Bernoulli's theorem i.e.V=(2gh) 1/2 we will see the its derivation in the proceeding sections.As said earlier there are many problems with the pump, first its maintenance costs and the other are electricity fluctuations, it may become shorted, and due to pressure leakage, the controlled flow is disturbed, Corrosion problems in the impeller reduces the efficiency.Thus, to prevent the risks and increase safety and precision the flow from the tank is good.Moreover, the consistency, Steadiness, and Controlled flow from the tank is better than that from Pump [7].

Project Overview:
In addition to the broader context of fluid flow in Industry 4.0, this research paper discusses the development and implementation of a fluid flow process control system using an Arduino microcontroller providing an efficient and cost-effective method of fluid flow control system.The key components used for this implementation include the following: a. Arduino UNO R3: In Figure 1.Arduino UNO is a popular microcontroller board providing an easy way to interface with ATmega328 microcontroller which acts as the central processing unit (CPU) or the brain of the entire process control project.It was responsible for creating a processing data captured from input transducers, processing it, and executing control flow instructions and algorithms to the output actuators.

Figure 6 Dual channel relay module
All these hardware components are cheap and readily available in the market and are perfect for a small-scale fluid process control project.

2.Methodology
In Figure 8.The complete process is represented through a block diagram, In Figures 9 and 10, the setup involves the use of 3 Tanks.Tank A, Tank B, and Tank C, with Tank A acting as a water source used to pump water to Tank B via a DC pump.The impellor inside the DC pump pushes water towards the outlet due to centrifugal force.This output water flows from tank B to tank C, which is placed directly underneath it, through a nozzle due to potential energy.The Hall Effect Flow Rate sensor is placed next to the nozzle, the Flow Rate sensor used is YF201 which works on the principle of the Hall magnetic effect.The assembly consists of a rotor and a Hall Effect Sensor placed inside a plastic body.As the rotor rotates due to water flow, the sensor generates an electric pulse which is fed into the Arduino microcontroller [8].The Arduino code converts the sensor value to flow rate in liter/min and sends data to LCD for user monitoring.The Arduino continuously monitors this sensor value and depending on the set point value and threshold value set by the user, sends the signal to the Relay Switch whether to keep the pump running or switch it off.Flow rate depends on 2 factors, the velocity of the fluid and the area of the nozzle [9].In this case, the area of the nozzle remains constant and the change in flow rate depends upon the velocity change due to the height of water in tank B.
The flow rate is related to the velocity and area of the nozzle by Equation 1: Where Q is the flow rate, A is the area of the nozzle (from Tank B) and V is the velocity of the fluid.
The velocity is related to height by the Equation 2: As the height of water in the tank changes, the velocity also changes causing a change in fluid flow rate which is constantly being monitored by the user through the microcontroller.A proteus simulation of the project was also done to verify the working of the project.
Let's describe the velocity at "point 2" mathematically.

Figure 7 Tank B point 1 and 2
From Figure 7 apply Bernoulli's equation between point 1 and point 2.
We have P 1 = 0 , Tank B is exposed to the atmosphere from the top and bottom (through Tank B by pipes).
v 1 = 0 , because the fluid level drop is too slow.h 2 = 0 , we take height from bottom to top.P 2 = 0 , Tank B is exposed to the atmosphere from the top and bottom (through Tank B by pipes).
Hence, Bernoulli's equation becomes "V2" Is the velocity of the fluid at point 2

Relay Connection:
The relay module is connected to a digital pin on the Arduino board, specified as relaying in the code, which is set to pin 3. Typically, a relay module has three pins: VCC, GND, and IN (input).VCC is connected to the 5V pin on the Arduino board.GND is connected to the GND pin on the Arduino board.IN (input) is connected to the digital pin specified by the relay Pin (pin 3 in this case) on the Arduino board.

Arduino program code explanation
The main logic of the system is developed in the program and if condition is used i.e if the flow rate is less than the desire the pump will become on automatically and vice versa.The "millis ()" counts the time since the power on of the control system.

INPUT_PULLUP:
This means that the microcontroller activates an internal resistor connected between the input pin and the power supply voltage (VCC).This resistor "pulls up" the voltage on the pin to VCC when the pin is not being actively driven low.
Interrupt Mechanism: A mechanism that allows the Arduino to respond immediately to a specific event signaled by a Hall Effect Sensor without constantly checking its output in the main loop (void loop).

Under Void Setup:
In the main setup, we set the built-in LED for output and intrpin=2 as an input pin from the sensor (also do pullup).

attachInterrupt ():
We set the program to report every three seconds because for calculation of flow rate (L/M) and total quantity gone to the controlled tank, we need a proper fixed value interval of time and in our experimental, it is suitable but can vary accordance to the sensitivity of control.
Inside the Char tbh[65] is for serial print format and spacing.
As Arduino programming works in milliseconds, so we convert the milliseconds to seconds.
void Pulse_cnt (): It is a user-defined function, that Count the pulses concerning the attachInterrupt () function, the variable rate_count stores the total number of pulses, Variable tot_cnt stores the total number of pulses.At the end turn the Boolean variable "run_flag" into true.
Under Void Loop (): We set the while loop with a condition that if the difference between the start time and the current time is less than or equal to the interval (3000 ms in this case) the loop is executed.
rate_count is set to zero after every cycle (after every 3 seconds) In while Loop: -If there is no interrupt(pulse) signal from the Hall sensor to the attachInterrupt () function in setup () the built-in LED will be off and if there is an interrupt the Pulse_cnt() function will execute and the Boolean run_flag will become true.
-If the run_flag is true then the if() condition will execute LED will become ON and run_flag will be set to false Because to run the new iteration from the start setup () to observe another interrupt from the sensor and Pulse_cnt() will be executed again, This entire mechanism will be repeated again and again till the difference become larger than the value of interval.
Note: Here the Pulse_cnt () function is called again and again whenever the interrupt is observed.The program searches for Interrupts only during the provided time interval.When the difference reaches larger than the interval the execution of the while() loop will stop and the program after that will run and we will get the desired output.
Let's assume our controlled tank demands 2<flow rate <=3: If (LperM<2): It is the condition that cares for the flow rate as it drops lower than 1 the pump will immediately ON and will fill the Tank 1 till the flow becomes greater than or equal to 3.

If (LperM>=3):
It is the condition that cares when the flow rate becomes greater than or equal to 3.
In the end, the current time is set as the start time.

Results
Through programming logic, the value of flow is measured Equation (6).Measured value is taken directly from the sensor reading while calculated value is calculated through the formula (Table 1) and (Table 2): And A= π r 2 (7) The radius of the pipe is 6.35mm and π value is 3.14.A= π r 2 =3.14(6.35) 2 = 126.612mm 2  And V is the velocity of the fluid.V depends upon the height of the fluid in the tank because the value of G is assumed to be constant.
Value of "h" is variable whose different values.
If the viscosity of the fluid is changed, its velocity will be changed because mass rate is changed.Velocity depends upon height for that case in which viscosity remains the same.Equation ( 9) implies, If viscosity is changed then mass flow rate will be changed because density is changed due to which velocity will be changed due to which mass flow rate will be changed.ṁ=ρVA (9) ρ is the density of the fluid.When liquid is changed then its mass flow rate is changed basically which affects the velocity.Kerosine oil density is 720 kgm -3 while the density of water is 1000kgm -
Secondly the error can be due to human error, due to the sensor limitation.
Error can be removed if we precisely take the readings at moderate temperature where evaporation does not occur and use a more detailed system like raspberry pi.
We take measured readings directly from sensor by connecting the flow meter sensor to the analog pin of the Arduino and Arduino displays the analog value off the sensor on the LCD connected via I2C module.

Discussion
The paper discusses the fabrication of a process control system involving the control of fluid flow rate by controlling the water level in a tank.The water level in the tank determines the flow rate of water through the nozzle showcasing an easy and effective way of maintaining a certain flow rate along with the desired water level in the tank.The components utilized to achieve this were Arduino UNO, YF201 hall effect flow rate sensor, and a 12V DC centrifugal water pump.The purpose of this experiment was to showcase how it can be utilized in real-life industrial applications, especially in petrochemical industries, pharmaceutical industries, and power plants where there is a need to have control over the flow rate of fluid and water level in a tank or reservoir [1].The system can be used in such cases to maintain water levels in the reservoir within the required boundary limits while also maintaining the fluid flow rate.However, there are some limitations to the model presented in this research, the system consists of 3 tanks (Figure 7).The flow is directly coming from tank B, and with time as the height of the liquid in tank B decreases the flow rate decreases and it doesn't remains same as it was some time before, It is the main drawback of our model that the flow rate is not limited to a constant number like 2, 3, etc., The flow rate condition we applied is a range between two values like we set the flow rate condition we assumed is in between 2-3 (m 3 /s), and if it goes below 2 the pump becomes ON automatically and fills the tank B till the height when the flow rate reach 3.This process is repeated as per demand in tank C. Now this limit can be solved if we design tank B wisely as per fluid mechanics principles its height and cross section must be very large, and the nozzle must be very small as compared to them.A constant value flow rate can be achieved for the long time, and as the flow rate decreases the pump will fill the tank B again.The second limitation of this research model is that it is generalized, as it is designed in a lab and we made assumptions of a lot of conditions, therefore this model is not directly applicable to the special challenge or issue in the industry, but it can be modified and redesigned according to the specific problem.The specific problem could be attaining constant flow to maintain stoichiometry in the petrochemical industry or maintaining constant flow for fractional distillation in oil and gas industry or anything else.
It cannot be directly utilized in a large-scale industry where it is crucial to keep errors to the minimum and maintain other environmental parameters in control.For industrial integration, some further adjustments need to be made so that the proposed system can be used as an easy, efficient, and reliable method for fluid control and level management in industries.The major constraint with the proposed design is that the control process is slow and error prone as external environmental factors, interfering, and modifying constraints have not been catered for when designing the system.This can be fixed by introducing Proportional Integral Differential (PID) Control in our control system.PID control continuously calculates the error value between the measured value and the ideal value, applies correction, and provides the corrected value to the controller which is then processed for further control.Integration of PID control improves the accuracy of the system by removing errors accumulated during the process.Such controlled output is crucial in industries where errors occurring due to various environmental factors can result in a dangerous and harmful outcome [10].For example, in pharmaceutical industries, petrochemical industries, and nuclear power plants, a slight change in the composition of elements in a mixture during the mixing process can ruin the entire process, in some cases resulting in a deadly outcome.Additionally, instead of controlling fluid flow by maintaining water level in the tank, flow control valves can be utilized that may provide better results compared to the approach used in this paper to control the flow rate (Comparison of Level Control Configuration for Industry -, n.d.).Furthermore, to improve the system proposed in this paper, the addition of a temperature and pressure sensor and actuators for example a boiler or heater can also prove to be useful as most fluid control processes require the entire system to be kept under a controlled environment [11].A controlled environment is where all the external factors that may influence the overall rate or quality of fluid such as temperature, and pressure, are kept constant or stable as per the conditions demand.To achieve this, the integration of various sensors and actuators that control such parameters is necessary to ensure proper management of processes in industries.Further improvements such as the use of higher sensitivity equipment, better actuators, and a high memory and clock speed microprocessor can have a significant impact on the overall performance of the system [12].

Future Scope
In the vast realm of industries, ensuring precise fluid flow is crucial for various applications, ranging from chemical production to nuclear reactor safety.However, advancements in technology and innovative approaches are paving the way for an exciting future in fluid flow control [13].
Imagine utilizing compact yet powerful microcontrollers like Arduino to develop cost-effective control systems tailored to specific industry needs.These systems can offer customization and scalability, providing adaptable solutions for both large-scale factories and smaller operations.Moreover, sophisticated control algorithms such as PID hold promise for enhancing control accuracy and efficiency.
Automation is emerging as a significant driver of progress in fluid flow control.By integrating technologies like IoT, AI, and robotics, industries can achieve unprecedented levels of precision and efficiency.For instance, in manufacturing settings, automated systems can continuously monitor and adjust fluid flow parameters in real-time, ensuring consistent product quality.Similarly, in healthcare, automated controls can precisely regulate medication dosages, enhancing patient safety and care [14].
Even agriculture stands to benefit from automation in fluid management.Imagine smart irrigation systems equipped with sensors that analyze soil moisture levels and adjust water flow, accordingly, promoting optimal crop growth while conserving water resources [15] [16].
In essence, the future of fluid flow control is characterized by innovation, efficiency, and sustainability.
Through the integration of advanced technologies and novel approaches, industries are poised to unlock new levels of precision and performance in managing fluid processes, ultimately leading to improved productivity and environmental responsibility [17] [18].

Conclusion
The study demonstrates the significance of fluid flow control systems in various industries, especially in the context of Industry 4.0, where automation and precision are essential for optimizing processes.The paper presents a detailed overview of the hardware and software components used in the control system, emphasizing its costeffectiveness and efficiency.
Through the physical setup and simulation, the authors show how the system effectively controls fluid flow rates by monitoring water levels and adjusting pump operation accordingly.However, it is noted that the proposed system may have limitations in large-scale industrial applications due to its slow response time and susceptibility to external environmental factors.
To address these limitations and enhance the system's performance, the authors suggest incorporating Proportional Integral Differential (PID) control, which can improve accuracy by continuously correcting errors.Additionally, they propose the integration of temperature and pressure sensors, as well as actuators like boilers or heaters, to create a more controlled environment for fluid processes [19] [20].
Furthermore, the authors recommend exploring alternative methods such as flow control valves for better flow rate management and investing in higher sensitivity equipment, improved actuators, and advanced microprocessors to enhance overall system performance [21].
In summary, while the developed control system shows promise for industrial applications, further refinement, and enhancements are necessary to meet the stringent requirements of large-scale industries, particularly in terms of accuracy, speed, and environmental robustness.
Figure 1 Arduino UNO development board with Atmega328p microcontroller chip

Figure 2 YF
Figure 2 YF-S201 Hall Effect Sensor for measuring fluid flow rate

Figure 3 DC
Figure 3 DC centrifugal water pump

Figure 4
Figure 4 Arduino LCD and I2C module

Figure 8
Figure 8 Block diagram of the entire fluid flow control process

1 .
Figure 9 Schematic Diagram of Tanks and Flow Figure 11 Experimental setup of the entire process Figure 13 represents the program executing process.The libraries for each component are installed first.We used the Arduino Integrated Environment (IDE) to write the entire program for our control system.The code for the Hall Effect Sensor is based on its working mechanism (explained in the previous section) i.e. the YF-S201 has some important factors defined by the manufacturer.a. 6 Interrupts/revolution (Interrupts means pulses) b. 8 Hz-8.2Hz = 1 Liter/min, c. 486 pulses= 1 Liter d.Working flow rate 1 to 30 Liters per Minute Hence at the start of the program, we defined those factors.After that, we defined some variables following our program logic.Some important datatypes we used are: Volatile int: The keyword volatile is used to indicate to the compiler that a variable's value may change at any time outside the control of the program (e.g., by an interrupt service routine).An int is a data type representing a 16-bit signed integer.Unsigned long: unsigned long is a data type that represents a 32-bit unsigned integer.It can only hold nonnegative values.
Figure 13 Program/Code flow chart