You are on page 1of 23

INSTRUMENTATION PROJECT

LIQUID LEVEL MEASUREMENT

SEMM 3242 – Section 06

GROUP MEMBERS

GROUP MEMBERS MATRIC

ARGYA RAFI SEPUTRO A19EM0579

FADHIL HAMID A20EM0369

MUHAMMAD HUGO ALDAPHA A18KM0439

KAHLIL GIBRAN A19EM597

UNIVERSITI TEKNOLOGI MALAYSIA, JOHOR


FACULTY OF MECHANICAL ENGINEERING
SEMESTER 1, 2022/2023
BACKGROUND RESEARCH..................................................................................................................... 3

CAPACITIVE SENSOR .......................................................................................................................... 3

LITERATURE REVIEW AND RECENT TECHNOLOGY ................................................................... 4

MOST CURRENT AVAILABLE TECHNOLOGY ON THE MARKET .............................................. 5

MECHANICAL DESIGN ............................................................................................................................ 6

BLOCK DIAGRAM ................................................................................................................................. 6

PHYSICAL DESIGN OF THE SENSOR ................................................................................................ 8

MATERIAL SELECTION AND FABRICATION TECHNIQUE .......................................................... 9

ELECTRICAL DESIGN ............................................................................................................................ 11

SIGNAL CONDITIONING.................................................................................................................... 11

COMPONENTS SELECTION ............................................................................................................... 13

ARDUINO SYSTEM ............................................................................................................................. 13

CALIBRATION ......................................................................................................................................... 18

SENSOR CALIBRATION ..................................................................................................................... 18

RESULT OF CALIBRATION ............................................................................................................... 19

DISCUSSION ............................................................................................................................................. 22

DISCUSSION ON THE CAPACITIVE SENSOR................................................................................. 22

CONCLUSION ........................................................................................................................................... 22

2
CHAPTER 1

BACKGROUND RESEARCH

CAPACITIVE SENSOR

A capacitive proximity sensor is a device that can detect or sense the presence or absence of nearly
any object, regardless of its substance. the modification of capacitance all over the sensor's active face. A
capacitive sensor uses a technique in which the object must either have a dielectric other than air or be
conductive in order to detect anything. The sensor utilised to measure position or displacement, proximity,
fluid level, humidity, and acceleration makes up the bulk of the principal application. Because of this use,
capacitive sensors can take the place of mechanical buttons.

It operates by two metal electrodes sensing the surface of an object, causing the capacitive sensor
to involve a high-frequency oscillator, and altering the oscillator's capacitance by entering the electrodes'
electrostatic field. When the oscillation reaches a specific amplitude, the oscillator circuit starts to oscillate
and then varies the output state of the sensor. As the object moves farther from the sensor, the amplitude
drops, returning the sensor to its initial state. The capacitive proximity sensor can identify a target more
easily if it has a higher dielectric constant value. No matter what material is being perceived, it has a small
sensing range of roughly 1 inch by nature. Therefore, while working with non-conductive targets, the
sensing distance increases as the size of the sensor surface increases. The ideal setting for using capacitive
sensors is one with a somewhat stable temperature.

Figure 1: Capacitive Sensor Diagram.

3
The dielectric constant of the object being detected is used by capacitive sensors to detect its
presence. This property requires that the object's dielectric constant be greater than that of the capacitive
sensor. Since conductive targets have a higher capacitance and the target dielectric constant is irrelevant,
they present a difficulty for this device. Even in the presence of conductive targets like metal, water, blood,
acids, bases, and salt water, the sensor must be able to turn off once the material has left the area.

Then, capacitive sensors are improved to be able to tell real liquid levels apart from any potential
interference like condensation, material buildup, or fluids that are foaming. These Sensors can be used in
level applications because they are insensitive to any non-conductive substance, such as plastic or glass.
These improved capacitive sensors only have one drawback: in order to function effectively, they need fluid
materials that are electrically conductive and have dipole properties. The amplitude of the high-frequency
oscillator used by this enhanced capacitive sensor is directly connected to the capacitance change between
the two independently operating sensing electrodes. Each electrode makes an autonomous effort to bring
itself into equilibrium. This explains why, in contrast to a conventional capacitive sensor, the sensor
independently measures the capacitance of the container wall without reference to the ground and the
capacitance of the conductivity of the liquid with reference to the ground.

Capacitive sensors can now only produce discrete outputs or point level indications when employed
in level applications. Capacitive sensor technology now has the option of using a remote amplifier, which
is another novel change. As a result, the capacitive sensor will be able to perform more effectively while
also getting smaller.

LITERATURE REVIEW AND RECENT TECHNOLOGY

Water level measurement is an important aspect of various fields such as agriculture, hydrology,
and oceanography. In the past, water level measurement was performed using mechanical gauges, which
had limited accuracy and reliability. Over time, the development of digital technologies has led to the
emergence of electronic sensors and data loggers as the standard for water level measurement. These
systems have improved accuracy and reliability, as well as the ability to monitor water levels in real-time.

In recent years, several instrumentation systems for water level measurement have been developed
incorporating different technologies such as ultrasonic sensors, pressure transducers, and radar sensors.
These systems are designed to provide accurate and reliable water level data in real-time, and are equipped
with data communication capabilities for remote monitoring and data transmission. Many of these systems

4
also have the ability to store data for later analysis and have built-in alarms for high or low water level
conditions.

MOST CURRENT AVAILABLE TECHNOLOGY ON THE MARKET

The use of satellite-based sensors is the most cutting-edge technology currently available on the
market for measuring water levels. These sensors can measure water levels in remote and inaccessible
locations and deliver extremely accurate and trustworthy data. Autonomous underwater vehicles (AUVs),
which can be placed in bodies of water for long-term monitoring, are another cutting-edge sensor
technology. In order to remotely monitor water levels in real-time and because they are more cost-effective
than other methods, wireless sensor networks are also becoming more and more popular in the field of
water level measurement. Many of these systems can also combine with additional sensors to provide a
comprehensive monitoring solution.

One of the example are SCADALink SAT100. Remote applications with restricted access to
terrestrial connections can get real-time water level monitoring through SCADALink SAT100 satellite-
based RTU packages and SatSCADA Server. Rapid and affordable deployment is made possible by low
power consumption and satellite-based connectivity. The SAT100, which has 4 I/O and RS232/RS485
connectivity, may link to serial-connected sensors or data recorders as well as analogue water level sensors.
The SAT100 can communicate with industry-standard water level sensors and switches such capacitance,
ultrasonic, and submersible pressure via both I/O and serial communications. The SAT100 can be set up to
send reports to the SatSCADA Server on a daily, hourly, or interval schedule; in response to an alarm
situation; or at the user's request.

Figure 2: SCADALink SAT100 satellite-based RTU workflow diagram.

5
CHAPTER 2

MECHANICAL DESIGN

BLOCK DIAGRAM

A capacitive sensor functions similarly to an antenna by producing an electric field. The capacity
of this field will fluctuate when a substance approaches the antenna. The microprocessor detects this
variation and may estimate an object's vicinity. With this technology, any conductive object may be made
into a sensor.

Figure 3: Illustration of Arduino Capacitive Sensor.

6
Figure 4: Block diagram of Capacitive Water Level Sensor.

1. Sensor inside water tank: This block represents the capacitive water level sensor that is placed
inside the water tank. The sensor consists of a metal electrode and a dielectric material that is used
to detect changes in the water level.

2. Input of minimum and maximum liquid level: This block represents the input of the minimum and
maximum liquid levels that the system needs to measure. This information is used to set the range
of the measurement data and to determine the accuracy of the system.

3. Breadboard: The breadboard is used to connect the capacitive water level sensor to the Arduino. It
acts as a platform for prototyping and testing electronic circuits.

7
4. Arduino: The Arduino is a microcontroller that is used to control the capacitive water level sensor
and to process the measurement data. The Arduino receives the measurement data from the
capacitive water level sensor and converts it into a digital signal that can be read by the computer.

5. Output in the form of measurement data: This block represents the output of the system in the form
of measurement data. The measurement data is the water level measurement that is obtained from
the capacitive water level sensor. The measurement data can be displayed on an LCD screen or
transmitted to a computer for further analysis.

PHYSICAL DESIGN OF THE SENSOR

Shown below the physical design of this group sensor:

Figure 5: Physical Design on the Sensor.

8
Figure 6: Dielectric design.

Figure 7: Plastic jar as liquid container design.

MATERIAL SELECTION AND FABRICATION TECHNIQUE

Due to its excellent electrical conductivity, which enables the generation of a capacitance between
the plates, stainless steel is frequently used for the metal plates in capacitive level sensors. It is an excellent

9
option for usage in damp situations where the sensor may be exposed to moisture or other corrosive
materials due to its great endurance and resistance to corrosion.

Due to their simplicity and adaptability, plastic bottles are a common choice for storing liquids.
They are constructed from strong, lightweight materials like polyethylene terephthalate (PET), which can
endure damp conditions and act as a barrier to protect the contents from becoming contaminated. Plastic
bottles are available in a wide range of forms and sizes, making them appropriate for a wide range of uses,
such as storing household liquids, drinks, and personal care goods. They may be sealed with a cap and are
also highly portable. We can also control the liquid level thanks to the body's transparency.

Due to its excellent electrical conductivity, which enables the generation of a capacitance between
the plates, stainless steel is frequently used for the metal plates in capacitive level sensors. It is an excellent
option for usage in damp situations where the sensor may be exposed to moisture or other corrosive
materials due to its great endurance and resistance to corrosion.

Due to its strong electrical conductivity, which enables the generation of a capacitance between the
plates, stainless steel is a popular choice for metal plates in capacitive level sensors. As a result of its
excellent durability and corrosion resistance, it is a desirable option for usage in damp situations where the
sensor may be exposed to moisture or other corrosive materials.

Due to their simplicity and adaptability, plastic bottles are a common choice for storing liquids.
They are constructed from strong, lightweight materials like polyethylene terephthalate (PET), which can
endure damp conditions and act as a barrier to protect the contents from becoming contaminated. Plastic
bottles are available in a wide range of forms and sizes, making them appropriate for a wide range of uses,
such as storing household liquids, drinks, and personal care goods. They may be sealed with a cap and are
also highly portable. We can also control the liquid level thanks to the body's transparency.

A flexible, insulating, and chemically stable plastic called polythene is a good choice for the liquid
level sensor's wrapping material. The polythene's insulation serves to prevent electrical shorts between the
metal plates, which might compromise the sensor's accuracy. The material's elasticity also makes it simpler
to wrap the metal plates and keep a constant distance between them. To maintain a constant spacing between
the metal plates, which is necessary for the creation of a capacitance, erasers are employed as spacers.
Erasers are a cheap and easily accessible resource for this. The wrap around the metal plates is sealed with
electrical tape, which also holds the erasers in place. It offers a strong seal and works to keep moisture from
impairing the sensor's functionality. Electrical tape is also a flexible, strong substance that can tolerate
exposure to moisture and other environmental elements, making it a good choice for usage in damp areas.

10
CHAPTER 3

ELECTRICAL DESIGN

SIGNAL CONDITIONING

Signal conditioning is the process of getting an analogue signal ready for either digital conversion
or more processing. Signal conditioning, as it relates to capacitive water level sensors, is the process of
getting the sensor's analogue output ready for the Arduino microcontroller.

Figure 8: Signal Conditioning of Sensor.

The following steps are involved in signal conditioning the output of a capacitive water level
sensor:

1. Amplification: The analog output of the capacitive water level sensor is often a small voltage signal
that needs to be amplified to a level that can be processed by the Arduino. This is usually done
using an operational amplifier (op-amp) configured as an amplifier.

11
2. Offset and Gain Correction: The amplified signal may have an offset voltage that needs to be
removed in order to obtain accurate measurements. The gain of the amplifier may also need to be
adjusted to ensure that the signal is in the proper range for processing by the Arduino.

3. Filtering: The amplified signal may contain unwanted noise that needs to be filtered out in order to
improve the accuracy of the measurement. This is usually done using a low-pass filter to remove
high-frequency noise and a high-pass filter to remove low-frequency noise.

4. Digital Conversion: After the signal has been conditioned, it is ready for digital conversion. This is
typically done using an analog-to-digital converter (ADC) that is built into the Arduino. The ADC
converts the analog signal into a digital signal that can be processed and analyzed by the Arduino.

Figure 9: Circuit design with Tinkercad.

Figure 8: Sample calculation.

12
COMPONENTS SELECTION

1. Capacitive water level sensor: The capacitive water level sensor is the core component of the
system and its selection will greatly affect the performance and accuracy of the system. Factors to
consider when selecting a capacitive water level sensor include accuracy, resolution, operating
temperature range, and response time.

2. Operational amplifier (op-amp): An operational amplifier is used to amplify the analog output of
the capacitive water level sensor. Factors to consider when selecting an op-amp include gain, input
impedance, and input voltage range.

3. Analog-to-digital converter (ADC): An ADC is used to convert the analog output of the capacitive
water level sensor into a digital signal that can be processed and analyzed by the Arduino
microcontroller. Factors to consider when selecting an ADC include resolution, conversion speed,
and power consumption.

4. Breadboard: The breadboard is used to connect the capacitive water level sensor, op-amp, and ADC
to the Arduino microcontroller. Factors to consider when selecting a breadboard include size,
number of available connection points, and compatibility with the components being used.

5. Arduino microcontroller: The Arduino microcontroller is used to control the capacitive water level
sensor, process the measurement data, and display the results. Factors to consider when selecting
an Arduino microcontroller include processing speed, memory capacity, and available input/output
(I/O) pins.

ARDUINO SYSTEM

The Arduino system plays a vital role in a capacitive water level sensing system. It is responsible
for controlling the capacitive water level sensor, processing the obtained measurement data, and displaying
the results. The microcontroller communicates with the capacitive water level sensor to control its operation
and trigger measurements. The measurement data is then processed to filter out unwanted noise and convert
it into meaningful units such as inches or centimeters. The results can be displayed on an LCD screen or
through serial communication to a computer, providing real-time monitoring of water levels and valuable
data for further analysis. The use of an Arduino microcontroller in a capacitive water level sensing system

13
offers a high degree of flexibility and customization, allowing for the development of custom applications
and the addition of additional functionality to the system.

Before calibration

#include <CapacitiveSensor.h>

CapacitiveSensor cs_6_8 = CapacitiveSensor(6,8); // 10M resistor between pins 6 & 8, pin 8 is sensor
pin, add a wire and or foil if desired

void setup()

cs_6_8.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as an


example

Serial.begin(9600);

void loop()

long start = millis();

long total1 = cs_6_8.capacitiveSensor(30);

Serial.println(total1); // print sensor output 1

14
delay(500); // arbitrary delay to limit data to serial port

Algorithm explanation:

• Set pins 6 and 8 as the initial values for the "cs 6 8" capacitive sensor object.
• Disable the capacitive sensor's autocalibration in the setup function, then begin serial connection at
a 9600 baud rate.
• Use the "capacitiveSensor" method with a sample size of 30 to determine the sensor's capacitance
in the loop function.
• The measured capacitance will be printed to the serial port.
• 500 milliseconds will pass.
• Replicate step 3 here.

Using the "CapacitiveSensor" library, the Arduino code determines the capacitance of a sensor that is
connected to pins 6 and 8 of the Arduino board. The process used by the code is as follows:

1. Initialization: A capacitive sensor object named "cs_6_8" is created using the "CapacitiveSensor"
library. The object is initialized with pins 6 and 8, with pin 8 serving as the sensor pin and a 100k
resistor being present between pins 6 and 8.

2. Setup function: In the setup function, the autocalibrate feature of the capacitive sensor is turned off
using the "set_CS_AutocaL_Millis" method with a value of 0xFFFFFFFF. This is just an example,
and the autocalibrate feature can be turned on if necessary. Additionally, serial communication is
initiated with a baud rate of 9600 using the "Serial.begin" method.

3. Loop function: The loop function is executed repeatedly and contains the core functionality of the
code. First, the current time is recorded using the "millis" function. Then, the capacitance of the
sensor is measured using the "capacitiveSensor" method with a sample size of 30. The measured
capacitance is stored in a variable named "total1". The measured capacitance is then printed to the
serial port using the "Serial.println" method.

4. Delay: After the measured capacitance is printed to the serial port, a delay of 500 milliseconds is
introduced using the "delay" function to limit the amount of data sent to the serial port.

15
5. Repeat: The loop function is executed repeatedly, allowing the process of measuring the
capacitance and printing it to the serial port to be repeated continuously.

After calibration

#include <CapacitiveSensor.h>

CapacitiveSensor cs_6_8 = CapacitiveSensor(6,8); // 10M resistor between pins 6 & 8, pin 8 is sensor
pin, add a wire and or foil if desired

void setup()

cs_6_8.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate

Serial.begin(9600);

void loop()

long start = millis();

long total1 = cs_6_8.capacitiveSensor(30);

float level = ((float)total1 - 1265)/1978;

16
Serial.println(level); // print sensor output 1

delay(500); // arbitrary delay to limit data to serial port

Algorithm explanation:

• CapacitiveSensor library import.


• Create a CapacitiveSensor object named "cs 6 8" and initialise it with pins 6 and 8, with pin 8
serving as a sensor pin and a 100k resistor between them.
• Start serial connection at a baud rate of 9600 and disable autocalibrate on channel 1 in the setup
function.
• Get the current time in milliseconds and place it in the variable "start" in the loop function.
• Record the capacitive sensor reading in the variable "total1" with a sample time of 30 milliseconds.
• Calculate the sensor reading's level using the formula level = (total1 - 1620) / 421.39.
• Print to the serial port the values for "total1" and "level."
• Give the programme a 100 millisecond delay.

The CapacitiveSensor library is imported to provide functions for measuring capacitance on the
Arduino platform. A capacitive sensor object is created and initialized with pins 6 and 8 as input and output
pins respectively. A 100k resistor is connected between these two pins to discharge residual charge and
prevent interference. The autocalibration feature of the sensor channel is turned off in the setup function
and serial communication is started with a baud rate of 9600.

In the loop function, the capacitance of the sensor is measured by taking 30 samples using the
capacitiveSensor function. The measured capacitance is stored in the variable total1 and converted to a
level value using a formula specific to the sensor used. The values of total1 and level are printed to the
serial port and a 100ms delay is introduced to limit the data sent.

The loop function continuously repeats the process of measuring the capacitance and printing the
results, providing a real-time reading of the sensor output.

17
CHAPTER 4

CALIBRATION

SENSOR CALIBRATION

Sensor calibration is the process of adjusting a sensor's output so that it complies with an accepted
measurement or standard. Calibration's goal is to ensure the precision and dependability of sensor readings.
Calibration is frequently carried out to correct for drift or other alterations in the sensor's performance over
time.

Calibration Procedures:

In the process of calibrating a sensor, the sensor data are modified to match a recognised measurement or
standard. The steps below define a general procedure for calibrating a capacitive liquid level measurement
sensor:

1. Gather two metal plates of equal size, an established circuit, and an appropriate-sized container. Record
the liquid level in the container.

2. Measuring: Insert the sensor—two aluminium plates connected by an Arduino Uno circuit—into the
container of choice, and note readings of the capacitance value at various levels.

3. Compare the sensor's results to the liquid levels that are actually present as reported on the container.

4. Modify the formula used to calculate the liquid level in response to the comparison, or scale the sensor
values. Repeat steps 2 and 3 as necessary to get the sensor readings to match the levels that are recognised
to exist. It's important to keep in mind that the calibration procedure may need to be performed periodically
to account for changes in the sensor or its surroundings over time.

5. Confirmation: After calibration, measure the liquid level in the container once more to compare the
sensor's accuracy to known levels.

6. It's crucial to record the calibration procedure and the formula or scaling factor that is generated for later
usage.

18
RESULT OF CALIBRATION

Before calibration:

Liquid Level Reading


Actual Liquid Level (
Reading 1 Reading 2 Reading 3 Average Reading

3 8820.96 8781.4 8583.6 8728.65

8 18513.16 18532.94 18473.6 18506.56

13 28798.76 28739.42 28798.76 28778.98

Table 1: Data before calibration.

Graph 1: Water level increases as capacitance increasing before calibration.

The graphs and these data sets can be used to visualise the link between accurate height and
capacitance (here accurate height and average capacitance, nF). The graph below displays the relationship
between capacitance and liquid level.

The curve offers the closest relation between capacitance and liquid level by applying polynomial linear
regression to produce best curve fitting. Here, the relationship between capacitance and liquid level is

19
inversely proportional. The graph's equation, y = 421.39x + 1620, is comparable to the linear equation
Y=mX+C. Here, y stands for capacitance value and x for liquid level value. According to that calculation,
the sensor's sensitivity is 421.39 because that number represents the relationship between changes in
capacitance and liquid level. The liquid level measurement equation can also be derived from that equation
as a function of capacitance. The formula is,

Liquid Level Reading


Actual Liquid Level ( Error (%)
Reading 1 Reading 2 Reading 3 Average Reading

3 3.82 3.80 3.70 3.77 1.25%

8 8.72 8.73 8.70 8.71 8.77%

13 13.92 13.89 13.92 13.91 6.29%

Average Error 5.44%

Table 2: Data after calibration completed.

Graph 2: After calibration of capacitance sensor.

20
Figure 10: Arduino system coding.

21
CHAPTER 5

DISCUSSION

DISCUSSION ON THE CAPACITIVE SENSOR

The purpose of this project was to design an instrumentation system that measures liquid level
using capacitance. To receive input from the capacitance and compare it to the real liquid level, an Arduino
mini source code was created. 3 ml of water caused a considerable shift in the capacitance value, which
was observed throughout the testing phase to be associated with the amount of liquid added to the container.

However, it was also mentioned that the system's high resistance might have caused errors in the
capacitance readings. Environmental factors, such as body temperature, wind, and weather conditions,
further hampered the sensor's accuracy. The accuracy of the sensor was also negatively hampered by the
non-flat water container base and the metal top plate's exposure to the elements. Despite these drawbacks,
the calibration procedure' results shown that a person's hand can affect the capacitance value, highlighting
the potential of capacitance-based instrumentation systems. Even if there might be a few minor issues with
the sensor system, they can be fixed.

CONCLUSION

This project's goal was to create a capacitance-based instrumentation system for measuring liquid
level. During the project, we were challenged to create a source code for an Arduino mini that would receive
input from the capacitance and compare it to the actual level of the liquid.

One of the key observations during the testing phase was that adding just 3 ml of water caused a
noticeable change in the capacitance value. This change was consistently linked to the amount of liquid
added to the container. However, the high resistance of the system was identified as a potential source of
error in the capacitance readings. Environmental factors such as body temperature, wind, and weather
conditions further complicated the accuracy of the sensor.

Despite these setbacks, we were able to gain valuable insights into the limitations of capacitance-
based instrumentation systems. For example, the calibration results showed that a person's hand can have a

22
significant impact on the capacitance value. These findings demonstrate the potential of capacitance-based
instrumentation devices and highlight the importance of taking into account various factors that can affect
their accuracy.

Overall, this project provided us with a unique opportunity to apply what they had learned in a real-
world setting. Despite the challenges we faced, we able to persevere and gain a deeper understanding of the
complexities involved in designing a capacitance-based instrumentation system. This experience will serve
as a valuable reference for us in the future and help to further understanding of the practical applications of
capacitance-based instrumentation.

23

You might also like