Lab set Program-7
7. Develop a program to read the pH value of a various substances like milk, lime and water.
Objective
To develop a program that reads and classifies the pH value of various substances such as milk, lime water, and pure water using Arduino.
(Simulated using a potentiometer in Tinkercad since the actual pH sensor is unavailable.)
Learning Outcomes
After completing this experiment, students will be able to:
-
Understand how a pH sensor works and its output behavior.
-
Simulate sensor readings in Tinkercad using analog components.
-
Map analog readings to real-world pH ranges (acidic, neutral, basic).
-
Write Arduino code for data classification and serial monitoring.
Components (from Tinkercad Palette)
-
Arduino Uno board
-
Potentiometer (as pH sensor)
-
3 LEDs (Red = Acidic, Green = Neutral, Blue = Basic)
-
220 Ω resistors × 3
-
Breadboard
-
Jumper wires
Circuit Wiring (Exact)
-
Potentiometer (pH Sensor substitute)
-
One outer leg → 5 V
-
Other outer leg → GND
-
Middle pin → A0
-
-
LEDs
-
Red LED → Pin 9 (through 220 Ω resistor to GND)
-
Green LED → Pin 10 (through 220 Ω resistor to GND)
-
Blue LED → Pin 11 (through 220 Ω resistor to GND)
Arduino Sketch
How It Works
-
The potentiometer simulates different pH levels:
-
Turning it left → low analog value → acidic.
-
Middle position → around neutral (7).
-
Turning right → high value → basic.
-
-
Arduino reads analog values from A0 (0–1023) and maps them to pH 0–14.
-
The corresponding LED lights up:
-
Red → Acidic (e.g., milk, lemon juice)
-
Green → Neutral (e.g., pure water)
-
Blue → Basic (e.g., lime water, soap solution)
-
-
pH values are displayed on the Serial Monitor.
Common Mistakes & Quick Fixes
| Issue | Cause | Fix |
|---|---|---|
| LEDs not glowing | Missing resistor or wrong pin mapping | Verify wiring and resistors |
| pH readings unstable | Loose breadboard connection | Re-insert jumper wires |
| Wrong LED lighting | Reversed LED polarity | Longer leg → digital pin side |
Viva / Check-Your-Understanding
-
What is the pH range of acidic, neutral, and basic substances?
-
What is the function of a pH sensor?
-
How did we simulate the pH sensor in Tinkercad?
-
What are typical pH values of milk, water, and lime water?
Extensions (Mini-Tasks)
-
Display the pH value on an LCD instead of Serial Monitor.
-
Use a buzzer to alert when the sample is too acidic or too basic.
-
Expand to detect more categories (strong acid, weak acid, etc.).
Lab Record (Suggested Headings)
-
Title
-
Objective
-
Components Used
-
Circuit Diagram (Tinkercad screenshot)
-
Arduino Code
-
Output / Simulation Result
-
Viva Questions & Answers
-
Extensions

Comments
Post a Comment