Sunday, April 25, 2010

pYpHpoT Python Script v0.1 released

Olá.

This post is about first release of the pYpHpoT python script. It is a simple python script that reads the data from the pHduino and plots and saves the data to a text file.

The Graphical User Interface (GUI)

Up to now, the data from the pHduino were presented in the serial terminal. A good serial terminal has an option to save the data to a text file. But, they can not plot them. So, I decided to write a very simple python script to plot and save the data.

I edited the GUI using a GUI editor called QtDesigner. I selected it because there is a plot widget ready to use in the GUI editor. All GUI code is in a separated text file. This approach makes a clean code and give us flexibility to change the GUI without modify the python script.

This is a screenshot of the GUI.


The program is very simple to use. First, connect the pHduino and turn it on. Second, starts the pYpHpoT script. Then, select the serial port and a file to save the data. Finally, press Start/Stop button. To stop, press it again.

You can not configure the pHduino using the pYpHpoT, yet. The pYpHpoT is only to read the strings from the serial port, plot, and save them.

I wrote a wiki about the pYpHpoT in the pHduino project.

http://code.google.com/p/phduino/wiki/pYpHpoTManual

Tips

Adjust the acquisition time to avoid huge data files. To do this, open a serial terminal and use the command interval_ms. Remember: temperature and pH are slow measurements.

The date and time format is the ISO 8601.
http://en.wikipedia.org/wiki/ISO_8601

Bye.

2 comments:

  1. Hi,
    Just wondering what PH probe do you use?
    Regards
    Tim

    ReplyDelete
  2. Hi,

    Basically, it is a pH glass electrode with an Ag/AgCl reference electrode integrated and a BNC connector. It is called pH combined electrode. Pay attention because there is the pH electrode without the reference electrode. It is called half cell and you need a reference electrode. We need the combined electrode.

    http://en.wikipedia.org/wiki/Glass_electrode

    There are a lot of brands, different prices and precisions on the Internet. Some electrodes has tips with different shapes for different applications. Make a search on the Internet. For example.

    http://us.mt.com/us/en/home/products/Laboratory_Analytics_Browse/Electrodes_family_page/ph_electrodes_family_page.html

    This is a big brand, but you can find cheap electrodes.

    This link has details about the electrode: use, calibration, storing, etc. It is a fragile sensor.

    http://www.ph-meter.info/pH-electrode

    This is a video showing how to use a analytical pH-meter. Before to use it, you need calibrate it. The pH sensor can not hold the calibration forever. Another point is the glass electrode works well between pH 2 to 10. Consult about acid error and alkali error.

    Calibration of a pH Meter
    http://www.youtube.com/watch?v=pAHsgUZbL1c

    I think with these links you will have a idea about the electrode.

    Greetings.

    ReplyDelete