Water quality measurement using PH sensor with Raspberry Pi

Call for Price

Water quality measurement using PH sensor with Raspberry Pi

SKU: Water quality measurement using PH sensor with Raspberry Pi Category:

Description

ABSTRACT

Raspberry Pi based water quality measurement system uses a PH sensor for obtaining the water quality parameters. The single sensor which has the capability to provide you the different parameter such as PH level, water level, LDR for turbidity measurement and Temperature of the water. So by interfacing this sensor with Raspberry Pi serially to obtain every value. Each value gets decoded and split up using python programming. Water quality can be easily predicted using PH values. But with furthermore water parameters you can able to know the water quality by using this system.

HARDWARE REQUIRED

  • Raspberry Pi
  • SD card
  • Power supply
  • VGA to HDMI converter (Optional)
  • MCP3008 (ADC IC)
  • PH sensor

SOFTWARE REQUIRED

  • Raspbian Stretch OS      
  • SD card Formatter
  • Win32DiskImager (or) Etcher

PYTHON LIBRARIES USED

  • Time library (For Time delay)
  • Serial library for enabling serial communication to obtain values from PH sensor serially.

CODE

import serial
import time
port = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=1.0)


def value():
    x = 10
    for i in range(x):
        rcv = port.readline()

        if len(rcv) > 4:
            a = True
            break
    else:
        x = x + 1
    while a:
        value = rcv.split(',')
        # print value

        ph = value[0]
        w = value[1]
        l = value[2]
        t = value[3]
        __, ph = ph.split(':')
        __, w = w.split(':')
        __, l = l.split(':')
        __, t = t.split(':')
        ph = float(ph)
        w = float(w)
        l = float(l)
        t = float(t)
        a = False
        return ph, w, l, t
while True:
    print(value())
    time.sleep(2)

Additional information

Weight 0.000000 kg

Reviews

There are no reviews yet.

Be the first to review “Water quality measurement using PH sensor with Raspberry Pi”

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.