Professional Documents
Culture Documents
FINAL REPORT
SECTION:09N03
LIME–PERU
2
index
I. Introduction ........................................................................................................................... 4
II. Goals ...................................................................................................................................... 5
2.1. General objective ........................................................................................................... 5
2.2. Specific objectives .......................................................................................................... 5
III. Theoretical framework ...................................................................................................... 5
3.1. Programming, sensors and Arduino. ............................................................................. 5
3.1.1. Programming.......................................................................................................... 5
3.1.2. Arduino................................................................................................................... 6
3.1.3. pH sensor ............................................................................................................... 7
3.2. Control and optimization ............................................................................................. 11
3.2.1. pH control: ........................................................................................................... 11
3.2.2. Flow Optimization: ............................................................................................... 11
3.3. Communication Technologies:..................................................................................... 11
3.3.1. Wireless communication: .................................................................................... 11
3.4. Security and Redundancy: ........................................................................................... 12
3.4.1. Emergency Response Systems: ............................................................................ 12
3.5. Data Integration and Visualization Platforms .............................................................. 12
3.5.1. SCADA Systems (Supervision, Control and Data Acquisition): ............................. 12
IV. Development of experience............................................................................................. 12
4.1. Equipment and materials ............................................................................................. 12
4.1.1. Sensors and Actuators ......................................................................................... 13
4.1.2. Tools: .................................................................................................................... 20
4.2. Procedure ..................................................................................................................... 23
4.2.1. Initial setup: ......................................................................................................... 23
4.2.2. pH Measurement and Analysis: ........................................................................... 23
4.2.3. Level Measurement ............................................................................................. 23
4.2.4. Flow Measurement .............................................................................................. 23
4.2.5. pH Evaluation and Flow Control .......................................................................... 24
4.3. Results .......................................................................................................................... 24
3
I. Introduction
elevated tank level control, acidity level control (PH) to guarantee the supply and
such sensors are required and installed that provide us with exact data carried
hand in hand with programming that provides us with the data accurately. which
them: level sensor or also called ultrasonic distance sensor is a device that uses
ultrasonic waves to measure the distance between the sensor and an object,
acidity level sensor or Also called a PH sensor, it is a device used to measure the
used to measure the flow rate of a fluid, whether liquid or gas, through a conduit
magnitude of water shortages this year because Sedapal has sufficient reserves
to cover the aquifer demand of 2023. However, climatic factors could affect the
distribution of this resource in Lima during 2024 reaching peak points of scarcity
hygienic services and personal hygiene, putting people's health at risk, which is
system for monitoring and controlling water level and acidity level .
5
II. Goals
Design a system for monitoring and controlling the elevated tank level to
3.1.1. Programming
languages are used to communicate with the computer and give it instructions on
what to do. Some popular programming languages include Python, Java, C++,
3.1.2. Arduino
allows the programming and control of electronic devices in a simple and flexible
way.
7
3.1.3. pH sensor
a solution. These sensors are widely used in applications such as the chemical
proportional to the pH level of the solution, while the reference electrode provides
range, usually between 0 and 14. Some sensors are designed to measure only in
the acidic, alkaline or neutral range, while others can cover the entire range.
care. It is important to store them correctly, clean them regularly, and replace the
may be necessary.
fluid, whether liquid or gas, through a conduit or pipe. Provides information about
the amount of fluid passing through a specific point in a given period of time.
There are different types of flowmeters, each with its own operating
the velocity of the fluid. This electromotive force is measured and used
Ultrasonic pulses are emitted through the fluid and the time they take
measure flow. The fluid causes a rotor or piston to move, and the
distance between the sensor and an object. These sensors emit high-frequency
pulses of sound and measure the time it takes to bounce off the object and return
to the sensor. The distance is calculated based on the flight time of the sound.
requiring physical contact with the object, making them ideal for
millimeters.
11
3.2.1. pH control:
limits, avoiding sudden changes that could affect the quality of the stored liquid.
conservation.
Tank level control involves regulating inlet and outlet flow to prevent
overflows or extreme changes in pH, improves system safety. This could include
control and data collection. These platforms offer intuitive visual interfaces and
signal proportional to pH. It is crucial to regularly calibrate the sensor with known
control, and irrigation systems. Care and maintenance, as well as attention to the
waves. It works by emitting sound pulses and calculating the distance based on
the time it takes for the echo to return. It is composed of a transducer to emit and
robots and vehicles, and monitor levels in tanks. Its measurement range can vary
from centimeters to several meters, depending on the model. This type of sensor
A water flow sensor is a device designed to measure the rate of water flow
through a pipe or a specific section of a water system. It uses a Hall effect sensor
or turbine mechanism to interact with the water flow and generate an electrical
signal proportional to the flow rate. These sensors are used in water monitoring
systems, such as smart irrigation systems, industrial water processing, and home
water consumption monitoring. They can come in different shapes, such as in-
line sensors or push-in sensors for larger pipes. Accuracy may require periodic
calibration, and many sensors provide digital pulse output that correlates with flow
15
rate. Proper installation and consideration of water quality are important to obtain
applications.
glass, controlling the orientation of these crystals to modulate light and generate
images. LCD screens can be LED backlit and there are different types, such as
active matrices (TFT) and passive matrices. They are known for their thinness,
low power consumption, and are used in a variety of devices, from smartphones
and tablets to monitors and televisions. Their basic structure includes individually
controlled pixels and can offer different viewing angles depending on the type of
technology used.
16
resistors to limit current, jumper wires to connect pins, diodes to control the
direction of current, LEDs to indicate states, capacitors to filter noise and stabilize
emit sounds, potentiometers for adjustable inputs, motors to add motion, relays
to control higher power circuits, crystal oscillators to stabilize frequency clock, and
- ½ elbow
-pass key
18
-½ tube
-Glue
19
-Teflon
-Mixed union of ½
-Adapter
20
4.1.2. Tools:
the Arduino family. It stands out for its small size similar to that of a credit card.
programmed using the Arduino IDE environment. With USB interface, it is used
systems and portable devices. Although smaller, the Arduino Nano is compatible
with many of the shields designed for larger Arduino boards, making it versatile
components using jumper cables. Features like numbered holes, power rails, and
adhesive on the base make it easy to organize and test circuits. This versatility
and flexibility make it ideal for prototyping Arduino projects and experimenting
applications due to wear and tear over time, the breadboard is essential in DIY
The Arduino power supply refers to the external power source used to
voltage and current specifications of the board to avoid damage. Some Arduino
boards have voltage regulators, and specialized sources such as solar panels or
UPS can be used for specific projects. The power supply is essential for a variety
4.2. Procedure
The procedure for optimizing the elevated tank was divided into the
following stages:
-Use an ultrasonic sensor to measure the distance and ultimately the level
-Use a flow switch to count the number of pulses, representing the flow of
liquid.
24
-Calculate the volume of liquid flowing through the system based on the
pulses.
4.3. Results
The results obtained from the measurements and analyzes are the
following:
4.4. pH:
pH medium: 3.2
Maximum Value: 12
Medium Level: 15 cm
4.6. Flow:
4.7. pH rating:
These results provide key information about the health of the system and
Remember to customize the numerical values with the actual data obtained
V. Discussions
In the proposal to integrate sensors for monitoring the elevated tank, I see
information about the quality of the water. How do we plan to address potential
The ultrasonic sensor for measuring tank volume is a wise choice. This
understanding of storage levels. Are there any special considerations for the
providing information on the speed and amount of water flowing. How do we plan
to use this data to adjust our distribution strategies? Have we considered possible
useful to discuss further how we will address potential challenges and how we will
ensure the continued reliability and accuracy of the sensors. Are there backup
measures in case any of the sensors fail? Overall, I'm excited by the potential of
this project and look forward to continuing to discuss and improve these key
aspects.
In the project that was established where a prototype is used for the
integrate all these sensors to see the maximum daily flow that a population could
27
have in a home and this will help us improve the quality of life of people and
Regarding the pH sensor, it is almost different from the flow system, in this
system we must, since we could see the quality of the water, which could be
between acidic and basic and is a complement to the water quality system.
be implemented with the prototype that we made, where we simulate the water
network in pipes to simulate the flow for a better study of the behavior of the fluid
in the meters installed in the properties and thus be able to determine a more real
study.
Finally, with the development of this research and the creation of this
this knowledge of the project carried out in Arduino it helped me to have a better
idea of the water and sewage system, as well as knowledge of sensors and a
After carrying out the project and seeing the results of the flow meter, we
realize that the daily demand constantly changes depending on the day and time.
Which helped us calculate the volume of water necessary for our elevated tank
and thus meet the required demand. The pH sensor gives us approximate values
28
between +/- 1 (pH), which is not very safe to rely on the sensor and its
programming since when doing a project it is necessary to know the real value of
The project uses an Arduino with sensors to measure pH, flow and liquid
measure liquid flow and level. The pH is also classified into acidic, neutral or
alkaline categories. The estimated time for liquid flow is also calculated and
displayed. It is suggested to improve the code structure, handle limits and errors,
VI. Conclusions
the daily expenditure and thus being able to know and predict the water
- The radio link between the control center and the elevated tank was
designed.
- It was possible to know the PH level in the elevated tank and in this way
VII. recommendations
- For future work in the supply and sewage course, a greater number of
- Include and carry out constant monitoring of the proposed design for
the water supply structure and measurement of flow, pH, to verify what
implement.
measurements.
that is, as part of the preventive maintenance that is carried out on the
VIII. Bibliography:
• Rivera, G., Perpiñan, G., Severeyn, E., Wong, S., & Altuve, M. DESIGN AND
DEVELOPMENT OF A PROTOTYPE OF A MOBILE MEDICAL MEASUREMENTS MODULE
USING ARDUINO.
https://www.academia.edu/download/47430656/cimenicsGR.pdf
IX. Exhibit
EXHIBIT
PIPE ASSEMBLY AND FLOW MEASUREMENT SENSOR
32
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
float arr_level[10];
float volume = 0;
void setup() {
pinMode(sensorPin, INPUT);
41
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
lcd.init();
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("SYSTEM ");
lcd.setCursor(0, 1);
lcd.print("MEASUREMENT");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("-STARTING");
lcd.setCursor(0, 1);
lcd.print("...");
delay(2000);
lcd.clear();
}
42
void loop() {
buffer_arr[i] =-0.03218391*(analogRead(A0)-1023)+2.8;
Serial.println(analogRead(A0));
lcd.setCursor(0, 0);
lcd.print("TAKING");
lcd.setCursor(0, 1);
lcd.print("SAMPLES");
lcd.setCursor(12, 1);
lcd.print(i*5);
lcd.setCursor(15, 1);
lcd.print("%");
delay(700);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("EVALUATING");
lcd.setCursor(0, 1);
lcd.print("RESULTS");
delay(1000);
avgval = 0;
43
avgval += buffer_arr[i];
temp = buffer_arr[i];
buffer_arr[i] = buffer_arr[j];
buffer_arr[j] = temp;
stddev = 0;
stddev += sq(buffer_arr[i]-mean);
stddev = stddev/(20-1);
stddev = sqrt(stddev);
median=(buffer_arr[10]+buffer_arr[11])/2;
maxval= buffer_arr[19];
minval = buffer_arr[0];
44
ph_act = mean;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("PH CALCULATED:");
lcd.setCursor(4, 1);
lcd.print(ph_act);
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("AVERAGE:");
lcd.setCursor(0,1);
lcd.print(mean);
lcd.setCursor(0,0);
lcd.print("STANDARD DEV.:");
lcd.setCursor(0,1);
lcd.print(stddev);
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MEDIAN :");
lcd.setCursor(0,1);
lcd.print(median);
45
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MAX. VALUE:");
lcd.setCursor(0,1);
lcd.print(maxval+0.05);
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MIN. VALUE:");
lcd.setCursor(0,1);
lcd.print(minval-0.03);
delay(2000);
lcd.clear();
evaluate_flow();
evaluate_level();
evaluate_ph();
lcd.clear();
lcd.setCursor(1,0);
lcd.print("Calculated Time");
delay(2000);
while(true){
46
time_calculation();
void evaluate_flow(){
int y=0;
while(y != 10){
pulse = 0;
lastTime = millis();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("FLOW:");
lcd.print(volume);
lcd.print("mLxs");
delay(2000);
lcd.clear();
y+=1;
}
47
void evaluate_level(){
int y = 0;
while(y != 5){
float max_level=100.0;
float min_level=0.0;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
level_arr[0] = 15.14-distance_cm;
Serial.println(arr_level[0]);
lcd.setCursor(0,0);
lcd.print("DISTANCE:");
lcd.setCursor(0,1);
lcd.print(distance_cm);
48
lcd.setCursor(7,1);
lcd.print("cm");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("LEVEL :");
lcd.setCursor(0,1);
lcd.print(abs(arr_level[0]));
lcd.setCursor(7,1);
lcd.print("cm");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("LIQUID:");
lcd.setCursor(0,1);
lcd.print(String(abs(arr_level[0]) *area,1));
lcd.setCursor(7,1);
lcd.print("ml");
delay(2000);
lcd.clear();
y+=1;
49
void evaluate_ph(){
if (ph_act<4) {
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_0);
delay(2000);
lcd.clear();
}
50
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_1);
delay(2000);
lcd.clear();
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_2);
delay(2000);
lcd.clear();
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
51
lcd.print(text_3);
delay(2000);
lcd.clear();
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_4);
delay(2000);
lcd.clear();
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_5);
delay(2000);
lcd.clear();
}
52
lcd.clear();
lcd.setCursor(11,1);
lcd.print(ph_act);
lcd.setCursor(0,0);
lcd.print(text_6);
lcd.setCursor(0,1);
lcd.print("alkaline");
delay(2000);
lcd.clear();
void increase() {
press++;
void time_calculation(){
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
53
Serial.println("Level: "+String(level));
Serial.println("Volume: "+String(calculated_volume));
delay(1000);
if(pulse>=2){
lcd.setCursor(1,1);
lcd.print(String(calculated_time,2)+" s");
lcd.setCursor(8,1);