I'm enrolled in a nano-scientific instrumentation program, one of the first of its kind. The instructor decided that a good project for us would be to build a thermal evaporator, a device that evaporates metal in a vacuum in order to plate some other surface with a thin layer.
The instrumentation portion is to monitor a quartz-crystal-microbalance. This is just a crystal with a known surface area and resonant frequency. We will place it nearby the surface that is getting plated. Its frequency changes as it accumulates mass, but only minutely. By modeling the deposition as a crystal structure, using the known mass and surface area and fudging the numbers a bit we can determine the thickness of the deposition to +/- an Angstrom (ten billionths of a meter).
The trick here is to get very small changes in the frequency of the crystal.
My plan is to use a
Pierce Oscillator to drive the quartz crystal. I obtained a very accurate clock crystal (+/- 1 cycle per 10 million cycles) to compare it with. I will use the Quartz Crystal Microbalance to clock a binary counter while the reference clocks another binary counter. When the Quartz Crystal Microbalance counter reaches some pre-determined bit, I will shift the reference count into a register and read it with an Arduino. I will know how many counts this equals, so I can determine a frequency that is (hopefully) extremely accurate with this method.
Here's the problem though... The reference can be assumed to be 1/20,000,000 of a second (because it's a 20 MHz clock). I might know that I'm counting, for example, 8,192 pulses (13th bit) of the Quartz Microbalance, and it took 16,384 reference cycles for that to happen. I then know that I have 10 MHz resonance on the Quartz Microbalance. Drop the reference by only one though, and I now have 610 Hz difference! The precision sucks.
So, I'm forced to use a longer sampling period to increase the accuracy. I chose to simply add another counter clocked by the already much divided Quartz Microbalance frequency (simple way to carry over and make huge binary counters). I think a sample every 500 ms is decent. I'll make an assumption that my Quartz Microbalance will clock at about 10 MHz, this means I will need to count about 5 million cycles of the Quartz Microbalance before I shift my reference count. 2^22 is just below this at 4,194,304 so I'll use a 22 bit counter. When the 22nd bit goes high, I shift my reference count into a register.
To get my precision, I'll again see how much the calculated value shifts when my reference clock changes by one count. I know that my Quartz Count/Quartz Frequency = Ref count/Ref frequency. Re-arranging, I get:
(Ref Frequency[Quartz Count]) / (Ref Count) = Quartz Frequency
(20,000,000 Hz * 4,194,304) / (10,000,000) = 8,388,608.000
(20,000,000 Hz * 4,194,304) / (10,000,001) = 8,388,607.161
(20,000,000 Hz * 4,194,304) / (10,000,002) = 8,388,606.322
(20,000,000 Hz * 4,194,304) / (10,000,003) = 8,388,605.483
So I have a precision of about 1 Hz, with accuracy of +/- 1 Hz due to my reference crystal inaccuracy. Get this - it translates to a final precision of about 50 nanograms on the crystal though! It gets better as the surface area of the crystal increases. I think this is a really great example of how some simple electronics can give you insight onto some very, very tiny things. The only thing I'm worried about now is how the big numbers will work out inside the Arduino platform.. I worry about how much time it will take to calculate my final derived value with all of the large numbers. I'm thinking about just using integer values for frequency because of the +/- 1 Hz uncertainty that is there anyway.
Anyone else designed a frequency counter before? I'd love insight!