Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update for tempUnits, and more features. add Docs

  • Loading branch information...
commit bfc77ed98d8ab9553068530a52666ec365237049 1 parent 7a1e0ee
@snatchev authored
Showing with 68 additions and 0 deletions.
  1. +5 −0 Omega_PHH37.cpp
  2. +4 −0 Omega_PHH37.h
  3. +59 −0 README.md
View
5 Omega_PHH37.cpp
@@ -106,6 +106,11 @@ int Omega_PHH37::rangeCode()
return atoi(_range_code);
}
+int Omega_PHH37::displayMode()
+{
+ return Omega_PHH37_DisplayMode_mV;
+}
+
bool Omega_PHH37::validInput()
{
//Serial.println(_input);
View
4 Omega_PHH37.h
@@ -11,6 +11,9 @@
#include "Arduino.h"
+#define Omega_PHH37_DisplayMode_pH 0
+#define Omega_PHH37_DisplayMode_mV 1
+
class Omega_PHH37
{
public:
@@ -22,6 +25,7 @@ class Omega_PHH37
char tempUnits();
float pH();
int rangeCode();
+ int displayMode();
private:
char _input[64];
char _range_code[3];
View
59 README.md
@@ -0,0 +1,59 @@
+Arduino Omega PHH37 Library
+===
+
+This library communicates with the [Omega PHH-37 handheld pH meter](http://www.omega.com/pptst/PHH-37.html) over RS232
+
+Features
+---
+
+Read realtime (~1 sec sampling rate) data from device
+
+* pH
+* mV
+* temperature
+
+Installation
+---
+
+Place the source in your [Arduino libraries folder](http://arduino.cc/en/Guide/Libraries)
+
+MAX232 chip required for converting RS232 voltage to TTL.
+
+![schematic](http://3.bp.blogspot.com/_xBOs6PWgasI/THnpcjC5zHI/AAAAAAAAAMw/xG8d9NQjHys/s1600/schematic+max232.gif)
+
+_NOTE_: connect the PHH37 Rx/Tx wires to pins 0, 1 on the Arduino UNO.
+When uploading a new sketch, you must disconnect these two wires. Otherwise the sketch will not upload.
+
+Currently, this library only supports using Serial on the UNO.
+
+Examples
+---
+
+```arduino
+
+#include <Omega_PHH37.h>
+
+Omega_PHH37 Meter = Omega_PHH37();
+
+void setup()
+{
+ Meter.begin();
+}
+
+void loop()
+{
+ delay(1000);
+ if(Meter.read()) {
+ Serial.print("mV: ");
+ Serial.println(Meter.mV());
+ }
+ else {
+ Serial.println("could not get data");
+ }
+}
+```
+
+Protocol
+---
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.