pH sensor Library for proteus with Arduino UNO

pH Sensor Library for Proteus

Hi guys, I hope you are good and doing well in your life. In this article, I am going to tell you about a new pH Sensor Library for Proteus. I hope you all will enjoy it and find it useful. We are all well aware of pH Sensors which are used for detection of pH of different fluids. By knowing the pH of a liquid we can tell whether the liquid is acidic or basic. You can’t find a pH sensor in Proteus software, so we designed a pH sensor for simulation purposes. You can interface this pH Sensor with any Microcontroller, for example: Arduino, PIC Microcontroller, 8051 Microcontroller etc.

In this pH Sensor Library, I have added four different pH Sensors, which are used for detection of pH of any fluid. Since we can’t place real liquid and measure pH in this software, I have attached a test pin in the pH meter where you have to connect a potentiometer. Potentiometer will produce reading from 0 to 1023, which will be mapped from 0 to 14 in the program code. We can predict the nature of liquid. We will have a look at how to use these sensors below. So, here’s the list of all four pH sensors, I have added in this pH sensor library:

  • PH METER 2
  • PH METER 3
  • PH METER 4

So, let’s start with downloading and installing the pH Sensor Library for Proteus.

What is a pH Sensor?

  • A pH sensor is a device which is used to measure the pH value of a liquid. pH can be defined as the concentration of H+ ions in a liquid. We can find whether the fluid is acidic, basic or neutral by knowing the pH of liquid.

  • Real pH sensors are shown below:

pH Sensor

pH sensor Library for Proteus

  • First, download the zip file of Proteus Library for pHSensor. Click the link below to download the library.
  • After downloading the zip file, extract its files and open the folder named “Proteus Library Files“.
  • In this folder, you will find three files, named:
    • pHMeterLibraryTEP.IDX
    • pHMeterLibraryTEP.LIB
    • pHMeterLibraryTEP.HEX
  • We have to place these files in the ‘LIBRARY’ folder of Proteus software.
  • Now, open Proteus. if you are already working on it you have to restart it.
  • In the components search box, search for “PH METER” and you will get four results, as shown in the below figure:
  • Let’s place these four pH Meter models in our Proteus workspace.

Adding Hex File to the Sensor

  • Now we need to paste the hex file of the pH METER in the properties section of the sensor. Double click on the sensor to open the properties window.
  • Go to the program file section, browse to the hex file, which we have downloaded above and placed it in the ‘LIBRARY’ folder of Proteus software:
  • After adding the hex file, click the Ok button.
  • Now all is ready, let’s create a circuit to see its working.s

pH Sensor Proteus Simulation

  • The pH sensor is now ready to simulate in Proteus, so let’s design a simple circuit to understand its working:
  • As you can see, I have placed an LC filter on the analog output of the pH sensor, it’s because proteus gives us a peak to peak voltage value and we need to convert it to Vrms.
  • While performing the real experiment, you don’t need to do the above stuff.
  • Now, let’s run the Proteus simulation. You will see such a screen if everything will work fine.

Interfacing of pH sensor with Arduino UNO

  • Add Arduino UNO and pH sensor to the components list and place them to the workspace.

  • Placed an LC filter on the analog output of the pH sensor, as mentioned above. Connect it to the A0 pin of Arduino. Add a virtual terminal also to see the readings generated.

  • Paste the hex file of the program at the program file section of the Arduino.

You can get the code from the link below:

  • Results:

That is the end of the project. We hope you liked and understood it. Thanks for reading this article.

Contact - Tushar Gupta
Email -

For any kind of queries and doubts.pH METER Libarary.rar (64.1 KB)

1 Like


I have no experience with pH sensors, are they easy to get and expensive?

1 Like

They are cheap and easy to use. You can order them Online and Use with arduino.

1 Like

Thanks for the information Tushar. Probably I would look into in later to see if I can find some use for me, maybe I can use it to monitor the water quality in my fish tank? :grinning: