Friday, November 22, 2013

Arduino based display for HPT100 pressure gauge

The DPG101 controller of our HPT100 UHV gauge from Pfeiffer suddenly broke down, and buying a new one should take some money and time, so I decided to build one. The controller supplies 24V to the HPT100, and comunnicates with it by RS232 or  RS485. Those are just interfacing standards between UARTS, the real serial peripherals of microcontrollers or PCs and devices. After struggling for weeks  with my first PIC micro based display (with the XC8 compiler) for a Baratron, I moved to the popular arduino. The arduino project have made available a lot of useful libraries that make programming a microcontroller real easy, making possible finishing a prototype in a matter of hours. Here are the connections in the fritzing breadboard view:
The power supply used was a universal laptop power supply with 24 V and USB 5V outputs. Connect to the HPT 100 with a straight through serial cable. 
And here is the arduino sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(3,4,5,6,7,8,9,10,11,12,13);
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
String expo = "20";
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
// reserve 200 bytes for the inputString:
inputString.reserve(200);
lcd.print("Pressure");
}

void loop() {
lcd.setCursor(0, 1);
Serial.print("0010074002=?106\r");
if (stringComplete) {
// clear the string:
expo = inputString.substring(14,16);
int exponente=expo.toInt()-20;
lcd.print(inputString.charAt(10));
lcd.print(".");
lcd.print(inputString.substring(11,14));
lcd.print(" e");
lcd.print(exponente);
lcd.print(" mbar");
delay(1000);
inputString = "";
stringComplete = false;
}

}

void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = (char)Serial.read();
// add it to the inputString:
inputString += inChar;
// if the incoming character is a Cr, set a flag
// so the main loop can do something about it:
if (inChar == '\r') {
stringComplete = true;
}
}
}

The setpoints can also be easily implemented with relays, which is typically necessary to control vacuum systems. 
Here is the picture of the final display:
 



2 comments:

  1. Can you please upload same project using other microcontrollers like pic or any of your choice, which are easily available.

    ReplyDelete
  2. Great project!
    I used it as a reference to interface a Nucleo board to HPT-100. Could you please confirm the 24V polarity? As far as I understood, the supply voltage should be provided at pins 7 (negative) and 8 (positive), the same pins of the RS485 interface. Is it OK to connect pin 7 to common GND? Thank you!

    ReplyDelete