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.
User avatar
Finn Hammer
Posts: 85
Joined: Sat Mar 05, 2016 12:21 pm
Real name: Finn Hammer
Contact:

An interface to the MKS 901P transducer

Post by Finn Hammer » Fri Oct 06, 2017 10:34 am

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:
IMG_20171006_115342.jpg
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:
IMG_20171006_115201.jpg
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:
IMG_20171004_120204.jpg
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 186 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 186 times

User avatar
Finn Hammer
Posts: 85
Joined: Sat Mar 05, 2016 12:21 pm
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer » Sun Oct 15, 2017 10:18 am

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 169 times


The boards look like this, now:

Untitled-1.jpg
The board layout with hardware debounce option.

I use a 47K/100nF to debounce:

debounce.png
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 178 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: 11937
Joined: Fri Jun 15, 2001 1:44 pm
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull » Sun Oct 15, 2017 7:24 pm

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
Retired now...Doing only what I want and not what I should...every day is a saturday.

User avatar
Finn Hammer
Posts: 85
Joined: Sat Mar 05, 2016 12:21 pm
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer » Sun Oct 15, 2017 8:17 pm

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: 11937
Joined: Fri Jun 15, 2001 1:44 pm
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull » Mon Oct 16, 2017 4:07 am

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
Retired now...Doing only what I want and not what I should...every day is a saturday.

User avatar
Finn Hammer
Posts: 85
Joined: Sat Mar 05, 2016 12:21 pm
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer » Tue Oct 17, 2017 1:37 pm

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.
bummer.JPG
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:
unbummer.JPG
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:
DSC_2493.jpg
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 164 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:
DSC_2498.jpg
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: 11937
Joined: Fri Jun 15, 2001 1:44 pm
Real name: Richard Hull

Re: An interface to the MKS 901P transducer

Post by Richard Hull » Tue Oct 17, 2017 7:34 pm

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
Test Board.JPG
Early test jig on pine board to test individual compnents before assembly
long assembled.JPG
long board on back of display board
BareBoards.jpg
Subsequent later smaller boards showing cut line
BareBoardLong1.jpg
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
Retired now...Doing only what I want and not what I should...every day is a saturday.

Pablo Llaguno
Posts: 99
Joined: Sun Feb 05, 2017 11:00 pm
Real name: Pablo Llaguno

Re: An interface to the MKS 901P transducer

Post by Pablo Llaguno » Thu Nov 16, 2017 4:15 am

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: 625
Joined: Mon Nov 28, 2016 7:48 am
Real name: Ian Krase

Re: An interface to the MKS 901P transducer

Post by ian_krase » Thu Nov 16, 2017 7:09 am

Any chance of a PCB group buy?

User avatar
Finn Hammer
Posts: 85
Joined: Sat Mar 05, 2016 12:21 pm
Real name: Finn Hammer
Contact:

Re: An interface to the MKS 901P transducer

Post by Finn Hammer » Thu Nov 16, 2017 7:36 am

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

Post Reply