Friday, November 22, 2013

Communicating with Agilent 34970A Data Acquisition unit through RS232 with arduino

This is part of an electropolishing project where the 34970A is used to make precision low resistance measurements. Here I post the part of communicating with the daq unit in monitor mode. This is the mode that the unit usually uses when the continuous readings of 1 channel are shown on the display. The connections here are with an LCD display and MAX232 driver.

 Here is arduino sketch:

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
//LiquidCrystal(rs, enable, d4, d5, d6, d7)
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
char inString[20];
float number=0;

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.setCursor(0, 1);
// Print a message to the LCD.
lcd.print("V const                       ");
Serial.begin(9600);
// Enable Monitor mode. Note the terminating character \n
Serial.print("ROUT:MON:STAT ON\n");
delay(100);
}

void loop() {
// loops the function reading() that reads the serial and displays the numbers on the LCD
reading();
}


float reading(){
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);
//Ask for data in daq
Serial.print("ROUT:MON:DATA?\n");
int i=0;
while(Serial.available()){
inString[i] = (char)Serial.read();
i++;}
//transform the char array in a float
number = atof(inString);
lcd.print(number,4);
lcd.print(" units                             ");
delay(100);
//return number for data handling
return number;
}

In the experiment, depending on the resistance readings, voltage width pulses applied to the samples are modified.


 

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:
 



Thursday, November 21, 2013

microwave oven plasma asher

This is a project I devised with my colleagues M. Flores, M. Tumelero, A. Pasa and A. D. C. Viegas at LFFS, UFSC, Brasil, and inspired by other projects (see links). It consists of a plasma asher, a device that generates a very reactive oxygen plasma to clean organic contaminants on samples.
This project requires knowledge of high voltage, electromagnetic waves, and high vacuum science. A commercial microwave oven is internally modified, so be conscious of the risks associated to it. A microwave oven is composed by a closed chamber were stationary microwaves generated by a magnetron are used to heat food. Very high power can be delivered to materials that absorb microwaves. The microwaves heat can be sensed by the body, but some parts like the eyes crystalline can be damaged without notice, so never allow microwave radiation to escape the oven by, for example, using a broken window. The magnetron is powered by a high power high voltage transformer. The AC voltage of the transformer is doubled and rectified with a diode and a high voltage capacitor, getting around 4-5KV DC, so be aware that lethal voltages and currents are possible if this capacitor is discharged, or any electrical component touched while turned on. A schematic of the system is shown in the picture.
With A) Microwave oven B) Pyrex baking tray C) Seal D) Aluminum base E) Copper hoses and conections F) Baratron (0-100 torr range) G) Flux controller H) To rotatory vaccum pump J) To gas regulator in tank The metallic case of the oven was disassembled to allow better machining. Holes were drilled, some parts cut with a dremmel. Copper pipes and brass parts soldered with tin were used for the vacuum connections, rubber and vacuum grease for the seals. For the vacuum chamber a pyrex baking tray was used. The border of the tray was flattened with the dremmel and a diamond disc. To measure the pressure, a baratron gauge was used. To save costs, the controller of the baratron was also home made. The vacuum chamber is composed by the pyrex tray and an aluminum plate. The vacuum is made with an old rotatory pump. The oxygen flux is controlled with a flux meter, and the tank pressure regulator.  Sparks are possible so avoid sharp surfaces. The microwave is designed such that dimensions are more or less multiples of half the wavelength of the microwaves, and to focus the waves in the center of the oven. The aluminum plate distorts the fields of the original design and gets hot. The concave left wall was covered with an aluminum foil to avoid sparks in the plate (just an experimental fact). The pyrex seems to get hot because of the plasma itself, so no continuous operation is desirable for more than 1 minute. The best results for cleaning are obtained at the highest possible flux, typically 4 lit/min with a pressure gradient of about half bar, and pressure in the vacuum chamber of about 1 torr or less.

Refs:
- http://www.helgiskuli.com
- Guvench, M.G., “Design and Fabrication of Impact (Acceleration) Sensors as Class Projects in a MEMS Course," Proc. A.S.E.E, AC 2009-2191, 2009.

Welcome

This is a blog dedicated to describe several hardware and software prototypes I make in my work as a physics researcher. Please leave a comment. All questions will be eventually answered, just be patient.