Humidity Sensor of Graphite: Difference between revisions

From PC5271 wiki
Jump to navigationJump to search
Ruizhe (talk | contribs)
Ruizhe (talk | contribs)
 
(97 intermediate revisions by the same user not shown)
Line 10: Line 10:


In conclusion, carbon-based materials offer exciting prospects for future humidity sensing technologies. By continuously improving their physicochemical properties through nanotechnology and materials engineering, it is possible to develop sensors with greater sensitivity, faster response, and broader adaptability to complex humidity environments.
In conclusion, carbon-based materials offer exciting prospects for future humidity sensing technologies. By continuously improving their physicochemical properties through nanotechnology and materials engineering, it is possible to develop sensors with greater sensitivity, faster response, and broader adaptability to complex humidity environments.
== Experimental Principle==
In this experiment, a layer of graphite was coated onto paper-based substrates. The fiber paper is primarily composed of cellulose, consisting of long chains of glucose units containing hydroxyl (-OH) groups capable of attracting water molecules. When humidity increases, the hydroxyl groups form hydrogen bonds with water molecules, allowing cellulose to absorb moisture. This adsorption process causes the cellulose structure to expand, affecting the spacing and contact points between graphite particles on the surface.
The graphite layer on the paper was applied using a pencil and plays a crucial role in the humidity response of the sensor based on resistance changes. Graphite, composed of layers of carbon atoms and localized electrons, exhibits excellent electrical conductivity. In the resistive humidity sensor, the adsorption of water molecules modifies the graphite network because the adsorbed water molecules alter the connectivity between graphite particles.
Under low humidity conditions, electrical conduction mainly occurs through direct contact between graphite particles, and the sensor exhibits an intrinsic resistance <math>R_0</math>. As humidity rises, a thin layer of water molecules adsorbs onto the surface, initially forming a monolayer. During this monolayer adsorption, water molecules ionize according to:
<center><math>\mathrm{H_2O} \rightleftharpoons \mathrm{H^+} + \mathrm{OH^-}</math></center>
The generation of <math>\mathrm{H^+}</math> and <math>\mathrm{OH^-}</math> ions facilitates charge transport, enhancing the conductivity <math>\sigma</math> and thus decreasing the resistance according to:
<center><math>R = \frac{L}{\sigma A}</math></center>
where <math>L</math> is the effective length and <math>A</math> is the cross-sectional area through which conduction occurs.
As humidity further increases, multilayer adsorption takes place, increasing the thickness of the adsorbed water film. This thick water layer impacts the conductivity in two competing ways: on one hand, the increased number of ions continues to promote conducticonduction and decrease resistance; on the other hand, when the water layer becomes thick enough, it can act as an insulating barrier, interrupting direct electrical pathways between graphite particles and causing the resistance to rise. Thus, due to this competition, the sensor’s resistance exhibits a non-monotonic trend with increasing humidity—initially decreasing and subsequently increasing as the humidity surpasses a certain point.
Additionally, the porous structure of the paper significantly influences the sensor's response. Tiny voids within the cellulose fibers can trap water molecules, leading to localized moisture accumulation. This trapped moisture can either enhance ionic conductivity or disrupt the graphite network, depending on the amount and distribution of absorbed water. Consequently, microscopic changes in water content cause corresponding variations in the effective resistance of the sensor. However, because the evaporation of water trapped within micropores is relatively slow, the recovery time of the sensor may be prolonged after humidity levels drop.


== Objective ==
== Objective ==
<b>(1)</b> Build a a sealed drying chamber: use  
<b>(1)</b> Build a a sealed drying chamber: use a dry box; control the humidity by desiccants and hot water.
 
<b>(2)</b> Monitor the humidity with sensor: use DHT11 sensor to monitor the humidity and temperature inside the chamber; verify the range of humidity.
 
<b>(3)</b> Measure the resistance of Graphite sensor: use Arduino to measure the resistance; record the data with Python code.


<b>(2)</b> Compare the Performance of DHT11 and SHT31 Sensors in Different Environments: By simultaneously using the DHT11 and SHT31 sensors, compare the temperature and humidity data measured in both indoor and outdoor environments. Analyze the differences in measurement accuracy, stability, and response time between the two sensors.
<b>(4)</b> Data analysis: use Python code to do fitting; get the experimental relationship between Graphite's resistance and humidity; analyze the error.


<b>(3)</b> Explore the Practical Performance of the DHT11 Sensor: Focus on studying the performance of the DHT11 sensor in dynamically changing environments, particularly under conditions where temperature and humidity fluctuate significantly, and evaluate its suitability and reliability for practical applications.
== Equipment Required ==
=== DHT11 ===


<b>(4)</b> Optimize Sensor Selection and Application Scenarios: Based on the experimental results, identify the strengths and limitations of both DHT11 and SHT31 sensors, helping to choose the most appropriate sensor for different scenarios. This is particularly relevant for projects where cost is a factor, or where high precision is not the primary concern, and how to efficiently use the DHT11.
The DHT11 is a temperature and humidity composite sensor with calibrated digital signal output, suitable for measuring ambient temperature and humidity. It can be coded with Arduino. Here we use this sensor to get the standard humidity.


== Literature Review ==
==== Basic Specifications ====
Infrared spectroscopy is an established method for the quantitative analysis of ethanol concentration due to its non-destructive, rapid, and accurate measurement capabilities. The Beer-Lambert law is commonly employed for absorbance-based concentration analysis, linking the absorbance to concentration through known absorption characteristics of molecules, although it is not directly utilized in our approach.


Previous studies have extensively explored the application of FT-IR and FT-NIR spectroscopies for ethanol measurement. Mendes et al. (2003) utilized Fourier transform near-infrared (FT-NIR) and Fourier transform Raman (FT-Raman) spectrometries combined with partial least squares (PLS) regression to determine ethanol content in fuel ethanol and beverages. Their FT-NIR model showed a relative standard error of prediction as low as 0.04%, demonstrating the technique's potential for precise ethanol quantification in complex solutions, such as beverages containing sugars (Mendes et al., 2003).
{| class="wikitable" style="text-align:center; width:60%"
Similarly, Conklin et al. (2014) demonstrated the applicability of FT-IR spectroscopy for ethanol determination in gasoline, leveraging O-H and alkane C-H absorption bands to achieve accurate ethanol measurements. Their calibration methods provided linear, reliable results consistent with actual ethanol content values, emphasizing infrared spectroscopy's robustness for quantitative chemical analysis (Conklin et al., 2014).
|-
! Parameter
! Value
|-
| Temperature Range
| 0 – 50°C
|-
| Temperature Accuracy
| ±2°C
|-
| Humidity Range
| 20 – 90% RH
|-
| Humidity Accuracy
| ±5% RH
|-
| Sampling Period
| ≥ 1 second
|-
| Signal Output
| Digital (single-wire)
|}


Advancements in spectral data analysis have significantly enhanced the accuracy and efficiency of infrared spectroscopy. Zhao and Du (2016) introduced a spectral-spatial feature-based classification (SSFC) framework combining dimension reduction and deep learning. The approach integrated balanced local discriminant embedding (BLDE) for spectral feature extraction and convolutional neural networks (CNN) for spatial feature extraction, significantly outperforming traditional spectral analysis methods in classification accuracy (Zhao & Du, 2016).
=== Dry box and Desiccant ===
A dry box is a sealed container or cabinet designed to maintain a low-humidity environment to protect sensitive items from moisture. It often uses desiccants, electronic dehumidifiers, or nitrogen purging systems to control humidity levels. Dry boxes are commonly used for storing electronics, photographic equipment, laboratory samples, and moisture-sensitive materials to prevent damage such as corrosion, mold growth, or degradation.


Deep learning and machine learning techniques have also emerged prominently in recent spectral feature extraction and classification studies. Wang et al. (2017) proposed a new automated spectral feature extraction method based on deep neural networks, significantly reducing computational costs compared to conventional iterative optimization algorithms. Their method successfully extracted informative and non-redundant spectral features, applicable not only to spectral classification but also defective spectra recovery (Wang et al., 2017).
A desiccant is a material that absorbs moisture from its surroundings to maintain dryness and prevent damage caused by humidity. Common types include silica gel, calcium chloride, molecular sieves, and activated alumina, each suited for different humidity control needs. They typically work through physical adsorption or chemical reactions to capture water molecules from the air.


These studies collectively underline the effectiveness of combining infrared spectroscopy with advanced computational techniques such as PCA and machine learning methods. PCA, particularly, has become an established technique in spectral data analysis due to its capability of reducing dimensionality while preserving significant data variance. Moreover, modern approaches such as CNN and deep learning further enhance spectral analysis by automating feature extraction and improving classification accuracy, providing an effective framework for accurately identifying ethanol concentration in complex solutions.
The humidity in the lab is about 60%. The original drying function of dry box can only decrease it to 53% for one hour. We use the dry box as a sealed container to reduce humidity more quickly through the desiccant(about 40% in 15 mins). The humidity rising process is controlled by the hot water vapor.


In short, integrating infrared spectroscopy with sophisticated computational methods offers promising avenues for precise, rapid, and non-contact ethanol concentration measurement, significantly surpassing traditional measurement techniques regarding accuracy, efficiency, and operational convenience.
<center>[[File:Desiccant.jpg|400px]]</center>
<center>'''Dry box and Desiccant'''</center>


== Principles ==
=== Arduino ===
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It consists of microcontroller boards that can read inputs. In this project, we connect it with DHT11 sensor to read the outputs. Arduino also provides 5V output, we use this as the voltage output of a resistor circuit.


[[File:Alcohol6.png|left|180px|Ethanol structure]]
== Equipment Steps ==
===Humidity Controlling System===


To provide a controlled and stable humidity environment for testing experimental samples, we designed a sealed drying chamber. Desiccants were placed inside the chamber to absorb moisture from the air and maintain a low-humidity state. After the humidity is stable, we place a cup of hot water inside the dry box to raise the humidity.


Alcohol molecules exhibit distinct absorption characteristics in the infrared spectrum due to the vibrational modes of specific functional groups, particularly the hydroxyl (-OH) and methyl (-CH₃) groups. These groups interact with infrared light at specific wavelengths, leading to unique absorption peaks that can be utilized for concentration measurement.
===Fabrication of Graphite Humidity Sensor===
We selected the pencil as the source of graphite and applied it across the entire surface of a rectangle paper through coating. Try to keep the graphite layer flat during this process The paper is adhered to a cardboard substrate, which provided stable support to prevent deformation to the paper during testing. We clamp both ends of the paper with clips and connect the sensor to the external circuit
<center>[[File:S1.jpg|400px]]</center>
<center>'''Graphite Humidity Sensor'''</center>


In the near-infrared (NIR) region, the wavelength range between 1250 nm and 1350 nm is particularly sensitive to ethanol concentration. Notably, around 1300 nm, ethanol demonstrates significant variations in absorption intensity that correlate directly with its concentration. This is primarily due to the overtone and combination vibrations of the C-H and O-H bonds, which result in measurable absorption differences as ethanol content changes.
===Measurement System===
We used an Arduino board to connect the circuit and sensors, receiving digital signals through Arduino software. Python was used to extract and process the signals in real time, simulating the output voltage of the test sample and reading the actual humidity from the reference sensor (DHT11).


By analyzing these absorption variations, it is possible to accurately determine alcohol concentration in a given sample. The wavelength of 1300 nm is chosen as the optimal measurement wavelength because it provides a clear and distinguishable response to ethanol concentration changes.
We also use the Arduino as the power supply for resistance measurement circuit. The circuit is shown in the picture below. R0 is the standard resistance. R1 is our sensor and we measure the voltage drop between the sensor. The total voltage Arduino provides is 5V. The resistance of sensor can be calculated by:
<center><math>R_1 = \frac{V}{5-V} \times R_0</math></center>
<center>[[File:Measurement_circuit.jpg|400px]]</center>
<center>'''Measurement Circuit'''</center>


== Objective ==
The overall setup:
<center>[[File:Setup_1.jpg|400px]]</center>
<center>'''Measurement Circuit'''</center>
We write the Arduino code to get the each parameters' output and use Python code to record these in a text file.
 
Arduino code:
#include <DHT.h>
#define DHTPIN A5
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
const int HumiditySensorPin = A0;
int sensorValue = 0;
void setup() {
  Serial.begin(9600);
  dht.begin();
}
void loop() {
  sensorValue = analogRead(HumiditySensorPin);
  float voltage = sensorValue * (5.0 / 1023.0);
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  Serial.print("Light Sensor Value: ");
  Serial.print(sensorValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage);
  Serial.println("V");
  Serial.print("Humidity Value: ");
  Serial.println(h);
  Serial.print("T:");
  Serial.println(t);
  delay(5000);
}
 
Python Code:
import serial
import time
import serial
ser = serial.Serial('COM3', 9600)
file_path = r"D:\arduino\final\data_cooling.txt"
file = open(file_path, "w")
while True:
  data = ser.read()
  if data:
    file.write(data.decode('utf-8'))
    file.flush()
 
== Results ==
During the measurement, we record the outputs every 5s. The humidity value, read from DHT11, changes much slower than this time interval. This ensure sufficient dynamic response information was collected. Several voltage value will be recorded for one humidity value. During our data analysis, we use the average of voltage to plot the figures.
===Decrease Humidity===
First we analyze the resistance during we dry the box with desiccant. This process with last for about 15 mins to decrease the humidity to about 40%. As this process develops quickly, each humidity value only last for few recording rounds. In general, the Graphite Sensor's resistance decreases with the humidity decreasing, which is consistent with the Reference. The curve shows nearly linear relationship with humidity. However the curve is rough and there are serval lifting turning points in the curve. We attributes it to the unstable Graphite Sensor state(long response time). The linear relationship is not the correct.
[[File:Decrease_2.jpg|center|thumb|R Curve with Humidity]]
 
===Raise Humidity===
After the humidity finally stable around 40%(the lowest humidity we can get in our system), we put a cup of hot water into the dry box to increase the humidity. This enables us to raise the humidity up to 85% with a relatively slow speed. The curve is shown below:
<center>[[File:Raise.jpg|400px]]</center>
<center>'''Raise Humidity'''</center>
 
We can see that in general the resistance still increases with humidity. The curve is more smooth compared to decreasing process. This attributes to a longer duration for each humidity value. The Graphite sensor can fully response. However there are still lift turning points below 50% humidity and above 80%. For below 50%, we attribute to the open-door process to put the water inside. This will quickly raise the humidity and make the air in box unstable. The may cause the turning points as the measured humidity is not the real humidity value which Graphite Sensor experiences. For above 80% part, we assume it is over the Graphite Sensor's measurement range.
 
Based on the assumption above, we do fitting to investigate the relationship between humidity and resistance. The fitting formula is:
<center><math>y = A e^{- \frac{x}{t}} + B</math></center>
where:
* <math>y</math> represents the resistance,
* <math>x</math> represents the humidity,
* <math>A</math>, <math>B</math>, and <math>t</math> are fitting parameters.
 
The fitting range is from 50% to 80% humidity.
<center>[[File:Fitting.jpg|400px]]</center>
<center>'''Fitting'''</center>
 
The result shows a good fitting with R^2=0.995. We expect this as the R-H relationship for the Graphite Sensor.
 
===Comparison between S1 and S2===
In the above discussion, we mainly use one sample. We now prepare another Graphite Sensor sample to verify the conclusion. This Sensor has different length compared with S1. This leads to a different resistance range. The R-H curve shows  the similar relationship. Below 50% humidity, there is lots of turning points. We do the fitting between 50 to 80% humidity. The result shows R^2=0.997. In conclusion, the exponential function satisfies the R-H curve well.
<center>[[File:Comparsion.jpg|400px]]</center>
<center>'''Comparison between S1 and S2'''</center>
 
==Discussion==
This study demonstrated the humidity sensitivity of pencil graphite sensors, highlighting their potential for reliable humidity monitoring. The results indicated that the resistance of conventional graphite sensors increased with humidity. Data fitting was applied to establish functional relationships that convert sensor resistance into relative humidity values.
 
===Error Analysis===
In our fitting range, there are still tiny turning points. Beyond the influence of opening the door, we now discuss about possible reasons behind this.


This experiment proposes a non-contact alcohol concentration measurement method by using infrared spectroscopy. This method measures changes in infrared light intensity transmitted through alcohol solutions, using a spectrometer and principal component analysis to achieve high precision measurements.
<b>(1)</b> When we deal with humidity, we need to pay attention to temperature. Temperature significantly affects the accuracy of humidity sensor measurements. As temperature rises, the saturation vapor pressure increases, leading to lower relative humidity for the same amount of water vapor. Additionally, most humidity sensors, such as capacitive or resistive types, exhibit inherent temperature sensitivity, causing potential drift or slower response.


[[File:Transmittance-Diagram-1024x447.png|center|thumb|Schematic Diagram of the Experiment]]
DHT11 can give the temperature, with <math>\pm 5\ ^\circ \mathrm{C}</math> error. In our Arduino Code, we also record the temperature. It turns out the temperature output shows tiny shift during measurement. The range is between 21.8 to 23.0. This is mainly caused by hot water vapor. This may influence the sensor response.


== Advantages of Infrared-Based Alcohol Detection ==
<b>(2)</b> In the resistance measurement, we use Arduino as the power source. The signal we measure in Arduino is initially shown ass an integer from 0 to 1023. Discrete values limits the sensibility of our resistance measurement. Meanwhile, the 5V output is not stable. We record the voltage between '5V' and 'GND' link on Arduino. The output will shift between 1021 to 1023. The possible reason is Arduino is supplied by the USB interface of our computer. This will influence the resistance calculation.


* '''Non-contact measurement''', reducing contamination.
==Reference==
* '''High accuracy''', based on alcohol-specific infrared absorption characteristics.
[1]A. E. Dessler and S. C. Sherwood, “A matter of humidity,” Science 323,1020–1021 (2009).
* '''Low cost''', with simple photodetection devices.


== Equipment Required ==
[2]L. Zipser, H. Franke, and W.-D. Bretschneider, “Robust acoustic humidity sensor for industrial drying,” in SENSORS, 2004 IEEE (IEEE, 2004) pp.107–110.
*Different concentration of ethanol
*Cuvette
*LAMBDA 850 Spectrometer


== Experiment Set Up ==
[3]S. A. Imam, A. Choudhary, and V. K. Sachan, “Design issues for wireless sensor networks and smart humidity sensors for precision agriculture: A review,” in 2015 International Conference on Soft Computing Techniques and Implementations (ICSCTI) (IEEE, 2015) pp. 181–187.
The LAMBDA 850+ UV-Visible-NIR spectrophotometer used for measurements is capable of precise spectral measurements within the wavelength range of 800 nm to 1400 nm, making it suitable for analyzing the absorption characteristics of substances such as alcohol molecules. The device is equipped with both a deuterium lamp and a tungsten-halogen lamp, providing UV and visible/near-infrared light sources, respectively. The high-quality master-engraved holographic grating monochromator ensures precise wavelength control, guaranteeing high-resolution spectral measurements.


The core of the device includes a high-sensitivity R6872 photomultiplier tube (PMT) detector, ensuring accurate signal collection across a broad wavelength range from UV to near-infrared. In the analysis of the effect of alcohol concentration changes on absorption intensity, the LAMBDA 850+ provides high sensitivity and precise measurements.
[4]Y. Wu, Q. Huang, J. Nie, J. Liang, N. Joshi, T. Hayasaka, S. Zhao, M. Zhang, X. Wang, and L. Lin, “All-carbon based flexible humidity sensor,” Journal of Nanoscience and Nanotechnology 19, 5310–5316 (2019).


With this high sensitivity and precision configuration, it provides strong support for the optical property analysis of solutions such as alcohol, especially excelling in peak absorption location and concentration variation analysis.
[5]P. Zhu, Y. Liu, Z. Fang, Y. Kuang, Y. Zhang, C. Peng, and G. Chen, “Flexible and highly sensitive humidity sensor based on cellulose nanofibers and carbon nanotube composite film,” Langmuir 35, 4834–4842 (2019).
[[File:Alcohol01.jpg|center|600px|thumb|Spectrometer Schematic Diagram]]
== Experiment Procedures ==
*Preparation of alcohol solutions at concentrations of 25%, 50% and 75%.  
[[File:ALCOHOL2.jpeg|center|thumb|Ethanol Sample Preparation]]
[[File:ALCOHOL.jpg|center|thumb|Ethanol Sample]]
*Measurement of absorption using spectrometer.
[[File:Alcoholtool.jpeg|center|thumb|Spectrometer]]
*Use Origin software for spectral normalization and baseline correction, and process the alcohol spectra at three different concentrations.(Due to the subtle differences in the spectral data, it is difficult for non-experts to visually distinguish between the spectra of the three alcohol concentrations. Therefore, machine learning-based Principal Component Analysis (PCA) is applied for spectral classification, enabling accurate measurement of alcohol concentration.)


== Data Analysis ==
[6]https://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/

Latest revision as of 09:55, 29 April 2025

Team Member

Xu Ruizhe, Ma Shunyu, Li Zerui, Wei Heyi

Introduction

Humidity sensors play an essential role in fields such as environmental monitoring, industrial process control, agriculture, and healthcare, where accurate humidity measurements are critical. High-quality sensors are necessary to precisely track humidity levels and variations. Traditionally, materials like metal oxides and polymers have been used, but they often suffer from limitations including slow response times, low sensitivity, and limited accuracy.

In recent years, carbon-based materials have gained significant interest due to their unique physical and chemical properties. They offer remarkable features such as high surface area, excellent electrical conductivity, and strong chemical stability across various environments. These advantages make carbon materials highly promising for developing sensitive and reliable humidity sensors. For instance, carbon nanotubes (CNTs) enhance sensor response speed thanks to their large surface area and porosity, while graphene provides ultra-fast signal transduction owing to its thin structure and superior conductivity. Other forms like carbon black and carbon fiber show strong resistance to humidity-induced degradation, ensuring long-term operational stability.

The humidity sensing capability of carbon-based materials largely stems from their interaction with water molecules. Changes in humidity cause adsorption or desorption of water on the material surface, altering properties such as resistance or capacitance. Sensor performance can further be tailored by adjusting material morphology or engineering defects.

In conclusion, carbon-based materials offer exciting prospects for future humidity sensing technologies. By continuously improving their physicochemical properties through nanotechnology and materials engineering, it is possible to develop sensors with greater sensitivity, faster response, and broader adaptability to complex humidity environments.

Experimental Principle

In this experiment, a layer of graphite was coated onto paper-based substrates. The fiber paper is primarily composed of cellulose, consisting of long chains of glucose units containing hydroxyl (-OH) groups capable of attracting water molecules. When humidity increases, the hydroxyl groups form hydrogen bonds with water molecules, allowing cellulose to absorb moisture. This adsorption process causes the cellulose structure to expand, affecting the spacing and contact points between graphite particles on the surface.

The graphite layer on the paper was applied using a pencil and plays a crucial role in the humidity response of the sensor based on resistance changes. Graphite, composed of layers of carbon atoms and localized electrons, exhibits excellent electrical conductivity. In the resistive humidity sensor, the adsorption of water molecules modifies the graphite network because the adsorbed water molecules alter the connectivity between graphite particles.

Under low humidity conditions, electrical conduction mainly occurs through direct contact between graphite particles, and the sensor exhibits an intrinsic resistance R0. As humidity rises, a thin layer of water molecules adsorbs onto the surface, initially forming a monolayer. During this monolayer adsorption, water molecules ionize according to:

H2OH++OH

The generation of H+ and OH ions facilitates charge transport, enhancing the conductivity σ and thus decreasing the resistance according to:

R=LσA

where L is the effective length and A is the cross-sectional area through which conduction occurs.

As humidity further increases, multilayer adsorption takes place, increasing the thickness of the adsorbed water film. This thick water layer impacts the conductivity in two competing ways: on one hand, the increased number of ions continues to promote conducticonduction and decrease resistance; on the other hand, when the water layer becomes thick enough, it can act as an insulating barrier, interrupting direct electrical pathways between graphite particles and causing the resistance to rise. Thus, due to this competition, the sensor’s resistance exhibits a non-monotonic trend with increasing humidity—initially decreasing and subsequently increasing as the humidity surpasses a certain point.

Additionally, the porous structure of the paper significantly influences the sensor's response. Tiny voids within the cellulose fibers can trap water molecules, leading to localized moisture accumulation. This trapped moisture can either enhance ionic conductivity or disrupt the graphite network, depending on the amount and distribution of absorbed water. Consequently, microscopic changes in water content cause corresponding variations in the effective resistance of the sensor. However, because the evaporation of water trapped within micropores is relatively slow, the recovery time of the sensor may be prolonged after humidity levels drop.

Objective

(1) Build a a sealed drying chamber: use a dry box; control the humidity by desiccants and hot water.

(2) Monitor the humidity with sensor: use DHT11 sensor to monitor the humidity and temperature inside the chamber; verify the range of humidity.

(3) Measure the resistance of Graphite sensor: use Arduino to measure the resistance; record the data with Python code.

(4) Data analysis: use Python code to do fitting; get the experimental relationship between Graphite's resistance and humidity; analyze the error.

Equipment Required

DHT11

The DHT11 is a temperature and humidity composite sensor with calibrated digital signal output, suitable for measuring ambient temperature and humidity. It can be coded with Arduino. Here we use this sensor to get the standard humidity.

Basic Specifications

Parameter Value
Temperature Range 0 – 50°C
Temperature Accuracy ±2°C
Humidity Range 20 – 90% RH
Humidity Accuracy ±5% RH
Sampling Period ≥ 1 second
Signal Output Digital (single-wire)

Dry box and Desiccant

A dry box is a sealed container or cabinet designed to maintain a low-humidity environment to protect sensitive items from moisture. It often uses desiccants, electronic dehumidifiers, or nitrogen purging systems to control humidity levels. Dry boxes are commonly used for storing electronics, photographic equipment, laboratory samples, and moisture-sensitive materials to prevent damage such as corrosion, mold growth, or degradation.

A desiccant is a material that absorbs moisture from its surroundings to maintain dryness and prevent damage caused by humidity. Common types include silica gel, calcium chloride, molecular sieves, and activated alumina, each suited for different humidity control needs. They typically work through physical adsorption or chemical reactions to capture water molecules from the air.

The humidity in the lab is about 60%. The original drying function of dry box can only decrease it to 53% for one hour. We use the dry box as a sealed container to reduce humidity more quickly through the desiccant(about 40% in 15 mins). The humidity rising process is controlled by the hot water vapor.

Dry box and Desiccant

Arduino

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It consists of microcontroller boards that can read inputs. In this project, we connect it with DHT11 sensor to read the outputs. Arduino also provides 5V output, we use this as the voltage output of a resistor circuit.

Equipment Steps

Humidity Controlling System

To provide a controlled and stable humidity environment for testing experimental samples, we designed a sealed drying chamber. Desiccants were placed inside the chamber to absorb moisture from the air and maintain a low-humidity state. After the humidity is stable, we place a cup of hot water inside the dry box to raise the humidity.

Fabrication of Graphite Humidity Sensor

We selected the pencil as the source of graphite and applied it across the entire surface of a rectangle paper through coating. Try to keep the graphite layer flat during this process The paper is adhered to a cardboard substrate, which provided stable support to prevent deformation to the paper during testing. We clamp both ends of the paper with clips and connect the sensor to the external circuit

Graphite Humidity Sensor

Measurement System

We used an Arduino board to connect the circuit and sensors, receiving digital signals through Arduino software. Python was used to extract and process the signals in real time, simulating the output voltage of the test sample and reading the actual humidity from the reference sensor (DHT11).

We also use the Arduino as the power supply for resistance measurement circuit. The circuit is shown in the picture below. R0 is the standard resistance. R1 is our sensor and we measure the voltage drop between the sensor. The total voltage Arduino provides is 5V. The resistance of sensor can be calculated by:

R1=V5V×R0
Measurement Circuit

The overall setup:

Measurement Circuit

We write the Arduino code to get the each parameters' output and use Python code to record these in a text file.

Arduino code:

#include <DHT.h>
#define DHTPIN A5
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
const int HumiditySensorPin = A0; 
int sensorValue = 0;
void setup() {
  Serial.begin(9600); 
  dht.begin();
}
void loop() {
  sensorValue = analogRead(HumiditySensorPin); 
  float voltage = sensorValue * (5.0 / 1023.0); 
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  Serial.print("Light Sensor Value: ");
  Serial.print(sensorValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage);
  Serial.println("V");
  Serial.print("Humidity Value: ");
  Serial.println(h);
  Serial.print("T:");
  Serial.println(t);
  delay(5000); 
}

Python Code:

import serial
import time
import serial
ser = serial.Serial('COM3', 9600)
file_path = r"D:\arduino\final\data_cooling.txt"
file = open(file_path, "w")
while True:
  data = ser.read()
  if data:
    file.write(data.decode('utf-8'))
    file.flush()

Results

During the measurement, we record the outputs every 5s. The humidity value, read from DHT11, changes much slower than this time interval. This ensure sufficient dynamic response information was collected. Several voltage value will be recorded for one humidity value. During our data analysis, we use the average of voltage to plot the figures.

Decrease Humidity

First we analyze the resistance during we dry the box with desiccant. This process with last for about 15 mins to decrease the humidity to about 40%. As this process develops quickly, each humidity value only last for few recording rounds. In general, the Graphite Sensor's resistance decreases with the humidity decreasing, which is consistent with the Reference. The curve shows nearly linear relationship with humidity. However the curve is rough and there are serval lifting turning points in the curve. We attributes it to the unstable Graphite Sensor state(long response time). The linear relationship is not the correct.

R Curve with Humidity

Raise Humidity

After the humidity finally stable around 40%(the lowest humidity we can get in our system), we put a cup of hot water into the dry box to increase the humidity. This enables us to raise the humidity up to 85% with a relatively slow speed. The curve is shown below:

Raise Humidity

We can see that in general the resistance still increases with humidity. The curve is more smooth compared to decreasing process. This attributes to a longer duration for each humidity value. The Graphite sensor can fully response. However there are still lift turning points below 50% humidity and above 80%. For below 50%, we attribute to the open-door process to put the water inside. This will quickly raise the humidity and make the air in box unstable. The may cause the turning points as the measured humidity is not the real humidity value which Graphite Sensor experiences. For above 80% part, we assume it is over the Graphite Sensor's measurement range.

Based on the assumption above, we do fitting to investigate the relationship between humidity and resistance. The fitting formula is:

y=Aext+B

where:

  • y represents the resistance,
  • x represents the humidity,
  • A, B, and t are fitting parameters.

The fitting range is from 50% to 80% humidity.

Fitting

The result shows a good fitting with R^2=0.995. We expect this as the R-H relationship for the Graphite Sensor.

Comparison between S1 and S2

In the above discussion, we mainly use one sample. We now prepare another Graphite Sensor sample to verify the conclusion. This Sensor has different length compared with S1. This leads to a different resistance range. The R-H curve shows the similar relationship. Below 50% humidity, there is lots of turning points. We do the fitting between 50 to 80% humidity. The result shows R^2=0.997. In conclusion, the exponential function satisfies the R-H curve well.

Comparison between S1 and S2

Discussion

This study demonstrated the humidity sensitivity of pencil graphite sensors, highlighting their potential for reliable humidity monitoring. The results indicated that the resistance of conventional graphite sensors increased with humidity. Data fitting was applied to establish functional relationships that convert sensor resistance into relative humidity values.

Error Analysis

In our fitting range, there are still tiny turning points. Beyond the influence of opening the door, we now discuss about possible reasons behind this.

(1) When we deal with humidity, we need to pay attention to temperature. Temperature significantly affects the accuracy of humidity sensor measurements. As temperature rises, the saturation vapor pressure increases, leading to lower relative humidity for the same amount of water vapor. Additionally, most humidity sensors, such as capacitive or resistive types, exhibit inherent temperature sensitivity, causing potential drift or slower response.

DHT11 can give the temperature, with ±5C error. In our Arduino Code, we also record the temperature. It turns out the temperature output shows tiny shift during measurement. The range is between 21.8 to 23.0. This is mainly caused by hot water vapor. This may influence the sensor response.

(2) In the resistance measurement, we use Arduino as the power source. The signal we measure in Arduino is initially shown ass an integer from 0 to 1023. Discrete values limits the sensibility of our resistance measurement. Meanwhile, the 5V output is not stable. We record the voltage between '5V' and 'GND' link on Arduino. The output will shift between 1021 to 1023. The possible reason is Arduino is supplied by the USB interface of our computer. This will influence the resistance calculation.

Reference

[1]A. E. Dessler and S. C. Sherwood, “A matter of humidity,” Science 323,1020–1021 (2009).

[2]L. Zipser, H. Franke, and W.-D. Bretschneider, “Robust acoustic humidity sensor for industrial drying,” in SENSORS, 2004 IEEE (IEEE, 2004) pp.107–110.

[3]S. A. Imam, A. Choudhary, and V. K. Sachan, “Design issues for wireless sensor networks and smart humidity sensors for precision agriculture: A review,” in 2015 International Conference on Soft Computing Techniques and Implementations (ICSCTI) (IEEE, 2015) pp. 181–187.

[4]Y. Wu, Q. Huang, J. Nie, J. Liang, N. Joshi, T. Hayasaka, S. Zhao, M. Zhang, X. Wang, and L. Lin, “All-carbon based flexible humidity sensor,” Journal of Nanoscience and Nanotechnology 19, 5310–5316 (2019).

[5]P. Zhu, Y. Liu, Z. Fang, Y. Kuang, Y. Zhang, C. Peng, and G. Chen, “Flexible and highly sensitive humidity sensor based on cellulose nanofibers and carbon nanotube composite film,” Langmuir 35, 4834–4842 (2019).

[6]https://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/