Andromeda blog


Top of blog

2-threshold inverter (hardware, impulse response) - 2 Nov 2019

In order to test the real 2-threshold inverter like the software version, some additions and changes have to be made to the electronics. The output of the inverter is disconnected from the input to the resistor and capacitor, which now comes from another microcontroller via an optical link. This input can be programmed by a C program on the host computer, and this intermediate program is interpreted by another program, also in C, running on the AVR, to generate the actual signal. An optical link (led and transistor) is used to isolate the two microcontroller electrical systems. Another channel is added to the analog inputs from the electronics so that the input, output, and capacitor values can be acquired and displayed on the computer:

A second optical link can provide an optional trigger value from the signal microcontroller, as part of its program, in order to start the data acquisition at specific places in the input, or the acquisition can be free-running. On the white breadboard, the optical links (4N25) are at left, the inverting comparators for their outputs are in the two-op-amp DIP (OP295) at middle, and the 2-threshold inverter is one of 6 inverting schmitt triggers in a single DIP (74AC14), at right. The capacitor (0.22u) and resistor (100K) are at the upper left corner of this unit. Analog inputs are green wires; the long yellow wire is the digital trigger. Compare this circuit to the one previously.

The impulse response of this circuit can be measured by programming an input signal consisting of a short (~1 ms) trigger pulse, a short (~5 ms) delay, an input pulse of some varying width (or any other short signal), and then another longer (~100 ms or more) delay, all looped over and over again. A typical program and one cycle of the input and output looks something like:



The capacitor value is shown in both plots. In the top plot, the capacitor is pulled high and then low again after a set period of time. In the bottom plot, as the capacitor value crosses the two thresholds (not shown, but at about 3.10 and 1.80 V), it causes the output to switch low and then high again.

This display is triggered in the hardware rather than in the (computer) software. The trigger signal can be seen in the oscilloscope as a short pulse just before the main signal, but on a different channel. When enabled, the acquisition microcontroller waits for this trigger to rise and fall before starting a conversion. This produces a much stabler set of signals:

Here is a composite plot of the responses from input pulses of increasing widths:


(Click image for full-size)

Here is a plot of the output pulse width (at 0 V) with respect to the input pulse width (at 5 V), for 10 repetitions of each of the cycles shown above (120 points total), all in yellow. The dotted gray background line shows y = x:



Note that:

Here is another composite plot of the impulse response, with 4 more runs added for 21, 22, 23, and 24 ms:


(Click image for full-size)

Here is a new plot of the output pulse width with respect to the input pulse width, including the additional runs between 20 and 25 ms. This clearly shows the discontinuity at 21.805 ms, and the minimum output pulse of about 12.747 ms:

An interesting interpretation is obtained if one considers the input to be energy (say, from a photon), and the output also to be energy (say, of an electron). Hint: search the web for "photoelectric effect".

Next time: frequency responses.


©Sky Coyote 2019