An interface to the MKS 901P transducer

Every fusor and fusion system seems to need a vacuum. This area is for detailed discussion of vacuum systems, materials, gauging, etc. related to fusor or fusion research.
Post Reply
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

An interface to the MKS 901P transducer

Post by Finn Hammer »

All,

Edit: 07-10-2017, I have updated the view of the gerbers, as well as the gerber file.rar to a version where there is no dip switch to isolate the TTL/RS232 module during code upload.

How to communicate with the 901P has been covered in detail in this thread, which you should read for background:
viewtopic.php?f=10&t=11533
so I will skip that, and go straight to the build:
The final product looks like this:
The finished article. I found that the Pro Mini was not disturbed by the TTL/RS232 converter during upload of the code, as was the Arduino Duemilanove and the Nano, so the red dip switch can probably be omitted.
The finished article. I found that the Pro Mini was not disturbed by the TTL/RS232 converter during upload of the code, as was the Arduino Duemilanove and the Nano, so the red dip switch can probably be omitted.
And from the back side. you can see the LiPo battery powering the device:
Battery wrapped in capton tape, to protect it from clipped leads on back side of pcb, and attached by double stick tape, foam center, we call it "Elephant snot" overhere.....
Battery wrapped in capton tape, to protect it from clipped leads on back side of pcb, and attached by double stick tape, foam center, we call it "Elephant snot" overhere.....
The code driving the Arduino Pro Mini will be attached at the bottom of the post.

It is a modular build, where separate Ebay modules are mounted on a custom motherboard, which harnesses the modules, and the connectors to power (mini USB) the 901P (15 pin high density D-sub)
a power switch and the two tactile switches which command either Torr or Pascal.
The battery charger/boost converter:
booster copy.jpg
The TTL to RS232 converter:
Udklip.JPG
And finally the Oled display
Udklip2.JPG
Then there is the motherboard:
After about 3-4 attempts, the photoresist method of prototype PCB manufacture starts to turn out about acceptable quality.
After about 3-4 attempts, the photoresist method of prototype PCB manufacture starts to turn out about acceptable quality.
And it all goes together like this, just before the Oled enters the combo:
IMG_20171003_154956.jpg
It is possible to buy the boards at Fusion:
https://www.seeedstudio.com/fusion_pcb. ... gIuLPD_BwE

Where you can view the gerbers here:
Udklip1.JPG
and download the gerber files here:
901TransducerReadout.rar
the gerber files without dip switch
(49.02 KiB) Downloaded 504 times
These gerbers rely on a A4 A5 breakout next to the atmega chip, and if you get another version, use short vires to make the connection.

I wish you happy building!

Cheers, Finn Hammer

-Oh, the code:
Vacuummeter_V0.9.rar
(1004 Bytes) Downloaded 513 times
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer »

All,

As noted elsewhere on this site, if the coding bug gets under your skin, it gets itchy, and due to that, I had to get some ideas off the way.

Since there are 3 different units of pressure that the 901P can respond with, as well as the fuspeak variant, 4 in all, this project would be incomplete unless they would all be available. Four units are accessible with 2 buttons: press one button to get one unit, hold one button while pressing the other, to get another unit and vice versa.

Writing this in code revealed the need for debouncing of the contacts, I have done this in hardware, and this meant that a new version of the motherboard had to be generated.

gerbers V.2.rar
The gerber files with hardware debounce option.
(51.3 KiB) Downloaded 490 times


The boards look like this, now:

The board layout with hardware debounce option.
The board layout with hardware debounce option.

I use a 47K/100nF to debounce:

I always preferred hardware debounce, for it's nice clean transition.
I always preferred hardware debounce, for it's nice clean transition.
Why use software debounce to disregard noise, when you can avoid generating noise in the first place. Software debounce is ugly code....

The code looks like this, now:

Vacuummeter_V0.95.rar
Latest software for the 901P pressure transducer.
(1.1 KiB) Downloaded 511 times
And it displays like this:

Code: Select all

//VacuuMeter V.0.95
//This program queries MKS 901P and 999 series pressure transducers about pressure,
//either in torr or pascal, and displays the result on small Oled display.
// 27-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;
String pressureUnit;
String unitBuffer;
String unit;
const byte ledPin = 13;
const byte interruptPin3 = 3;
const byte interruptPin2 = 2;
int val = 0;

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (initializing the display)
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  pinMode(interruptPin3, INPUT_PULLUP);
  pinMode(interruptPin2, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(interruptPin3), pascalISP, FALLING);
  attachInterrupt(digitalPinToInterrupt(interruptPin2), fuspeakISP, FALLING);
}


void loop() {
  if (unit == "Pascal") {
    pascal();
  }

  if (unit == "torr") {
    torr();
  }
if (unit == "mbar") {
    mbar();
  }
  else if (unit == "Fuspeak") {
    fuspeak();
  }

  display.display();
}


void pascalISP() {
  val = digitalRead (2);
  if (val == LOW) {
    unit = "torr";
    Serial.print ("@253U!TORR;FF");
    
  }
  else   {
    unit = "Pascal";
  }
  Serial.print ("@253U!PASCAL;FF");
}


void fuspeakISP() {
    val = digitalRead (3);
  if (val == LOW) {
    unit = "mbar";
    Serial.print ("@253U!MBAR;FF");
    
  }
  else
  unit = "Fuspeak";
  Serial.print ("@253U!TORR;FF");
}

void torr () {
  Serial.print ("@254PR3?;FF");
  sensorValue = Serial.readString();
  sensorValue.remove(0, 7); //Remove the first 7 caracters from @253ACK7.61E+2;FF to get 7.39E+2;FF
  sensorValue.remove(7);  //Remove caracters from the 7th, to get 7.61E+2}
  pressureUnit = "torr";
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("Pressure in torr");
  display.setTextSize(2);
  display.setCursor(0, 9);
  display.print(sensorValue);
  display.setTextSize(1);
  display.setCursor(85, 25);
  display.print(pressureUnit);
}

void mbar () {
  Serial.print ("@254PR3?;FF");
  sensorValue = Serial.readString();
  sensorValue.remove(0, 7); //Remove the first 7 caracters from @253ACK7.61E+2;FF to get 7.39E+2;FF
  sensorValue.remove(7);  //Remove caracters from the 7th, to get 7.61E+2}
  pressureUnit = "mbar";
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("Pressure in Mbar");
  display.setTextSize(2);
  display.setCursor(0, 9);
  display.print(sensorValue);
  display.setTextSize(1);
  display.setCursor(85, 25);
  display.print(pressureUnit);
}
void pascal () {
  Serial.print ("@254PR3?;FF");
  sensorValue = Serial.readString();
  sensorValue.remove(0, 7); //Remove the first 7 caracters from @253ACK7.61E+2;FF to get 7.39E+2;FF
  sensorValue.remove(7);  //Remove caracters from the 7th, to get 7.61E+2}
  pressureUnit = "Pascal";
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("Pressure in pascal");
  display.setTextSize(2);
  display.setCursor(0, 9);
  display.print(sensorValue);
  display.setTextSize(1);
  display.setCursor(85, 25);
  display.print(pressureUnit);
}




void fuspeak () {
  Serial.print ("@254PR3?;FF");
  sensorValue = Serial.readString();
  sensorValue.remove(0, 7); //Remove the first 7 caracters from @253ACK7.61E+2;FF to get 7.39E+2;FF
  sensorValue.remove(7);  //Remove caracters from the 7th, to get 7.61E+2

  unitBuffer = sensorValue;
  unitBuffer.remove (0, 5);
  if (unitBuffer == "+2")  {
    pressureUnit = "torr";
  }
  else  if (unitBuffer == "+1") {
    pressureUnit = "torr";
  }
  else  if (unitBuffer == "+0") {
    pressureUnit = "torr";
  }
  else  if (unitBuffer == "-1") {
    pressureUnit = "micron";
    sensorValue.remove (1, 1);
    sensorValue.remove (3);
  }
  else  if (unitBuffer == "-2") {
    pressureUnit = "micron";
    sensorValue.remove (1, 1);
    sensorValue.remove (2);
  }

  else  if (unitBuffer == "-3") {
    pressureUnit = "micron";
    sensorValue.remove (1, 1);
    sensorValue.remove (1);
  }
  else  if (unitBuffer == "-4") {
    pressureUnit = "millitorr";
  }
  else  if (unitBuffer == "-5") {
    pressureUnit = "millitorr";
  }
  else  if (unitBuffer == "-6") {
    pressureUnit = "millitorr";

  }
  else pressureUnit = "endelse";


  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("Pressure in fuspeak");
  display.setTextSize(2);
  display.setCursor(0, 9);
  display.print(sensorValue);
  display.setTextSize(1);
  display.setCursor(85, 25);
  display.print(pressureUnit);
}




Cheers, Finn Hammer
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull »

Finn, more great positng on this valuable gauge upgrade. I have worked with the oLEDs for a while now and am just working into TFT displays with the Arduino. TFT displays and their libraries gobble up a tremendous amount of program ram forcing one to be code efficient in using them when employing the pro-mini's 32k space. The oLED displays, while tiny, are much more memory efficient due to tighter libraries. Even though the oLEDs are tiny, their fabulous precision contrast and brightness makes them highly readable even for these old eyes.

Again, Great work.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer »

Richard,

Thank you for your kind words.
This program takes up about 55% of the Pro Mini's memory, but there is a Teensy with 256k, so there is still hope.
Although a Teensy would be overkill for this simple application.

Cheers, Finn Hammer
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull »

Even if your finished product took up 96% of the Mini's memory it would still be a complete win. Leftover program space in an Arduino mini project that is complete is like a needless ride-along appendage. If it fits, it ships. No need for more than just enough.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer »

Good grief, the bug report.

Boards arrived yesterday, so has been soldering all night.
There is a bug in the boards, not a serious one, but nevertheless one that needs adressing.

If you look attentively at this picture, you will see that C2 does not have a path to ground.
A bug in the board layout: C2 has no contact to ground
A bug in the board layout: C2 has no contact to ground
This is bad, because it means that there is no debounce on the associated contact. The absence of debounce leads to a problem, when the bouncing contact is the one that is held down, during select of readout unit. Releasing an unbounced contact with interrupt attached to it, can lead it to override the just previously selected unit, not good. Software debounce I hear in the background.. -not sure you can software debounce a contact acting through an interrupt.
I have redesigned the board to this layout:
Fanning the capacitors out like this solved that problem
Fanning the capacitors out like this solved that problem
Is there a workaround? Yes there is. You can put a cap right at the contact, to ground like this:
To regain hardware debounce, a cap is placed right on the switch terminal, and ground
To regain hardware debounce, a cap is placed right on the switch terminal, and ground
Placing the cap in this position bypasses the current limiting resistor that was supposed to protect the contact when discharging the cap, but probably the contact is strong enough for it.

New gerbers here, sorry for any inconvenience, I hardly know what I am doing.
Gerbers Ver_2_1.rar
New gerbers, anyone?
(51.57 KiB) Downloaded 492 times
Oh, by the way, if you buy cheap chinese arduino knock offs, like I do, do yourself a favour and test program them before you solder them in place. I had one that just didn't want to connect to the programmer, a real drag to get it off the motherboard again, had to cut it in pieces to get it off the board.

I remember when I started to study electronics about 15 years ago, and build Tesla coils, I bought a quite nice Tektronix 485 scope. Couldn't get it to trigger properly. It was only when I bought a TDS210 digital scope, that I started to be able to do measurements that I could use to draw valid conclusions from. What I am trying to say here is, that the novice needs great measuring gear to progress. The old hands can get away with almost anything, but the noob needs the best.

And you cannot have too much quality measuring gear, can you:
Good to have, these readouts. In the long run I will probably be better off with a remote sensing box, where I can also draw benefit from the built in pressure watch-dogs, but for now, I am happy with this.
Good to have, these readouts. In the long run I will probably be better off with a remote sensing box, where I can also draw benefit from the built in pressure watch-dogs, but for now, I am happy with this.
Having just pulled the quad down to 10 microns, they self calibrated, and I think they did it rather well.

So far so good, I think I will get polyethylene for the moderator tomorow.

Cheers, Finn Hammer
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull »

Sorry to hear about the faux pas on the boards, Finn. I tend to buy my Pro Minis from Marlin P Jones here in the U.S. for $4.95 each. They are probably Chi-com boards, but I have yet to find one that refused to program. I built a zif socketed tester on a breadboarded plug and play for my GM circuits so that I can test the final programming in an active situation before committing the Arduino to my PC boards.

I have made at least one major board error in the past, but it was easily corrected. I use express PCB and get their bottom of the line two sided unmasked boards. I can I.D. components by labeling them in their free software and the labeling come out in tinned copper. They are 3 boards for $41. I currently get 4 HV power supply boards per board as well as 4 GM processor boards per board. Thus, I get 12 finished boards of both types per order. I just have to use my shop shear to separate the boards on arrival.

I attach a few images showing some older boards for parallel displays. I now use I2C serial displays and get a much smaller footprint in my boards

Nice work on the gauges.

Richard Hull
Attachments
Early test jig on pine board to test individual compnents before assembly
Early test jig on pine board to test individual compnents before assembly
long board on back of display board
long board on back of display board
Subsequent later smaller boards showing cut line
Subsequent later smaller boards showing cut line
One of my early GM &quot;long&quot; boards
One of my early GM "long" boards
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: An interface to the MKS 901P transducer

Post by Pablo Llaguno »

Finn, thanks for the post, this will help me a lot in my current MKS project and will be a great goal. I'm curious as to how is everything wired up, perhaps you would have a diagram?

Thanks!
ian_krase
Posts: 636
Joined: Mon Nov 28, 2016 2:48 am
Real name: Ian Krase

Re: An interface to the MKS 901P transducer

Post by ian_krase »

Any chance of a PCB group buy?
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer »

Pablo,

The schematic/layout is made in Eagle, and obviously there does not exist proper footprints for the Chinese modules used, this would refer to the Booster/LiPoCharger unit, the max3232 unit, the display, but also the tactile buttons and the on/off switch. Even the footprint of the Arduino module was incomplete with regard to the connections to A4 & A5.
My solution to such shortages is to place the footprint of suitable Molex connectors on the board, and name these in the schematic relating to what they represent on the board. In the schematic, these connectors are boxed in green rectangles, and named accordingly.
Udklip.JPG
With regard to a group buy, I have a set of 10 boards that I am not going to use anyway, and you can distribute them if you like. These boards are without the hardware debounce, but this can be remedied by placing 0308 100nF capacitors from contact pin to ground. This is only needed in the case that you want to use the software version with 4 unit choices: Pascal, Millibar, Torr and Fuspeak.

If you want those boards, shoot me a PM.

Cheers, Finn Hammer
ian_krase
Posts: 636
Joined: Mon Nov 28, 2016 2:48 am
Real name: Ian Krase

Re: An interface to the MKS 901P transducer

Post by ian_krase »

PM sent. I'm interested.
Bruce Meagher
Posts: 148
Joined: Thu May 12, 2011 11:25 pm
Real name: Bruce Meagher
Location: San Diego

Re: An interface to the MKS 901P transducer

Post by Bruce Meagher »

Finn graciously sent me a couple of his boards to try. After a few mishaps I was able to get to them working. Here are my notes for others that might try building these. First, the cheap monochrome oled display I purchased from eBay had the VCC and GND pins swapped (even though the first image in their listing showed otherwise!). Second, I used a 180k resistor on the boost converter PS board to get ~11.5V, but unfortunately my cheap eBay arduino pro mini’s voltage regulator couldn’t handle that. Third, the lipo battery had to be connected to power on the 901p. I haven’t debugged why the little boost converter couldn’t supply enough current when the battery was not connected. The 901p only requires ~35mA when running at 11V.

Future enhancements could possibly include moving the power switch away from the power cable to make it easier to turn on, supplying the Arduino with 5V instead or 11V to lower power consumption, add usb, ethernet, or wifi support to allow for easy remote monitoring. Another project to add to my list.

Thanks for sharing Finn!

P.S. My fat fingers hate working with surface mounted parts!
Attachments
Finn's vacuum controller connected to the MKS 901p
Finn's vacuum controller connected to the MKS 901p
Last edited by Bruce Meagher on Wed May 20, 2020 9:31 pm, edited 1 time in total.
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer »

Bruce,

I am glad you got the boards working, that pin reversal on the LED display was a nasty one.
Regarding your choice of buss voltage, I had a similar issue, and also fried a Micro, or it's voltage regulator. That is why I recommended setting the common supply voltage to 9V, which is the minimum voltage required by the 901P, and also the maximum allowed for the Micro.
The combined battery charger/boost converter is another cause of head scratching, because it would appear that it actually discharges the battery, ever so slightly. So the power switch should be on the battery line to the charger/boost module, something I avoided because I find it un-beautifull to have to turn the unit on, in order to charge the battery.
The whole idea with this little project was to present something that could be made without too much soldering, and using readily available parts. If I should do it again, I would mount all parts relating to battery charging, supply voltage generation and signal conversion right on the board, but then It would be a much more involving project.

Cheers, Finn Hammer
Bruce Meagher
Posts: 148
Joined: Thu May 12, 2011 11:25 pm
Real name: Bruce Meagher
Location: San Diego

Re: An interface to the MKS 901P transducer

Post by Bruce Meagher »

It’s definitely an excellent little board, and I appreciated you sharing. The battery probably isn’t an ideal fit here. With the battery at 3.7V I’m drawing about 290mA when running. That’s only a few hours between charging. I’m also draining about 450uA when off.

I find these diversions, while traveling on the path to fusion, what I enjoy most. I’ve ordered a couple ESP32s to continue that journey. I’ll share if/when I get it working.

Bruce
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull »

The road to fusion involves many technologies and sciences. There is a joy in the hands-on effort, and we all enjoy the many teachable moments that will be encountered on the way to the ultimate goal. There are many small and large increments in the process that demand our attention. We are are all made better for it , in the end.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Post Reply

Return to “Vacuum Technology (& FAQs)”