Now that I have a proper power supply, I can start building proper lab equipment and the first thing I set out to build was a Time to Digital Converter (TDC). Well, it’s really just a stop watch with microsecond resolution, but TDC sounds much fancier. 😉
And here it is:
Now, how does this thing work?
Let’s have a look on the circuit diagram:
The heart and brain of the TDC is a AVR Mega16, clocked at 12 MHz. It handles everything from the 7-segment display to the actual time measurement. (You can get the source code here.)
On the top left you can see the input stage, where a couple of opamps decouple the analogue signals and feed them into more opamps that function as comparators. If the positive signal of either the start or the stop circuit exceeds the negative signal, the according comparator switches from -10 V to +10 V and the following FET pulls the according pins of the AVR to ground and triggers the external interrupts and/or counter.
In timer mode, the start signal starts the clock and the stop signal stops it. (Straight forward, huh?)
In counter mode, a start signal increases the counter and the stop signal has no function.
In frequency mode, a start signal increases the counter which is resetted every second at which point the counter value is just the frequency of the signal in Hz. The stop signal has no function.
The part in the lower left has not been realized yet, and is not final yet. I will get to that, once I actually get going with the automated data acquisition.
Here’s a closeup of the front:
The banana plugs are self-explaining, I hope.
The two switches are for convenience. With them I can put a defined voltage (chosen with the pots behind the little holes) on either the positive or the negative input, so I don’t have to supply an external threshold voltage.
The three buttons are for power, timer/counter reset and mode switch.
And here is the messy inside:
If you look closely, you can see a kinda weird looking IC in the upper left, lurking under a ribbon cable. That’s a 4x opamp (14 pins) I’m using as a 2x opamp (8 pins). When ordering the parts for this build, I did not check for maximum ratings of supply voltage and unfortunately the opamps I ordered are only designed for supply voltages of up to 16 V or so. I killed a few of them until I realized that and the only fitting replacements I had at hand were 4x opamps, so I had to break a few legs and make do.
For future reference, I also taped the circuit diagram under the top of the case:
Now, what do you do when you have a stop watch with microsecond resolution at your disposal?
You measure the speed of sound…