Professional Documents
Culture Documents
Mayukh Nath
Abstract
An instrument to indicate the level of liquid helium in a Dewar was developed. This report describes the analog and digital components of the instrument in detail including the circuit diagrams, calibration curve and micro-controller code. Some of the key concepts and techniques used in the project like the role of superconductivity in helium level measurement, four probe method of resistance measurement, working of Analog-to-Digital Convertor (ADC) and Serial Peripheral Interface protocol have also been discussed.
Contents
Acknowledgments 1 Principle 2 Analog Module
2.1 2.2 2.3 2.4 2.5 2.6 3.1 3.2 Constant current source . . . . . . . . . . . . . . 2.1.1 Basic circuit . . . . . . . . . . . . . . . . . 2.1.2 Constant current source for high voltages Four probe method of resistance measurement . . Measurement of high voltages . . . . . . . . . . . The `Overlling Eect' and its rectication . . . Safety Measures . . . . . . . . . . . . . . . . . . . Final circuit diagram for analog module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 3 5
5 5 6 7 8 8 8 9
3 Digital Module
3.3 3.4
Overview . . . . . . . . . . . . . . . . . . . . . . . . ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Working of an ADC . . . . . . . . . . . . . . 3.2.2 Specications of the ADC used . . . . . . . . 3.2.3 Advantages of using external ADC . . . . . . 3.2.4 Interfacing the ADC with micro-controller . . 3.2.5 Calibration to read high voltages using ADC LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . Micro-controller . . . . . . . . . . . . . . . . . . . . .
11
11 12 12 12 12 13 14 14 15
20 21 24
Acknowledgments
I would like to thank the following people for their immense help and contribution to the project: 1. Prof. V. Venkataraman for guiding me throughout the course of the project 2. Debaditya Chatterjee for working with me on the project 3. Prof. M. K. Gunasekaran for his course UE-102 without which this project would have been impossible 4. My classmate Diptaparna Biswas, for many useful and timely inputs during the project 5. Doctoral students, Sandip Mondal and Aditya Narayan Roy Choudhury and other students for helping me out in the lab 6. My parents for their support and valuable suggestions 7. My friends Sayak Ghosh, Tamoghna Barik and S. Hamilton Samraj for their help and support Lastly, I should thank Atmel Studio , LYX, and the website www.circuitlab.com as I have used these software for the project and for preparing the report.
Chapter 1
Principle
Certain materials (eg NbTi/Cu) show superconductivity at temperatures below 10 K. Temperature of liquid helium is about 4 K, so these materials would be superconducting in contact with liquid helium. Exploiting this fact, a sensor made of NbTi/Cu and shaped like a wire is used to measure the level of liquid helium in a Dewar. When this sensor is placed in the Dewar as shown in Fig 1, the part of the sensor submerged in liquid helium becomes superconductor. The resistance of the sensor wire, thus becomes linearly dependent on the part of the sensor above liquid helium level. So by measuring the resistance of the sensor, the level of liquid helium in the Dewar can be calculated.
Suppose the total length of the sensor is H , the resistance per unit length of the sensor is r and the measured resistance of the sensor isR, then the level of liquid helium is given by,
L=H
R r
Now, to measure the resistance of the sensor wire, four probe method of resistance measurement is used, and a constant current source, supplying 60 mA is built for that purpose.
Chapter 2
Analog Module
2.1 Constant current source
A constant-current source, as the same suggests supplies a constant current over a range of loads. A basic constant current source circuit is described in the following section, followed by its modication for higher voltages.
IConst =
Vref Rsense
Limitation
The above circuit can only supply constant current till a certain voltage across the load. The maximum voltage it can supply is limited by the maximum output of the Op-Amp which is typically 20-25 V. But for the project at hand a constant current source capable of supplying up to 35 V was needed. So some modications had to be made to the above design, as described in the following section.
Figure 4: Modication for eliminating oscillation Note: The above design also has a small drawback. Due to the presence of the capacitor, the circuit takes some time to adjust the output voltage with change in the load. In other words, the response time of the circuit has increased due to the addition of the capacitor. But since the level of liquid He changes very slowly in the tank the high response time is not a problem.
high input impedance of the voltmeter ensures that very little current ows between probes 2 and 3. So, the eect of the lead resistance of the probes, on the measurement, would be very little.
Chapter 3
Digital Module
3.1 Overview
As described in the previous chapter, the analog module produces two output voltages one corresponds two the voltage at the end of the sensor, and the other one is the voltage at the beginning of the sensor, reduced by a certain division factor. The function of the digital module is to detect these two voltages and further analyze them to actually display the level of liquid helium on screen. Along with this, the digital module also drives a switching assembly to switch the analog module between two current levels. Following is a block diagram of the working digital module:
3.2 ADC
An Analog to Digital Converter (ADC) is a device that takes a voltage signal in a given range as input and gives a corresponding digital output. The analog module of the circuit produces two voltage signals. The micro-controller is supposed to analyze these signals and for that purpose, these analog voltage signals need to be converted into digital domain. The ADC is instrumental in carrying out this process.
12
Output from external ADC has less noise: The accuracy of the internal ADC is aected by many factors related to the micro-controller, including noise introduced due to CPU functioning, interrupts, power uctuation etc. Many of these factors are absent in the case of an external ADC, resulting a less noisy and more accurate output.
Working of SPI
SPI communication involves two devices namely master and slave devices. The master side has a clock generator that controls the communication. Slave side receives this clock via SCLK pin and the communication is synchronized. Also, each side has a shift register, 8 bits long.
35 30 25
Voltage (V)
20 15
Equation y = a + b*x 0.01585
Intercept Slope
-0.01062 0.01214
2000
2500
3000
ADC Output
V = 0.01214 r 0.01062
where V is the high voltage and r is the ADC output.
3.3 LCD
An LCD is used to display the level of liquid helium in the tank and the volume it corresponds to. Its model number is JHD 162A and it is a 162 dot matrix character LCD. It is controlled by the micro-controller via a 4 bit data bus.
14
3.4 Micro-controller
An Atmega32 micro-controller is used in the project. The software for the microcontroller is written in AVR-C. It is programmed using USB-ISP programmer for AVR. The main functions of the micro-controller are: 1. Controlling the external ADC through SPI, reading data from it and performing the necessary calculations. 2. Controlling the LCD to display the values. 3. Controlling the current switching assembly of the analog module.
void SPIinit(); unsigned int SPIwrite(unsigned int); unsigned int readExADC(unsigned int); float getHighVol(unsigned int adcVal); float getVolume(float height); #define #define #define #define #define #define #define #define #define void void void void LCDPORT PORTC LCDDDR DDRC rs PC3 en PC2 heater PC0 LO_VOL_OFF -14.0 SNSR_LN 101.6 SNSR_RES 4710.0 curr 60.2
//Lower voltage offset(mV) //Sensor length(cm) //Sensor resistance(m/cm) //Current value(mA) //Initializes LCD //Sends data to LCD //Sends 8-bit data to LCD in 4-Bit mode //Returns helium level as a string
15
void getVolumeStr(unsigned long int, char*); //Returns volume of helium as a string void dispLCD(char *); //Displays a string in LCD int main(void) { DDRC |= 1; DDRA = 0; lcd_init(); dispLCD("Please wait..."); int i; float v1, v2, res, length,vol; unsigned long int l,volume; SPIinit(); PORTC |= (1<<heater); _delay_ms(4000); PORTC &= ~(1<<heater); lcd_init(); char str1[16],str2[16]; while(1) { v1=0.0; v2=0.0; i=0; while(i<1000) { v1 += ((float)readExADC(1)/4095.0)*5; v2 += getHighVol(readExADC(0)); i++; } v1 -= LO_VOL_OFF; //offset correction res = (v2-v1)*1000/curr; if(res < 0) res = 0.0; length = (SNSR_LN - res/SNSR_RES)*1000.0; if(length < 0) length = 0.0; vol = getVolume(length); l = length; volume = vol; getLenStr(l,str1); getVolumeStr(volume,str2);
16
sendToLcd(0x80,0); dispLCD(str1); sendToLcd(0xC0,0); dispLCD(str2); } } float getHighVol(unsigned int adcVal) { float val = 0.01214*adcVal-0.01062; return val; } float getVolume(float height) { //returns volume in litres
float refList[103] = {0.0, 0.4, 1.6, 3.6, 6.3, 9.8, 14.1, 19.2, 25.0, 31.6,\ 38.9, 46.9, 55.9, 68.1, 79.0, 89.8, 101.3, 113.2, 125.3, 137.7, 150.1, 162.7,\ 175.2, 187.8, 200.4, 212.9, 225.5, 238.0, 250.6, 263.2, 275.7, 288.3, 300.9,\ 313.4, 326.0, 338.5, 351.1, 363.7, 376.2, 388.8, 401.3, 413.9, 426.5, 439.0,\ 451.6, 464.2, 476.7, 489.3, 501.8, 514.4, 527.0, 539.5, 552.1, 564.6, 577.2,\ 589.8, 602.3, 614.9, 627.5, 640.0, 652.6, 665.1, 677.7, 690.3, 702.8, 715.4,\ 727.9, 740.5, 753.1, 765.6, 778.2, 790.8, 803.3, 815.9, 828.4, 841.0, 853.6,\ 866.1, 878.7, 891.2, 903.8, 916.4, 928.9, 941.3, 953.6, 965.6, 977.3, 988.6,\ 999.2, 1010.7, 1022.0, 1030.4, 1038.2, 1045.2, 1051.4, 1056.9, 1061.7, 1065.7,\ 1068.9, 1071.3, 1073.0, 1074.1, 1074.3}; int n = (int)(height/1000.0); float val = refList[n] + (refList[n+1]-refList[n])*(height/1000.0 - (float)n); return val*10; } void getLenStr(unsigned long int len, char* str) { strcpy(str," Level= . cm "); int dec = len % 1000, num = len/1000, t = 100, i=7; if (dec % 100 >=50) dec = dec/100 + 1; else dec = dec/100; if (dec > 9) { num++; dec = 0;
17
} str[11] = dec + 48; while(i < 10) { str[i++] = num/t + 48; num %= t; t /= 10; } } void getVolumeStr(unsigned long int volume, char* str) { strcpy(str," Vol= . L "); int dec = volume % 10, num = volume/10, t = 1000, i=6; str[11] = dec + 48; while(i < 10) { str[i++] = num/t + 48; num %= t; t /= 10; } } void SPIinit() { CS_HIGH(); //Idle mode DDRB |= (1<<MOSI) | (1<<SCK) | (1<<CS); SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR0); SPSR |= (1<<SPI2X); } unsigned int SPIwrite(unsigned int data) { SPDR = data; while(!(SPSR & (1<<SPIF))); return SPDR; } unsigned int readExADC(unsigned int channel) { unsigned int byte, dataH, dataL; byte = 0b10100000; byte |= (channel<<6);
18
CS_LOW(); SPIwrite(1); dataH = SPIwrite(byte); dataL = SPIwrite(0); CS_HIGH(); dataH &= 0x0F; return (dataH*256 + dataL); } void lcd_init() { LCDDDR |= 0b11111100; sendToLcd(0x02,0); sendToLcd(0x28,0); sendToLcd(0x01,0); sendToLcd(0x0C,0); } void dispLCD(char *a) { char *i=a; while(*i!='\0') sendToLcd(*(i++),1); } void sendToLcd(char dataValue, int mode) { char dataValue1; dataValue1 = dataValue & 0xF0; lcdData(dataValue1, mode); dataValue1=( (dataValue<<4) & 0xF0); lcdData(dataValue1, mode); } void lcdData(char data,int mode) { LCDPORT &= 0x0F; LCDPORT |= data; if(mode) LCDPORT |= (1<<rs); else LCDPORT &= ~(1<<rs); LCDPORT |= (1<<en); _delay_ms(2); LCDPORT &=~ (1<<en); } // to initialize LCD in 4-bit mode. //to initialize LCD in 2 lines, 5X7 dots and 4bit mode. // function to initialize
19
Possible Improvements
The following additions may be made to the project to add some features 1. Serial communication with a computer may be introduced to monitor the helium level and maintain statistics. 2. A keypad interface may be added for easier calibration later, if required.
20
Gallery
The following are a few snapshots of the helium level indicator at various stages of development.
21
22
23
Bibliography
[1] K. P. Jngst and E. Sss, Superconducting helium level sensor, CRYOGENICS. AUGUST 1984 0011-2275/84/00842904 [2] Muhammad Ali Mazidi, Sarmad Naimi and Sepher Naimi, The AVR Microcontroller and Embedded Systems using assembly and C, Pearson (2011) [3] P. Horowitz and W. Hill, The Art of Electronics, Cambridge University Press (1989)
24