INPUT PH, WEIGHT, OD600 VALUES DIRECTLY INTO EXCEL USE A PASSIVE RS232 HUB

Aim

Most electronic laboratory devices equipped with RS232 (Serial) interface or a USB port however the manual does not provide you instructions how to correctly connect it to your PC or how to input values directly into programs like Excel. This procedure will show you how to connect your spectrophotometer, pH meter and analytical balance to a PC and also how to input OD600, pH and weight readings directly into Microsoft Excel.

[Best_Wordpress_Gallery id=”70″ gal_title=”passive rs232 hub”]

INTRODUCTION

What is RS232?

An RS-232 serial port was once a standard feature of a personal computer, used for connections to modemsprintersmice, data storage, uninterruptible power supplies, and other peripheral devices. However, RS-232, when compared to other serial interfaces such as RS-422, RS-485 and Ethernet, is hampered by low transmission speed, short maximum cable length, large voltage swing, large standard connectors, no multipoint capability and limited multidrop capability. In modern personal computers, USB has displaced RS-232 from most of its peripheral interface roles. Many computers no longer come equipped with RS-232 ports (although some motherboards come equipped with a COM port header that allows the user to install a bracket with a DE-9 port) and must use either an external USB-to-RS-232 converter or an internal expansion card with one or more serial ports to connect to RS-232 peripherals. Nevertheless, thanks to their simplicity and past ubiquity, RS-232 interfaces are still used particularly in industrial machines, networking equipment, and scientific instruments where a short-range, point-to-point, low-speed wired data connection is adequate.

 

What is a passive HUB?

An RS232 passive hub or simply hub is a network hardware device for connecting multiple RS232 devices together and making them act as a single network segment. It has multiple input/output (I/O) ports, in which a signal introduced at the input of any port appears at the output of every port except the original incoming.

 

1. What you need

  1. Passive RS232 HUB (designed by jFermi)
  2. DB9 RS232 Serial Null Modem Cable F/F
  3. DB9 RS232 Serial Modem Cable F/F
  4. DB9 RS232 Serial Null Modem Cable M/M
  5. High-Speed USB to Serial Adapter with CH340 (CH340 is a USB bus convert chip and it can realize USB convert to serial interface.)
  6. BC-Wedge

1.1  Passive RS232 HUB

Originally the RS232 standard was design to perform communication between a computer and only one device. In this special case when the communication only one-sided it is possible to connect the slaves Tx lines in case insert a rectifier (1N4007) after each slave Tx output. Only one slave can usefully talk at once. The master and the slave should be on the same ground. A dashed line means there is no connection between master and slave, but the possibility is given.

rs232hub

1.2  DB9 RS232 Serial Null Modem Cable F/F

Null modem  is a communication method to directly connect two DTEs (computerterminalprinter, etc.) using an RS-232 serial cable. The name stems from the historical use of RS-232 cables to connect two teleprinter devices to two modems in order to communicate with one another; null modem communication refers to using a crossed-over RS-232 cable to connect the teleprinters directly to one another without the modems. F/F means Female/Female.

null modem cable

 

1.3  DB9 RS232 Serial Modem Cable F/F

A straight-through cable is used to connect a DTE (Data Terminal Equipment) device to a DCE (Data Communications Equipment) device. The TXD-RXD and RTS-CTS pins are not cross-connected in this case, hence the term straight through cable.

modem cable

1.4  DB9 RS232 Serial Null Modem Cable M/M


Male to male cable.maletomale

 

1.5  High-Speed USB to Serial Adapter with CH340

All RS232 to USB converter cables require a driver to be installed in Windows in order to the cable to work. Typically the driver is provided on a CD with the cable and you normally install the driver first before you connect the cable to your PC for the first time. You will need to determine the COM port number that the device is connected to. The best way to do this is to look in the Windows Device Manager in the section labeled “Ports (COM & LPT)”. This section will contain a list of all COM ports that are installed on your PC.
rs232to usb

2. Connection establishement between the computer and devices

rs232 male female

• RS232 Serial Modem Cable F/F to establish a connection between HUB and the cell density meter
• RS232 Serial Null Modem Cable F/F to establish a connection between HUB and the pH meter
• DB9 RS232 Serial Null Modem Cable M/M  to establish a connection between HUB and the balance
• High-Speed USB to Serial Adapter to establish a connection between HUB and the computer. Master OUT.

 

3. Configure your devices

There are 3 devices what we would like to put on a same network. The specification contains every necessarily information about the serial configuration. The correct set points are:

Baudrate 9600
Data Bits 8
Parity none
Stop Bits 1

 

• 3510 Advanced Bench pH Meters
http://weblaboratorium.hu/wp-content/uploads/2017/07/3510_pH_meter_rev_C.pdf

• OHAUS analytical balance
http://weblaboratorium.hu/wp-content/uploads/2017/07/DV_DS_EN_80774266.pdf

• ULTROSPEC® 10 CELL DENSITY METER

 balance   spectro_pic  pH_meter_pic

 

4. Software Setup

Download and install the BC-Wedge software. Once you need to define the COM port that you find in a Windows Device Manager (Control panel/Device Manager). In this case COM14, yours probably different.

USB-Serial-CH340-COM14

 

BC-Wedge control panel is simple, select the COM14 from the drop-down menu. Check the box next to „Filter out non numerical character”. Finally select

{ENTER}

from “Postamble Keystroke(s)” menu.

Filter out non numerical character is important if you want to get only numbers into Excel.

Unfortunately the pH meter sends not only pH value but also temperature and date values. To get the correct value out of that, an Excel function must be used.

Before non-numerical character filtering the incoming data looks like this:

 

0011 *   6.33pH     23.2’C

 

After filtering you get this

 

00106.3323.3

 

So after you get this number into Excel, just use this function =MID(I29;5;4) to filter out the first 4 and the last 4 characters to obtain the real pH value 6,33.

bcwedge

 

After all, you need to specify the speed, number of data bits per character, parity, and number of stop bits per character. Use the following set points.

baudrate

If you have the correct communications parameters set in the BC-Wedge software, you should be able to see a weight reading in the text box labeled “Input Data From Scanner” when you press the Print button for example on your scale.

Once you are able to see data appear correctly in BC-Wedge, leave it running in the background and launch Microsoft Excel and put the cursor in a cell where you want your OD/pH/weight values to go and press the Print button on the spectrophotometer/pH meter/scale.

 

5. References

http://www.taltech.com/bcwedge

http://digital.ni.com/public.nsf/allkb/1EE0DD8AF67922FA86256F720071DECF

http://www.instructables.com/id/How-to-Connect-an-Electronic-Balance-or-Scale-to-a/

https://en.wikipedia.org/wiki/Null_modem

https://en.wikipedia.org/wiki/Cable_modem

http://weblaboratorium.hu/2017/01/07/sartorius-merleg-olvasasa-rs232-ttl-konverterrel/