Hi, I am using an Arduino Uno and a Atlas pH sensor, and an Atlas pH circuit to detect the pH of a solution.
I'm not very good at programming and thought that the available code to me would work. I was hoping someone could guide me or at the very least show me the direction I should take. I'm not 100% sure that the Arduino is connecting to the EZO circuit. The code that I have used is the following.I have not received any error messages, but I do not get any output values.
On that note, I was hoping to have the code tell me the exact pH value given a solution. If someone could help me out I would be grateful.
The default baud is 38400 but the demo code uses 9600. I suggest changing the baud of serial line connecting to the sensor.
You should be able to type "R" and Enter to trigger the device to send you a reading.
There's wiring information in one of the links from the SparkFun product page.
PS Read the "How to Use Forum" sticky to learn to code tags. It's a lot easier to read code when code tags are used.
If you quote a post, you can usually see the tags used. Besides code tags, URL tags are also very useful so we can click on any link provided. Speaking of which, it's always a good idea to provide a link to the device you're asking about.
Edit: There is a lot involved in measuring pH accurately. I was very unimpressed with the Atlas user manual. I used to be a chemist and accurate pH measurement was an important part of my job.
If you can find a copy of "Sensors for the Evil Genius" (it's not worth buying the book like I did) there's a chapter on building your own pH meter. This chapter is just a cut and paste job from one of the chips' datasheet (and not complete) but it can give you an idea in what is involved in making an accurate meter. It was obvious the author never actually built a pH meter using his instructions since the instructions leave out important details (fortunately the details can be found the footnotes of the copied datasheet).
BTW, pH electrodes wear out kind of like batteries. They will often last about a year but I generally had to replace the ones I used very often about twice a year.
Calibration is very important and not just once a year as the manual states (I find it bewildering they would say this). For accurate measurements, you need to calibrate your meter every time you turn it on (or a couple of times a day if it's always on). There's a lot more to measuring pH than the Atlas manual would have you think.
doughboy:
did you try the sample sketch that atlas provides?
The code he posted is the sample sketch.
As mentioned above, the sample sketch does not use the default baud. I suspect this is the main reason DiegoALR wasn't able to communicate with the sensor.
(Waiting for the 10 minute limit to expire again.)
Chipped in on this subject (pH electrodes) before.
Comments on recalibrating quite correct, pH 4 and pH 10 used to be the standards to get the electrode slope right - eventually, even after careful storage (usually in a buffer solution), the electrode membane gets clagged. Don't forget it also needs temperature compensation to correct the output slope.
I used to build specific ion electrodes systems for industrial use (pH is simply a type of specific ion electrode, specific to hydrogen ions, others include fluoride and so on). The key requirement is to avoid ground loops and as close to electrode as you can get, convert the high impedance electrode output to a buffered low impedance one. On the high impedance side, use high quality TNC or BNC connectors, input shielding. My prefered op amp was MAX 406 or 407 - the 407 is dual amps so one can be used as a buffer with gain, say 10x and the other to offset as required.
This amp drew about 2.4 microamps, used a single sided supply (3.6-V lithium) and lasted about ten years in use.
The beauty of this technique was complete absence of ground loops and no requirements for specialised coax cable, in fact, once amp buffered, virtually any old cable, hundreds of metres long, could be used.
For what it's worth, capping the end of a standard pH electrode, putting a PTFE membrane (plumber's sealing tape works well) between the pH electrode and the sample, turns it into an ammonia electrode - all you need to do is add an alkali to the sample to convert ammonium salts into free ammonia.