Multi-Parameter Measurement Station: Exploring Physics With Arduino
by miryusif1seyidov in Circuits > Arduino
6 Views, 0 Favorites, 0 Comments
Multi-Parameter Measurement Station: Exploring Physics With Arduino
Physics is all around us. We use it every day, even when we don't notice it. Distance, temperature, humidity, gas concentration, water, and motion are all connected to the physical world.
But how can we measure these quantities? Can we build one device that measures several of them at the same time?
That was the question behind our project!
We decided to build a Multi-Parameter Measurement Station, an Arduino-based system that uses multiple sensors to measure different physical quantities and display their values on a single LCD screen.
Our project measures distance, gas sensor response, water sensor response, temperature, humidity, and several other calculated quantities. It also calculates values such as velocity, acceleration, water vapor pressure, and dew point.
We wanted to do more than simply connect sensors. We wanted to understand the physics behind their measurements and see how mathematical formulas can turn electrical signals into useful information.
The device has a joystick-controlled menu, an LCD display, and a buzzer for alerts.
Let's build it!
1. How Does It Work?
Our measurement station has five main modes:
1. Air Measurements
- Temperature (°C)
- Temperature (K)
- Temperature (°F)
- Relative humidity (%)
- Absolute humidity (g/m³)
- Water vapor pressure (Pa)
- Dew point (°C)
2. Gas Measurements
- Estimated gas concentration (ppm)
- Relative sensor-based reading (%)
- Change in gas reading
- Rate of change (ppm/s)
- Gas detection warning
- Raw ADC value
3. Distance and Motion
- Distance (cm)
- Distance (m)
- Displacement (cm)
- Velocity (m/s)
- Acceleration (m/s²)
- Average velocity (m/s)
- Obstacle proximity
4. Water Measurements
- Relative water sensor reading (%)
- Raw ADC value
5. Measurement Differences
- Temperature difference
- Humidity difference
- Distance difference
- Average velocity
- Gas reading difference
- Gas reading rate
All these measurements are accessible through the joystick.
Supplies
Here are all the components and materials we used to build our Multi-Parameter Measurement Station.
Electronic Components
- 1 × Arduino Uno or compatible board
- 1 × 16×2 I2C LCD display
- 1 × DHT22 temperature and humidity sensor
- 1 × MQ-2 gas sensor module
- 1 × HC-SR04 ultrasonic distance sensor
- 1 × Analog water sensor
- 1 × Joystick module
- 1 × Piezo buzzer
Other Materials
- 1 × Breadboard
- Jumper wires (as needed)
- 1 × USB cable for Arduino
- 1 × Computer for programming
Software and Libraries
- Arduino IDE
- LiquidCrystal_I2C library
- DHT sensor library by Adafruit
- Adafruit Unified Sensor library
Note: The quantities listed are for one measurement station. Depending on your setup, you may need additional jumper wires or connectors.
Building the Measurement Station
We connected each component separately to make the wiring easier to understand.
Step 1: Connect the LCD Display
The LCD is the main interface of our project. It displays the measurements, menu names, sensor readings, and warnings.
We use a 16×2 LCD with an I2C module. This makes the wiring simpler because we only need two communication pins.
Connections:
- LCD GND → Arduino GND
- LCD VCC → Arduino 5V
- LCD SDA → Arduino SDA (A4 on Uno)
- LCD SCL → Arduino SCL (A5 on Uno)
Our LCD uses the I2C address 0x27.
After connecting it, we can display text and measurements on the screen.
Step 2: Connect the DHT22 Temperature and Humidity Sensor
The DHT22 measures the temperature and relative humidity of the surrounding air.
We use these two measurements to calculate additional values, including absolute humidity, water vapor pressure, and dew point.
Connections:
- DHT22 VCC → Arduino 5V
- DHT22 DATA → Digital pin 7
- DHT22 GND → Arduino GND
If you are using a bare four-pin DHT22 sensor instead of a breakout module, you may need a pull-up resistor between DATA and VCC.
After connecting it, the Arduino can read the temperature and humidity values.
Step 3: Connect the MQ-2 Gas Sensor
Next, we connect the MQ-2 gas sensor.
The MQ-2 is a semiconductor sensor that responds to certain combustible gases and smoke. Its electrical resistance changes depending on the surrounding gas conditions.
We use its analog output to read changes in the sensor signal.
Connections:
- MQ-2 VCC → Arduino 5V
- MQ-2 GND → Arduino GND
- MQ-2 AO → Arduino A3
We use the analog output (AO) to obtain raw readings.
The Arduino processes these readings using a calibration-based calculation to estimate gas concentration.
The program also includes a buzzer warning when the configured threshold is exceeded.
Important: The MQ-2 requires appropriate warm-up and calibration. Its displayed ppm values are estimates, not certified gas concentration measurements. Do not introduce combustible gases or smoke to test the sensor. This project is not a replacement for a certified gas detector.
Step 4: Connect the Ultrasonic Distance Sensor
Now we add the HC-SR04 ultrasonic sensor.
This sensor measures distance using sound waves. It sends an ultrasonic pulse and measures how long it takes for the echo to return.
Connections:
- HC-SR04 VCC → Arduino 5V
- HC-SR04 GND → Arduino GND
- HC-SR04 TRIG → Digital pin 4
- HC-SR04 ECHO → Digital pin 5
The Arduino calculates distance using the speed of sound and the measured travel time.
The basic formula is:
Distance = (Speed of Sound × Time) / 2
We divide by two because the sound travels to the object and then returns to the sensor.
Our program takes multiple readings and uses a median calculation to reduce the effect of occasional incorrect measurements.
It also uses consecutive distance readings to estimate displacement, velocity, and acceleration.
Step 5: Connect the Water Sensor
The water sensor detects changes in electrical conductivity across its sensing surface.
When water contacts the sensor, its analog output changes. The Arduino reads this signal and converts it into a relative percentage.
Connections:
- Water Sensor VCC → Arduino 5V
- Water Sensor GND → Arduino GND
- Water Sensor AO → Arduino A2
Our program uses two reference values:
- Dry reference: 0
- Wet reference: 600
These are initial calibration values and can be adjusted depending on the actual sensor.
The percentage is calculated using:
Water Percentage = (Raw Reading − Dry Reference) / (Wet Reference − Dry Reference) × 100
The result is limited to a range between 0% and 100%.
This percentage represents the relative sensor response, not the actual volume or height of water.
Step 6: Connect the Joystick
We use a joystick module to navigate through the different measurement modes.
Instead of adding several buttons, we can control the entire interface with one joystick.
Connections:
- Joystick VCC → Arduino 5V
- Joystick GND → Arduino GND
- Joystick VRx → Arduino A0
- Joystick VRy → Arduino A1
We use the X-axis to switch between the five main modes.
The Y-axis allows us to move between the individual measurement screens inside each mode.
For example, in the air mode, we can move through temperature, humidity, water vapor pressure, and dew point.
Step 7: Connect the Buzzer
The buzzer provides audible alerts.
It can warn us when the gas reading exceeds the configured threshold. It can also produce proximity alerts when an object approaches the ultrasonic sensor.
Connections:
- Buzzer positive (+) → Arduino Digital pin 9
- Buzzer negative (−) → Arduino GND
Our program uses the Arduino tone() function to control the buzzer.
A passive piezo buzzer is suitable for this connection. Check the electrical requirements of your particular buzzer module.
Step 8: Check All Connections
Before uploading the program, check everything carefully.
- Make sure all components have a common GND.
- Check the LCD SDA and SCL connections.
- Check that every sensor is connected to its assigned pin.
- Make sure there are no loose wires.
- Check the power requirements of each component.
- Keep water away from the Arduino and other electronics.
Now our hardware is ready!
Programming the Arduino
We programmed our measurement station using Arduino IDE and C++.
The program reads the sensors, processes the data, performs calculations, and updates the LCD.
Required Libraries
We use the following libraries:
- Wire.h – I2C communication.
- LiquidCrystal_I2C.h – LCD control.
- DHT.h – DHT22 sensor readings.
- math.h – Mathematical calculations.
How the Program Works
Sensor Reading
Each sensor is read at a suitable time interval.
For example, the DHT22 is updated every two seconds, while the water sensor is read more frequently.
Data Processing
Raw sensor readings are converted into useful values.
For example:
- The ultrasonic sensor converts echo time into distance.
- The DHT22 readings are used to calculate humidity-related quantities.
- The MQ-2 analog signal is processed using its calibration settings.
- The water sensor reading is converted into a relative percentage.
LCD Display
The LCD displays one measurement at a time.
The first row contains the measurement name and page number. The second row contains the value and its unit.
Joystick Control
The joystick changes the measurement mode and the individual screens.
Buzzer Alerts
The buzzer provides warnings according to the programmed gas and distance thresholds.
Uploading the Code
- Open Arduino IDE.
- Install the required libraries.
- Connect the Arduino to your computer.
- Select the correct Arduino board.
- Select the correct COM port.
- Open the complete Arduino program.
- Click Upload.
After uploading, the LCD should display the measurement station menu.
The Physics Behind Our Project
This is the most interesting part of the project!
Our device demonstrates several physical principles and mathematical relationships.
3.1 Distance and the Speed of Sound
The ultrasonic sensor uses sound waves to measure distance.
Sound travels through air at a speed that depends on temperature.
Our program estimates the speed of sound using:
c = 331.3 + 0.606 × T
Where:
- c = speed of sound in m/s.
- T = air temperature in °C.
This is why we use the DHT22 temperature reading in our distance calculation.
3.2 Temperature Conversion
We display temperature in three different units.
Celsius to Kelvin:
K = °C + 273.15
Celsius to Fahrenheit:
°F = (°C × 1.8) + 32
This demonstrates how the same physical quantity can be represented using different measurement scales.
3.3 Relative and Absolute Humidity
Relative humidity tells us how close the air is to saturation.
Absolute humidity describes the mass of water vapor in a given volume of air.
Our program calculates absolute humidity using temperature and relative humidity.
3.4 Water Vapor Pressure
Water vapor contributes to the total pressure of air.
We calculate the partial pressure of water vapor using temperature and relative humidity.
The program first calculates saturation vapor pressure and then uses relative humidity to estimate the actual water vapor pressure.
The final result is displayed in Pascals (Pa).
3.5 Dew Point and Condensation
The dew point is the temperature at which air becomes saturated with water vapor and condensation can begin.
For example, if the dew point is 8.1°C, cooling the air to approximately that temperature can cause condensation under the same moisture conditions.
This explains why water droplets can form on cold surfaces and why dew appears on grass in the morning.
3.6 Velocity and Acceleration
Our project also explores motion.
Velocity describes how quickly an object's position changes over time.
Velocity = Displacement / Time
Acceleration describes how quickly velocity changes over time.
Acceleration = Change in Velocity / Time
Our Arduino uses consecutive distance measurements to estimate these values.
Because sensor readings can fluctuate, these calculations are estimates rather than precision motion measurements.
3.7 Analog-to-Digital Conversion (ADC)
Most of our sensors produce analog electrical signals.
The Arduino converts these signals into digital values using its Analog-to-Digital Converter (ADC).
For a typical 10-bit Arduino Uno ADC:
- Minimum reading: 0
- Maximum reading: 1023
These numbers allow the program to process sensor signals mathematically.
Testing and Experiments
After building the station, we can explore several experiments.
Experiment 1: Measuring Distance
Place an object in front of the ultrasonic sensor.
Move it closer and farther away and observe how the distance reading changes.
You can also observe the estimated velocity and acceleration while moving the object.
Experiment 2: Observing Temperature and Humidity
Use the DHT22 to observe changes in temperature and humidity in different ordinary environments.
Compare the measurements and observe how the dew point and water vapor pressure change.
Experiment 3: Understanding Condensation
Compare the measured air temperature with the calculated dew point.
Explore how cooling air can bring it closer to saturation and lead to condensation.
Experiment 4: Water Sensor Response
Observe the raw ADC reading when the water sensor is dry and compare it with its reading when its sensing surface is exposed to water.
Use these readings to adjust the dry and wet calibration values.
Keep the Arduino and other electronics away from water.
Experiment 5: Understanding Gas Sensor Readings
Observe the MQ-2 sensor readings during normal warm-up and in clean surrounding air.
Notice how readings can change and why calibration and environmental conditions matter.
Do not introduce combustible gases or smoke as a home experiment.
Troubleshooting
Here are some problems you might encounter while building the project.
LCD does not display anything
- Check the SDA and SCL connections.
- Check the I2C address.
- Adjust the LCD contrast potentiometer.
DHT22 shows incorrect or missing readings
- Check the DATA pin.
- Check the power connections.
- Make sure the correct DHT22 library is installed.
- Allow the sensor to take readings at its recommended interval.
Distance sensor does not work
- Check the TRIG and ECHO connections.
- Make sure the sensor faces the object.
- Check that the object is within the sensor's operating range.
Water sensor percentage is incorrect
- Check the analog connection to A2.
- Adjust the dry and wet reference values.
- Remember that different water sensors can produce different ADC readings.
Gas readings are unstable
- Allow the sensor to warm up.
- Check the wiring and power supply.
- Make sure the sensor has been calibrated appropriately.
- Remember that the displayed values are estimates.
Joystick does not change screens
- Check A0 and A1.
- Check the 5V and GND connections.
- Make sure the joystick can return to its neutral position.
What We Learned
This project helped us understand how physics and electronics work together.
We learned that a sensor does not simply display a physical quantity. It detects a physical phenomenon, converts it into an electrical signal, and allows a microcontroller to process that signal.
We also explored mathematical relationships between different quantities.
For example:
- Distance measurements can be used to estimate velocity.
- Velocity measurements can be used to estimate acceleration.
- Temperature and humidity can be used to calculate water vapor pressure.
- Temperature and humidity can also be used to calculate dew point.
- Analog signals can be converted into digital values for processing.
Most importantly, we learned how to combine several different sensors into one working measurement system.
Future Improvements
There are still many ways to improve our project!
Some ideas for future versions include:
- Adding more sensors for additional physical quantities.
- Creating a larger display.
- Saving measurements to an SD card.
- Adding Bluetooth or Wi-Fi communication.
- Creating graphs of measurements over time.
- Improving sensor calibration and measurement accuracy.
- Designing a custom enclosure for the complete station.
We would especially like to add data logging so we can compare measurements over longer periods
Conclusion
Our Multi-Parameter Measurement Station is an educational project that combines physics, electronics, mathematics, and programming.
By bringing multiple sensors together, we created one device capable of measuring several physical quantities and calculating additional values.
It demonstrates that physics is not limited to equations in textbooks. We can use it to understand and measure the world around us.
We built this project to explore how different physical quantities work, how sensors detect them, and how an Arduino can turn their signals into meaningful information.
Thank you for reading our project! We hope it inspires you to experiment, build, and have fun with physics!