In this project, we will be making a pH and salinity/conductivity monitoring system with LED indicators. The pH and salinity sensors from Atlas Scientific are used. Operation is via I2C protocol and readings are displayed on the Arduino serial monitor.
The LEDs are turned on if the sensor readings go out of the predefined limits. In this case, the limits are as follows: If the conductivity reading goes over 500 μS/cm, the yellow LED will turn on; if the pH reading goes over 10, the red LED will turn on. The use of LEDs offers a demonstration of how sensor readings can be used to trigger other hardware. You can modify this project to include other EZO sensors such as the temperature (RTD), oxidation-reduction potential (ORP) and dissolved oxygen (DO).
- Real-time pH and salinity readings.
- Can be expanded to include more types of Atlas's EZO sensors.
- Ability to use sensor readings to control other hardware.
- Minimum programming skills needed unless you plan on modifying the project.
Step 1: PRE-ASSEMBLY REQUIREMENTS
a) Calibrate the sensors. Each sensor has a unique calibration process. Refer to the following: pH calibration, salinity calibration. If you are using other sensors refer to their respective datasheet which can be found on the Atlas Scientific website.
b) Set sensors' protocol to I2C. Each sensor needs a unique I2C address. In accordance with the sample code for this project, the following addresses are used: pH sensor address is 99 and salinity sensor address is 100. For information on how to change between protocols and assign addresses, refer to this LINK.
The calibration and the switch to I2C MUST be done before implementing the sensors into this project.
Step 2: ASSEMBLE HARDWARE
Connect the hardware as shown in the schematic above.
The 220Ω resistors limit the current to the LEDs, preventing them from blowing out.
The Inline Voltage Isolator isolates the pH circuit from the salinity circuit, thus protecting it from any electrical interference (noise) that may originate from the salinity sensor. For more information on isolators refer to this LINK.
Step 3: LOAD PROGRAM ONTO ARDUINO
The code for this project makes use of a customized library and header file for the EZO circuits in I2C mode. You will have to add them to your Arduino IDE in order to use the code.
a) Download Ezo_I2c_lib, a zip folder from GitHub onto your computer.
b) On your computer, open the Arduino IDE (You can download the IDE from HERE if you do not have it). In the IDE, go to Sketch -> Include Library -> Add .ZIP Library -> Select the Ezo_I2c_lib folder you just downloaded. The appropriate files are now included.
c) Copy the code from pH_EC_led_indicator onto your IDE work panel. You can also access it from the Ezo_I2c_lib zip folder downloaded above.
e) In your IDE, go to Tools -> Serial Monitor or press Ctrl+Shift+M on your keyboard. The serial monitor will open. Set the baud rate to 115200 and select "Carriage return"
The pH and EC reading should now be outputting to the serial monitor.
Step 4: DEMONSTRATION
Summary of the experiment shown in the video:
- The initial pH and EC of water are measured.
- Some NaCl (salt) is added to the water, the conductivity reading rises and as soon as it crosses 500μS/cm the yellow LED turns on.
- Then some pH UP solution is poured into the beaker, the pH increases and upon crossing 10 and the red LED turns on.
- Finally, some pH DOWN solution is added and the pH decreases. When the reading is less than 10, the red LED turns off.