PH-4502C pH Sensor Library for Proteus Simulation: an Arduino UNO V4.0, the PH-4502C module with its pH probe, an OLED and two LEDs

PH-4502C pH Sensor Library for Proteus Simulation

40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new PH-4502C pH Sensor Library for Proteus Simulation. pH tells you how acid or alkaline a liquid is, and it matters almost everywhere water does: in a hydroponic tank, an aquarium, a swimming pool, a brewery or a water treatment plant. The PH-4502C is the blue module most makers buy with their first pH probe - a glass electrode on a BNC plug and a small board that turns its millivolts into a voltage an Arduino can read. With this library you can run a full Proteus simulation of the module and its probe, so that your sketch and your calibration are ready before the real probe ever touches a liquid.

PH-4502C Proteus simulation demo: the Arduino UNO V4.0 reading a pH probe in two buffers and a hydroponic tank, the pH and its trend on the OLED, the OK and HIGH LEDs
Figure: The PH-4502C simulation running: the buffers, the tank, a nutrient dose and an acid dose.
Updates

PH-4502C pH Sensor Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

The module comes alive at run time: its PWR LED lights with the supply, the LIMIT LED follows the module's own comparator, and the glass bulb of the probe takes the colour of the solution it sits in, like a drop of universal indicator. The demo is a hydroponic pH monitor: an Arduino reads the probe in two calibration buffers and then in a nutrient tank, shows the pH with a trend and the plants' range on an OLED, and lights an OK or a HIGH LED.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the TDS meter board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the PH-4502C pH Sensor Library for Proteus Simulation:

PH-4502C pH Sensor Library for Proteus Simulation: an Arduino UNO V4.0, the PH-4502C module with its pH probe, an OLED and two LEDs
Figure: The PH-4502C pH Sensor Library for Proteus Simulation.

What is pH, and How Does a Glass Probe Measure It?

pH is a measure of the hydrogen ions in a liquid, on a scale from 0 to 14. Pure water sits at 7, neutral. Lemon juice and vinegar sit near 2 or 3 - acid - and soap or bleach at 10 or more - alkaline. The scale is logarithmic: one pH unit is a tenfold change, so pH 5 is ten times more acid than pH 6. A pH probe is a small battery whose voltage depends on that number. Its tip is a thin bulb of special glass; hydrogen ions on the outside and a buffer inside create a voltage across the glass, and a reference electrode in the same body closes the circuit. The voltage follows the Nernst equation: 59.16 mV per pH unit at 25 C, zero at pH 7, positive in acid and negative in alkaline liquids.

The PH-4502C module at a glance
PH-4502C module with a glass probe
Probea combination glass electrode on a BNC plug, pH 0 - 14
ElectrodeE = -59.16 mV x (pH - 7) at 25 C; the slope follows the absolute temperature
Po (pH out)2.50 V at pH 7 after calibration, about 0.18 V less per pH unit
Do (limit)a comparator with its own trimmer and LED
To (temperature)a thermistor on the board
Supply5 V, a few milliamps
Board32 x 42 mm: a BNC socket, two multi-turn trimmers, op-amps, a 6-pin header To, Do, Po, G, G, V+

Why the Module?

The probe's signal is tiny and its glass has an enormous resistance - hundreds of megohms - so connecting it straight to an Arduino pin would read nothing useful. The module buffers the probe with a high-impedance op-amp, multiplies its voltage and adds an offset, so pH 7 lands in the middle of the 0 - 5 V range and pH 4 and pH 10 sit comfortably on either side. In our model the gain is 3: 177.5 mV per pH unit at 25 C, so the pH 4.01 buffer reads 3.03 V and pH 9.18 reads 2.11 V.

Calibration

No two probes are exactly alike, and every probe changes as it ages, so a pH meter is always calibrated against buffers - liquids with a known, stable pH. The first point sets the offset: the probe in pH 7.00 buffer, and the trimmer next to the BNC turned until Po reads 2.50 V. The second point sets the slope: the probe in pH 4.01 buffer, its voltage noted. From then on the pH is a straight line through those two points. Our sketch keeps the two voltages as constants, and the model's ZERO property is the offset trimmer, so you can see what an uncalibrated meter does.

Temperature

The Nernst slope is proportional to the absolute temperature: 54.2 mV per pH at 0 C, 59.2 at 25 C and 64.1 at 50 C. A reading at pH 7 does not change at all, but the further from 7, the more the temperature matters - about 0.3 % per degree. The model follows this through its TEMP property, and the board's thermistor on To gives the sketch a temperature to work with.

Features of the PH-4502C pH Sensor Library for Proteus Simulation

  • A real-looking module: the blue board at its real size, 32 x 42 mm, with the BNC socket and the probe's plug, the two blue trimmers, the op-amps, the thermistor, the header and our small TEP mark - and the glass probe on its cable, drawn compact.
  • Animated: a PWR LED, the LIMIT LED driven by Do, and the probe's glass bulb in the colour of the solution's pH.
  • A real electrode: the Nernst voltage with its temperature slope, the module's gain and offset, a probe that takes time to settle and wanders in the air.
  • All three outputs: Po for the pH, Do from the limit comparator with hysteresis, To from the board's thermistor.
  • The trimmers as properties: ZERO (the offset at pH 7) and LIMIT (the comparator's pH), plus TEMP for the temperature.
  • A scene: two calibration buffers, then a hydroponic tank with a nutrient dose and an acid dose, plus chips for pH 4, 7 and 10 buffers, vinegar, tap water and the tank.
  • A pop-up: the probe in a beaker with the 0 - 14 scale, the pH and Po over the run, eight live tiles, graphs, an event log and a check page.
  • A complete package: about 2.3 MB with the library, our OLED, 5 mm LED and resistor libraries, our Arduino UNO V4.0 and the demo, without the source code of the model.

The PH-4502C in Proteus

The device is PH4502CTEP in TEPPH4502C.LIB, under Sensors > Liquid, with the prefix U and the model TEPPH4502C.DLL. Search PH4502C or pH in Pick Devices. Five pins along the bottom: To, Do, Po, G and V+ (the second G is drawn only). Its properties: PROFILE (DEMO or STEADY), PH (for STEADY), TEMP, ZERO and LIMIT. Our earlier, simpler pH Sensor Library for Proteus from 2021 is still there; this one is the PH-4502C module itself, with all three outputs.

PH-4502C pH sensor module with its glass probe from the PH-4502C Library for Proteus Simulation
Figure: The PH-4502C module and its probe.

Download PH-4502C pH Sensor Library for Proteus Simulation

Click the button below to download PH-4502C-pH-Sensor-Library-for-Proteus-v1.0.zip (about 2.3 MB, without the source code of the models):

PH-4502C pH Sensor Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPPH4502C.LIB, TEPOLED12864.LIB, TEPLED5MM.LIB, TEPRESISTOR.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPPH4502C.DLL, TEPOLED.DLL, TEPLED5MM.DLL, TEPRESISTOR.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (no extra library).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install PH-4502C pH Sensor Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPPH4502C.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for PH-4502C.

Proteus Simulation of a Hydroponic pH Monitor

In hydroponics the plants grow in water with their food dissolved in it, and the pH decides whether their roots can take that food up - most plants want pH 5.5 to 6.5. Our demo watches such a tank. U1 is the PH-4502C with PROFILE DEMO: the probe starts in pH 7.00 buffer, moves to pH 4.01 buffer at 3 seconds, and goes into the tank at pH 5.8 at 7 seconds. At 10 seconds a nutrient dose pushes the tank towards pH 6.9, and at 14 seconds an acid dose - a "pH down" - brings it back towards 6.0. Po goes to A0 of our Arduino UNO Library for Proteus V4.0, To to A1 and Do to D2. Our OLED SSD1306 Library for Proteus shows the readings, and two LEDs from our 5mm LED Library for Proteus sit beside it: OK (green, D5) and HIGH (red, D6), each through 220 ohm. The Arduino's built-in monitor is the same window as our TEP Serial Monitor Advance for Proteus. Open PH4502C-pH-ArduinoUnoV4.pdsprj.

PH-4502C simulation in Proteus: Arduino UNO V4.0, the PH-4502C module with its probe, an OLED and two LEDs on an A4 sheet
Figure: The whole simulation on an A4 sheet.

The Sketch

The sketch needs no library. Its calibration is two constants - the voltages measured in the two buffers - and the slope between them:

const float V7 = 2.50, V4 = 3.03;                           // the calibration: Po in the pH 7.00 and pH 4.01 buffers
const float SLOPE = (V4 - V7) / (4.01 - 7.00);              // volts per pH unit (negative: Po falls as the pH rises)

A pH probe's signal is small and a little noisy, so each reading is the average of 32 conversions:

  for (byte i = 0; i < 32; i++) sum += analogRead(pin);

Ten times a second the voltage becomes a pH on the calibration line:

    pH = 7.00 + (po - V7) / SLOPE;

The temperature comes from To: the board's 10 k thermistor against 10 k, turned into degrees with its B equation:

  return 1.0 / (1.0 / 298.15 + log(r / 10000.0) / 3950.0) - 273.15;

Do is read as a plain digital input and copied to the red LED, so the module's own comparator raises the alarm. The OLED shows the pH in double-size digits, ACID / NEUTRAL / ALKALINE, a 100-point trend from pH 2 to 10 with the plants' range dotted across it, and Po with the temperature at the bottom.

PH-4502C Simulation Results

Open the project and press Run. The demo runs 18.5 simulated seconds and took 189 seconds on our PC with the pop-up open and the pictures being taken. Click the module for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.

The Two Buffers

The probe starts in the pH 7.00 buffer, and that is exactly where a calibrated module reads its offset: Po 2.502 V, the electrode at +0.6 mV - a little noise around zero - and the monitor prints pH 7.00. pH 7.00 is above the module's limit of 6.50, so Do is high and the red HIGH LED is on from the first second; for plants this buffer would be too alkaline, and the sketch says so. At 3 seconds the probe is lifted out and rinsed; for 0.6 seconds it hangs in the air and its reading wanders, the way a real probe's does. At 3.6 seconds it dips into the pH 4.01 buffer: the bulb on the sheet turns orange, Do drops at 3.75 seconds, and the probe settles - 4.41, then 4.09, then 4.01 on the monitor. At 6.6 seconds the electrode gives +175.1 mV and Po reads 3.025 V; once settled the monitor shows "pH 4.01 Po 3.029 V", right on the second calibration point.

PH-4502C Proteus simulation pop-up: the probe in the pH 4.01 buffer, the beaker orange, Po at 3.03 V
Figure: The pH 4.01 buffer.

Into the Tank

At 7 seconds the probe is rinsed again and goes into the hydroponic tank at 7.6 seconds. The tank sits at pH 5.80 - comfortably inside the plants' range - and the reading climbs to meet it from the acid buffer: 5.53, then 5.72 on the monitor, 5.68 at 9.5 seconds with Po at 2.735 V. The green OK LED comes on, the bulb on the sheet turns yellow-green, and the OLED's trend line steps from the bottom of the plants' band into the middle of it.

A Nutrient Dose

At 10 seconds a nutrient dose goes into the tank. Fertiliser salts often push the pH up, and here it climbs towards 6.9: 6.08, then 6.46 on the monitor. At 12.2 seconds it passes the module's limit - the comparator flips, Do goes high at pH 6.55 (the limit plus its hysteresis), the LIMIT LED on the module and the red HIGH LED both light, and the monitor prints "Do HIGH: the pH is above the module's limit". At 13.8 seconds the probe reads 6.79 with Po at 2.536 V - only 12 mV from the electrode now, because the tank is close to neutral - and the sketch reports "too alkaline for the plants".

PH-4502C Proteus simulation: the OLED with the pH, its trend and the plants' range, the HIGH LED lit
Figure: The OLED: the pH and its trend.
The PH-4502C hydroponic pH monitor simulation running in the Proteus workspace with the Arduino UNO V4.0
Figure: The simulation in the workspace.
PH-4502C Proteus simulation pop-up: the tank above the limit after the nutrient dose, Do high
Figure: Above the limit.

An Acid Dose

At 14 seconds a "pH down" dose - a little acid - goes in, and the pH turns around: 6.59, then back below the limit at 15.4 seconds, where Do drops at pH 6.45 and the red LED goes out. The green LED comes back as the tank passes 6.5, and the reading settles towards 6.0: 6.32 at 16 seconds, 6.05 at 18.5 seconds with Po at 2.670 V and the electrode at +56.6 mV. That small loop - measure, dose, measure again - is all a pH controller does, and the trend on the OLED draws the whole story.

PH-4502C Proteus simulation pop-up: the tank back in the plants' range after the acid dose
Figure: Back in range.

The Graphs, the Event Log and the Check Page

The Graphs page plots the solution's pH, the pH at the probe, Po and Do. The Event log keeps every move of the probe, the doses and every change of Do. The Check page sums up the run: V+ 5.00 V; the probe in the hydroponic tank at pH 6.02, reading 6.05; Po 2.668 V = ZERO 2.50 V + 3 x E (+55.9 mV), so pH = 7 + (2.50 - Po) / 0.1775; Do low with the limit trimmer at pH 6.50; To 2.500 V for the thermistor at 25.0 C; and pH 4.03 to 7.00 at the probe during the run.

PH-4502C Proteus simulation graphs: the solution's pH, the probe's pH, Po and Do
Figure: The Graphs page.
PH-4502C Proteus simulation Event log: the buffers, the tank, the doses and Do
Figure: The Event log.
PH-4502C Proteus simulation Check page after the demo run
Figure: The Check page.

The monitor shows the sketch's side: the calibration, the limit changes and a line every second.

Arduino UNO V4.0 serial monitor in the PH-4502C Proteus simulation: the calibration and the pH readings
Figure: The monitor.

pH, TDS and Turbidity

pH is one of three numbers that describe water quality, and each needs its own sensor. Our TDS Meter Library for Proteus measures the dissolved salts - in hydroponics, how much food is in the tank - by its electrical conductivity. Our Turbidity Sensor Library for Proteus measures how cloudy the water is with light. pH tells you whether the plants can use what is dissolved. A good hydroponic controller watches pH and TDS together: nutrients raise the TDS and usually move the pH, and the pH-down dose brings it back.

Try It Yourself

  • Click pH 10: the beaker turns blue and Po falls to about 1.97 V.
  • Click Vinegar: pH 2.9, Po near 3.23 V, the bulb on the sheet turns orange-red.
  • Set ZERO to 2.45 V: every reading is off by about 0.28 pH - the offset of an uncalibrated meter.
  • Set TEMP to 50: pH 7 still reads 7, but the pH 4.01 buffer now gives a bigger voltage - the steeper slope.
  • Set LIMIT to 6.0: Do and the red LED switch earlier, a tighter alarm for the tank.

Ideas to Extend the Demo

  • Add two dosing pumps on relays - pH up and pH down - and hold the tank at 6.0.
  • Add a calibration mode: two buttons store the voltages of the two buffers in the EEPROM.
  • Log the pH and the TDS of the tank together every minute to an SD card.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real PH-4502C

  • Calibrate: pH 7.00 buffer and the offset trimmer for 2.50 V, then pH 4.01 buffer for the slope - and repeat every few weeks.
  • Patience: a real probe takes 10 to 60 seconds to settle; rinse it in distilled water between liquids.
  • Storage: keep the bulb wet in its cap with storage solution (3 M KCl); a dry bulb is slow and wrong, and distilled water ruins it.
  • A clean supply: Po moves with V+, so use a steady 5 V and keep pumps and motors on their own supply.
  • Isolation: in a tank with pumps and heaters, stray currents through the water can upset the reading - an isolated supply helps.

Troubleshooting

  • The pH is off by a fixed amount: the offset is wrong - recalibrate in pH 7.00 buffer.
  • The pH changes too little or too much: the slope is wrong - recalibrate with pH 4.01 buffer.
  • The reading drifts after a move: the probe is still settling - wait before you read.
  • Do never changes: the limit is outside the pH of your liquids.
  • The part is not simulated: TEPPH4502C.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The electrode follows the Nernst equation with its temperature slope; the module follows the usual PH-4502C circuit; the board is our own drawing, the probe drawn compact.
  • Our own choices: the gain of 3, the probe's 0.7 s response, the electrode noise, the thermistor's values, the hysteresis, the scene and the indicator colours.
  • Not modelled: the ageing of a probe (a slope below 100 %), the errors at the ends of the scale, the glass's impedance and the temperature change of the solution's own pH.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino or Labcenter.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the PH-4502C pH Sensor Library for Proteus Simulation. I hope it helps you build your hydroponic controller, your aquarium monitor or your pool tester before the real probe arrives - and shows that pH is a simple thing to read once you know the trick: a glass battery, a straight line, and two buffers to draw it. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation