DIY pH meter

Post the details about DIY Projects.
User avatar
saikumar
Aspiring Star of AquapetZ!
Aspiring Star of AquapetZ!
Posts: 974
Joined: Sat Nov 17, 2012 7:44 am
Location: Secunderabad(far from REZ)

DIY pH meter

Unread post by saikumar »

Heyllo, I was looking at one thread on Reefcentral, that looked dependable and dint need too much money to make one. So started to build, and its getting near to implement.
http://www.reefcentral.com/forums/showt ... p=16463909 :thumup


Need, was to display & monitor the pH continiously, to know whats to be done next to keep water stable. Also plan to add buzzer to sound when extreme is reached. May be in future can rig it to a calcium reactor or RO system to maintain pH.

Here is the progress so far, and to mention the thread from TeraHz that helped it all to make it happen. I just added a mini-Arduino on board(left side on circuit board) to make a display and do the alarm function, this addition made things easy as it increased the length of the wiring display 3 fold, so can have the probe in sump and display on tank hood. This arduino will basically do an Analog(pH voltage at probe) to digital(pH value on display) conversion.
Let me know if you got doubts anywhere.

The below was done in eagle scehmatics edited by me a bit.
Image

The boards coming out of fabrication house after lots of hassles. :boxing :boxing
Image


The components filling in, still way to go. Most of them are 1%-5% components, avoiding any reading swings by temperature. Same time price increased too much. But should be a good compromise
Image



Maintaining all pics on gallery below, cant risk losing them like the reflector pics :|
http://indianaquariumhobbyist.com/galle ... +pH+meter/


Still pending,
(a)the arduino code to do the A2D and display. (the easiest part diablo )
(b)Waiting for few components more.
(c) the pH probe itself, plan to get a lab grade one. Still thinking :cnf



Till then! takeca
Abhi
Promising Star of AquaPetZ!
Promising Star of AquaPetZ!
Posts: 2209
Joined: Sun Oct 16, 2011 6:28 am
Location: Gurgaon

Re: DIY pH meter

Unread post by Abhi »

Way to go !
MTS: Multiple tank syndrome !
User avatar
SCORPIO
Site Admin
Site Admin
Posts: 10376
Joined: Tue Oct 04, 2011 11:01 am
Location: Delhi, India
Contact:

Re: DIY pH meter

Unread post by SCORPIO »

I can appreciate only. You are really a Master of DIY Projects.
“Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. This is the way to success.”

...................Swami Vivekananda
syed.ali
Aspiring Star of AquapetZ!
Aspiring Star of AquapetZ!
Posts: 1156
Joined: Tue Oct 11, 2011 4:27 pm
Location: New Delhi

Re: DIY pH meter

Unread post by syed.ali »

OOOHHHH man this is some serious stuff, keep it coming
User avatar
saikumar
Aspiring Star of AquapetZ!
Aspiring Star of AquapetZ!
Posts: 974
Joined: Sat Nov 17, 2012 7:44 am
Location: Secunderabad(far from REZ)

Re: DIY pH meter

Unread post by saikumar »

Works beautifully this one. :dance goes smooth. Can extend my wiring to 5m appx.

Many thanks to Georgi from Reefcentral-Terahz for the quick debug of circuit. There is a bad connection to the 7809 in above PCB, need to cut and reroute it.

This is the code at Arduino on pH PCB

Code: Select all

#include <EasyTransfer.h>


//The pins 2=Rx,3=Tx


//create object
EasyTransfer ET; 
struct SEND_DATA_STRUCTURE{
  //put your variable definitions here for the data you want to send
  //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
  int val_ph_a;
  int val_ph_b;
};

//give a name to the group 
SEND_DATA_STRUCTURE mydata;

int analogPin = 5;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int val = 0;           // variable to store the analog value read

float val_ph=0;        //store the float multipled value
int i=0,j;

float val_ph_array[5]={0,0,0,0,0};
void setup()
{
  Serial.begin(9600);          //  setup serial
  //start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
  ET.begin(details(mydata), &Serial);
  
 
  
  for(j=0; j<20;j++)//run a few times before sending over serial, so that array is not blank
  {
  val = analogRead(analogPin);    // read the input pin
  if (i>4)
  i=0;
  val_ph_array[i]=val * 0.02;// calculate WRT voltage
  val_ph=float (val_ph_array[0] + val_ph_array[1] + val_ph_array[2] + val_ph_array[3] + val_ph_array[4])/5;//normalizing any of the error data
  i++;
  }
  

}
void loop()
{  

  val = analogRead(analogPin);    // read the input pin
  
  if (i>4)
  i=0;
  val_ph_array[i]=val * 0.02;// calculate WRT voltage
  val_ph=float (val_ph_array[0] + val_ph_array[1] + val_ph_array[2] + val_ph_array[3] + val_ph_array[4])/5;//normalizing any of the error data
  i++;
  
  mydata.val_ph_a=val_ph;
  mydata.val_ph_b=(val_ph- mydata.val_ph_a)*100;  
  Serial.println(val);     // debug value 
  ET.sendData(); 
  delay(1000); //send pH every 1sec to mother Arduino
}
This is the code at the mother Arduino

Code: Select all

#include <SoftEasyTransfer.h>

/*   For Arduino 1.0 and newer, do this:   */
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); //RX TX hard coded, not the main UARTs

/*   For Arduino 22 and older, do this:   */
//#include <NewSoftSerial.h>
//NewSoftSerial mySerial(2, 3);


//create object
SoftEasyTransfer ET; 

struct RECEIVE_DATA_STRUCTURE{
  //put your variable definitions here for the data you want to receive
  //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
  int tens_part;
  int deci_part;
};

//give a name to the group of data
RECEIVE_DATA_STRUCTURE mydata;

void setup(){
  mySerial.begin(9600);
  Serial.begin(9600);
  //start the library, pass in the data details and the name of the serial port.
  ET.begin(details(mydata), &mySerial);
  
  pinMode(13, OUTPUT);
  Serial.println("sjklads ghewre");
}

void loop(){
  //check and see if a data packet has come in. 
  if(ET.receiveData())
    {
      //this is how you access the variables. [name of the group].[variable name]
    //since we have data, we will blink it out. 
    /*for(int i = mydata.blinks; i>0; i--){
      digitalWrite(13, HIGH);
      delay(mydata.pause * 100);
      digitalWrite(13, LOW);
      delay(mydata.pause * 100);
    }*/
    
    Serial.print(mydata.tens_part);
    Serial.print(".");
    Serial.print(mydata.deci_part);
    Serial.println("");
  }
  //you should make this delay shorter then your transmit delay or else messages could be lost
  delay(250);
}

The "ORBIT-WHITE" part, super stable reading in somany readings.

Image

On left is the completed board, on right is the mother Arduino, and in center is the lab grade pH probe.
Image


Cheers! hope the code, diagrams and PCB helps someone to make yourself.

Good night! takeca
Last edited by saikumar on Thu Jun 06, 2013 12:51 am, edited 1 time in total.
prajjwal
Rising Star of AquaPetZ!
Rising Star of AquaPetZ!
Posts: 281
Joined: Tue Jan 10, 2012 3:52 pm
Location: Banga, Punjab

Re: DIY pH meter

Unread post by prajjwal »

toooooo tough to handle .... great going buddy....

keep 'em coming :)
jack
Moderator
Moderator
Posts: 2563
Joined: Mon Oct 17, 2011 4:28 pm
Location: Ahmedabad

Re: DIY pH meter

Unread post by jack »

Awesome....
Finally i am Broke but Happy :D
User avatar
saikumar
Aspiring Star of AquapetZ!
Aspiring Star of AquapetZ!
Posts: 974
Joined: Sat Nov 17, 2012 7:44 am
Location: Secunderabad(far from REZ)

Re: DIY pH meter

Unread post by saikumar »

Edited, can you guys see the above pics now? I attached reefcentral link directly, so not sure if it worked.
User avatar
SCORPIO
Site Admin
Site Admin
Posts: 10376
Joined: Tue Oct 04, 2011 11:01 am
Location: Delhi, India
Contact:

Re: DIY pH meter

Unread post by SCORPIO »

Not easy to made. Congratulations on your success.
“Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. This is the way to success.”

...................Swami Vivekananda
User avatar
saikumar
Aspiring Star of AquapetZ!
Aspiring Star of AquapetZ!
Posts: 974
Joined: Sat Nov 17, 2012 7:44 am
Location: Secunderabad(far from REZ)

Re: DIY pH meter

Unread post by saikumar »

SCORPIO wrote:Not easy to made. Congratulations on your success.
Thankyou sir. I feel the same when you grow plants in just normal substrate and glut, just like magician.
Cheers!
Post Reply