Bariho Logger

Based on my recent project, I have an idea to implement Horiba sensor for more simple uses. The idea are to make the sensor can be used, the reading can be monitored, and the data can be saved for further analysis. Even though combination of Horiba controller and sensor can do these actions, there is a need for the actions to be interfaced with PC or notebook. By interfacing the sensor set to the PC or notebook, more features and displays can be enhanced. Especially on notebook, such a simple software can simplify data monitoring and processing, at the same time it still keep portability of the sensor.

The requirement are quite simple on my idea. The researcher needs single sampling, online monitoring, graph, and feature to export data to excel, rich text format, .pdf, or even database for further process. Based on some studies on D-55 controller manual, I found that it is possible for this controller to be interfaced to PC or notebook over RS232 communication.

I try to use some Horiba commands and implemented over VB.net programming in Visual Studio. For those that already familiar with serial communication in Visual Studio, the following items are some important commands that can be used:

a. To open connection with the controller

Dim str As String = “C,OL,1[CR][LF]” + vbNewLine
Dim buffer() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
serialPortA.Write(buffer, 0, buffer.Length)

b. To select which sensor that need to be accessed

(pH sensor on Channel 1)

Dim str As String = “C,PH,1[CR][LF]” + vbNewLine
Dim buffer() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
serialPortA.Write(buffer, 0, buffer.Length)

(DO sensor on Channel 2)

Dim str As String = “C,DO,2[CR][LF]” + vbNewLine
Dim buffer() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
serialPortA.Write(buffer, 0, buffer.Length)

(ORP sensor on Channel 1)

Dim str As String = “C,MV,1[CR][LF]” + vbNewLine
Dim buffer() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
serialPortA.Write(buffer, 0, buffer.Length)

c. To read the sensor data

Dim str As String = “R,MD[CR][LF]” + vbNewLine
Dim buffer() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
serialPortA.Write(buffer, 0, buffer.Length)

Based on my experience, some suggestions in implementing the coding are:

1. We should make some command to be sent periodically if there are error or no response from the controller. This suggestion is also mentioned in D-55 manual.

2. We should do some string parsing procedure to obtain the sensor data from sequence of string that received from the controller. In single sampling, we can take sensor data along with the tempature data. In my case, I use this following coding:

For i = 0 To total_data – 1
data_sensor = data_sensor + newdata(i)
Next

Dim parsed As String() = Nothing

parsed = data_sensor.Split(“,”)

ReDim Preserve sensorA_pH(sensorA_pHindex)
sensorA_pH(sensorA_pHindex) = parsed(13).Trim(” “)

Label_temperature.Text = parsed(17).Trim(” “) + “‘C”

3. We should turn off the power saving mode in the controller if we want to do the continuous monitoring for over 30 minutes. Procedure to turn off the mode is provided in the manual.

4. To do continuous monitoring, just place the code in Timer object for specific interval. However, do not set too small interval since the controller need time to process and respond the command.

5. To connect the Horiba controller to PC or note book, we should buy one serial cable P/N :9096004800 and one serial to USB converter. The configuration of the sensor set is illustrated as follows.

Drawing1

As follows, there are preview of software interface that have been developed. It is called Bariho Logger. The Bariho is derived from Horiba but with reverse reading. HO-RI-BA –> BA-RI-HO. 😀

1

Connection form

2

Main monitoring interface

3

Monitoring on progress

4

Monitoring is finished

5

pH data result

6

DO data result

Currently, the Bariho Logger support for only two sensor in single controller. In the next version, I planned to support more selection of sensors and more than one controllers.

Advertisements

One thought on “Bariho Logger”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s