Re: MKS 901p
Posted: Sat Sep 09, 2017 5:50 am
All,
The 901P transducers are plentiful and cheap on Ebay right now, and I have been working with them the last month or so.
Bruce Meager's post on interfacing with RS232 was most helpful to me, since this is the first time I have used that interface.
I am using an Arduino to query the 901P about the present pressure, a small Oled to display the answer, and the code is very simple.
I am a hardware guy, not a programmer, so it can probably be made a lot fancier, but it seems to work so far, so what.....
Code at the end of this post.
A couble of warnings:
The TTL signal from the Arduino needs to be translated to RS232, and this is done by a MAX3232 chip. I did not know this at first and it cost me the RS232 functionality of a 901P, which stopped responding after it was connected to TTL RX/TX.
(Why a +-10V interface caves in @0-5V is beyond me)
Another thing, the Arduino becomes unresponsive to program upload when the MAX3232 is connected to the RX/TX ports, so you should disconnect it when you upload the code to the Arduino.
I intend to wrap the Oled, the Arduino into a small enclosure with the connector at the bottom, and a Lipo battery with associated charger/booster to form a compact transportable unit.
This is the pressure gauge to bring with you, when you go out to buy a new foreline pump.
Mounted in a fusor, the 3 built in relays with programmeable trip points could come in handy, for example, disable/enable power to diff/turbo pump at say 35 Microns. Operate the foreline vent to atmosphere valve and foreline valve, in the case of a power failure.
I have tested the code with a 999 Quattro and it works there as well.
The code:
-------------------------------------------------
//This program queries MKS 901P and 999 series pressure transducers about pressure, and displays the result on small Oled display.
// 09-09-2017 Finn Hammer
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
String sensorValue;
void setup()
{
Wire.begin();
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)(initializing the display)
Serial.begin(9600);
}
void displayPressure() {
Serial.print ("@254PR3?;FF");
sensorValue = Serial.readString();
sensorValue.remove(0, 7); //Remove the forst 7 caracters from @253ACK7.39E+2;FF to get 7.39E+2;FF
sensorValue.remove(7); //Remove caracters from the 7th, to get 7.39E+2
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.print("Foreline Pressure");
display.setTextSize(2);
display.setCursor(0, 12);
display.print(sensorValue);
display.setTextSize(1);
display.setCursor(98, 25);
display.print("Torr");
}
void loop()
{
displayPressure();
display.display();
}
The 901P transducers are plentiful and cheap on Ebay right now, and I have been working with them the last month or so.
Bruce Meager's post on interfacing with RS232 was most helpful to me, since this is the first time I have used that interface.
I am using an Arduino to query the 901P about the present pressure, a small Oled to display the answer, and the code is very simple.
I am a hardware guy, not a programmer, so it can probably be made a lot fancier, but it seems to work so far, so what.....
Code at the end of this post.
A couble of warnings:
The TTL signal from the Arduino needs to be translated to RS232, and this is done by a MAX3232 chip. I did not know this at first and it cost me the RS232 functionality of a 901P, which stopped responding after it was connected to TTL RX/TX.
(Why a +-10V interface caves in @0-5V is beyond me)
Another thing, the Arduino becomes unresponsive to program upload when the MAX3232 is connected to the RX/TX ports, so you should disconnect it when you upload the code to the Arduino.
I intend to wrap the Oled, the Arduino into a small enclosure with the connector at the bottom, and a Lipo battery with associated charger/booster to form a compact transportable unit.
This is the pressure gauge to bring with you, when you go out to buy a new foreline pump.
Mounted in a fusor, the 3 built in relays with programmeable trip points could come in handy, for example, disable/enable power to diff/turbo pump at say 35 Microns. Operate the foreline vent to atmosphere valve and foreline valve, in the case of a power failure.
I have tested the code with a 999 Quattro and it works there as well.
The code:
-------------------------------------------------
//This program queries MKS 901P and 999 series pressure transducers about pressure, and displays the result on small Oled display.
// 09-09-2017 Finn Hammer
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
String sensorValue;
void setup()
{
Wire.begin();
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)(initializing the display)
Serial.begin(9600);
}
void displayPressure() {
Serial.print ("@254PR3?;FF");
sensorValue = Serial.readString();
sensorValue.remove(0, 7); //Remove the forst 7 caracters from @253ACK7.39E+2;FF to get 7.39E+2;FF
sensorValue.remove(7); //Remove caracters from the 7th, to get 7.39E+2
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.print("Foreline Pressure");
display.setTextSize(2);
display.setCursor(0, 12);
display.print(sensorValue);
display.setTextSize(1);
display.setCursor(98, 25);
display.print("Torr");
}
void loop()
{
displayPressure();
display.display();
}