Print

pH Sensor I2C w/ pH Probe

pH_Sensor_I2C_w__524a964a17c62.jpg
Notify Me
Rating: Not Rated Yet
Harga
Harga Jual : Rp.790.000

Deskripsi
Produk ini memiliki interface I2C, sehingga memudahkan penggunaan dan pengukuran. PH Sensor ini kompatible dengan Arduino maupun Raspberry, dan cocok digunakan untuk pengukuran PH sebuah cairan.

Spesifikasi 
Range pH : 0,1-14 (tingkat kepresisian 0.01)
Range Vin Voltage : 2,7 - 5.5V
Resolusi ADC : 12 bit


Contoh Sketch

#include <Wire.h>
#include 
#define Write_Check      0x1234

#define ADDRESS 0x4D // MCP3221 A5 I2C address

struct parameters_T
{
  unsigned int WriteCheck;
  int pH7Cal, pH4Cal;
  float pHStep;
} 
params;

float pH;
float vRef = 4.096;
void setup(){   Wire.begin(); //conects I2C   Serial.begin(9600);   eeprom_read_block(¶ms, (void *)0, sizeof(params));   Serial.println(params.pHStep);   if (params.WriteCheck != Write_Check){     reset_Params();   } } void loop(){   byte adc_high;   byte adc_low;   int adc_result;       Wire.requestFrom(ADDRESS, 2);    while(Wire.available() < 2);    adc_high = Wire.read();    adc_low = Wire.read();    adc_result = (adc_high * 256) + adc_low;    calcpH(adc_result);        if(Serial.available() )    {     char c = Serial.read();     if(c == 'C')     {       int calrange;       calrange = Serial.parseInt();       if( calrange == 4 ) calibratepH4(adc_result);       if( calrange == 7 ) calibratepH7(adc_result);     }     if(c == 'I')     {      eeprom_read_block(¶ms, (void *)0, sizeof(params));      Serial.print("pH 7 cal: ");      Serial.print(params.pH7Cal);      Serial.print(" | ");      Serial.print("pH 4 cal: ");      Serial.print(params.pH4Cal);      Serial.print(" | ");      Serial.print("pH probe slope: ");      Serial.println(params.pHStep);     }    }    Serial.print("pH: ");    Serial.print(pH);    Serial.print(" | ");    Serial.println(adc_result);    delay(1000); } void calibratepH7(int calnum) {   params.pH7Cal = calnum;   calcpHSlope();   eeprom_write_block(¶ms, (void *)0, sizeof(params)); } void calibratepH4(int calnum) {   params.pH4Cal = calnum;   calcpHSlope();   eeprom_write_block(¶ms, (void *)0, sizeof(params)); } void calcpHSlope () {    params.pHStep = ((((vRef*(float)(params.pH7Cal - params.pH4Cal))/4096)*1000)/5.25)/3; } void calcpH(int raw) {  float miliVolts = (((float)raw/4096)*vRef)*1000;  float temp = ((((vRef*(float)params.pH7Cal)/4096)*1000)- miliVolts)/5.25;  pH = 7-(temp/params.pHStep); } void reset_Params(void) {   params.WriteCheck = Write_Check;   params.pH7Cal = 2048;   params.pH4Cal = 1286;   params.pHStep = 59.16;   eeprom_write_block(¶ms, (void *)0, sizeof(params)); }

Tanggapan Para Makers

Belum ada review yang ditulis untuk produk ini

Gerai Cerdas

kreasi tanpa batas

Product & Services

Jual Arduino, Jasa Otomasi, Pelatihan, Laser Cutting, 3D Printing, Custom Devices

Sales

Arduino Robot SMS : 0878-0841-0761 sales@geraicerdas.com

Learning Center

Palem Ganda Asri Blok B/B10 No.9, Ciledug, Tangerang

Copyright 2014 by Gerai Cerdas- All rights reserved

Jasa Pembuatan Software