Omega HH506RA Serial Protocol

March 22, 2010 | Embedded Software

Today I had to figure out how to read temperature from an Omega HH506RA thermocouple signal conditioner/datalogger. The HH506RA is a nice little unit that reads temperature from two thermocouples (type K, J, N, T, R, S, or E). It can display the temperature on its LCD screen and communicate them to a PC over RS232 or USB. The PC connection is optically isolated, which is very nice because RS232 and USB are both notorious for causing noise problems via ground loops.

I've put information on how to communicate with the unit up here for future reference.

I found some information on an NI forum and on Matlab's file exchange site.. The info on the NI site is a bit hard to read and not quite correct, so here's a quick and clear rundown.

Serial Port Setup

If you're using the USB cable, its actually just a virtual serial port, which will likely show up on your PC as COM1 to COM4. If you're using the RS232 cable, then obviously you need a serial port on the PC. Either way, you need to set the serial port up for 2400 baud, 7 data bits, even parity, 1 stop bit, and no flow control.

Communication Overview

To read the temperatures from the unit, send this string over the serial port: #001Nrn. r means the carriage return character (ASCII 13). n means the newline character (ASCII 10). You'll get back a string that follows this pattern:  TTTTt TTTTtABrn. The first and second  TTTTt groups represent the temperature and thermocouple type for the first and second thermocouple. The AB section is some miscellaneous information.

Temperature

The  TTTT part will be a hexadecimal string representing the temperature in tenths of a degree Celcius. For example,  017A represents 37.8 degrees Celcius. If the number is negative, it will start with a minus sign instead of a space. For example -00C2 means -19.4 degrees C.

Thermocouple Type

The t part represents the thermocouple type (set using the buttons on the HH506RA). The codes go as follows:

Code Type
0 K
1 J
2 T
3 E
4 N
5 R
6 S

Miscellaneous Info

According to the document on the NI site, the A digit above represents Celcius/Fahrenheit while the B character represents battery. I've only ever seen them as 0 in my testing.

Example

Bringing it all together:
You send: #001Nrn
You receive: -00B20 02C1200rn
Decoding: The first thermocouple is a type K that is reading -17.8 degrees C. The second thermocouple is a type T reading 70.5 degrees C.

Errors

If you send a bad command, you'll get a a response of Errrn. I've found that to be a handy way to resynchronize communication in case something goes wrong. Just send rn and read for a response until you see Errrn. Once you get that response, you know the unit is ready to accept a command again.

Other Commands

The document on the NI forum has some additional details. For example, you can read the unit's ID with the command %IDRrn. The ID is the set of digits you send in the read temperature command #001Nrn. You can change the unit's ID so that it responds to #005Nrn by sending a command along the lines of %001I005rn. I don't really see the point of this, so I haven't bothered testing it. The unit can log data, which can then be read back with the command #001Srn.