My simulation shows oscillation of the last gate due to feedback, similar to the high-frequency oscillation of the oscillator.What I'd like are comments on the viability of the connection from the output terminal of gate U1C to an input terminal of gate U1D, and the configuration of gate U1D as a low pass filter with a cut-off frequency of 10kHz.
There are two oscillators, operating about 1kHz apart.Why have U1A at all?
How did you identify the two oscillators are 1kHz apart? The circuits appear to be the same electronically.There are two oscillators, operating about 1kHz apart.
One of the oscillators has the tank circuit in the detector head which changes frequency slightly when metal is near the head.
This small change causes a change in the 1kHz difference frequency that is detected and sent to headphones, where the change in frequency is readily detected by the ear.
For example, a 0.1% change in the 160kHz oscillator frequency of 160Hz results in a 16% change in the 1kHz difference frequency.
Their frequencies are identical only with perfect components.How did you identify the two oscillators are 1kHz apart? The circuits appear to be the same electronically.

There may be enough parasitic parallel coil capacitance to cause the same high frequency oscillations that you saw with the discrete added capacitor.Can anyone explain why the 6 inch dia. coil results in a jump from oscillation in the kHz to MHz range when making a relatively small change to capacitance of C1 = C2
Crutschow, where did you get the 2 input exclusive or gate for your simulation? In the version of LTspice that I have, the only gates that are available have multiple inputs, and I believe that they are named behavioral gates, whatever that is. I would like to look at different configurations of the XOR gate as an oscillator, and that would go much more quickly simulating than with hardware.My LTspice simulation also showed a several MHz oscillation.
When I removed C1, then the oscillation went to 158.7KHz, very near the 159.2KHz calculated for the LC tank values used below (10mH in parallel with 100pF series equivalent).
I expect C1 was causing the high-frequency oscillation from it providing a path for positive feedback caused by the high-frequency phase-shift of the gate.
C1 has a low impedance at a couple MHz so the feedback signal is coupled directly through it.
Since C2 and C3 in series through the ground connection now provide the tank parallel capacitance, I don't see a need for C1.
You can find libraries of CD4000 series CMOS parts at several locations.Crutschow, where did you get the 2 input exclusive or gate for your simulation? In the version of LTspice that I have, the only gates that are available have multiple inputs, and I believe that they are named behavioral gates, whatever that is. I would like to look at different configurations of the XOR gate as an oscillator, and that would go much more quickly simulating than with hardware.
I'm getting more involved with the metal detector than I wanted to, but I guess that's the way it goes.
Thank you if you can point me to a source of components, or did you create that 2 input XOR gate yourself?
Pete
Or you can appreciate the charity of our resident Mr. Nice GuyThese are the LTspice digital simulation files I use.
Place the unzipped Digital file in the lib/sym folder.
Place the unzipped other two folders in the lib folder
To use the parts you must add the Spice directive (under Edit) .lib CD4000_v.lib or .lib CD7HC_v.lib to your simulation.
Also, on the circuit simulation, you must add a 3V-15V positive power supply with the output labeled Vdd for the CD4000 circuits, and a +5V power supply with output labeled Vcc for the CD74HC circuits.
Does the underlined line of code completely define the XOR function in the simulation program?You can find libraries of CD4000 series CMOS parts at several locations.
Both of these libraries use the built-in special function "A" devices with multiple inputs. Their properties are configured to match the datasheet behavior of actual parts in most cases. If you subject them to rigorous testing you may find deviations – other people certainly have found such deviations.
- LTspice Users Group at groups.io which is where they moved after yahoo ended support for groups. https://groups.io
- User @Bordodynov has extensive libraries at http://bordodynov.ltwiki.org/ The file you want is the first hyperlink in blue. The zip file is 20 MB and contains lot of other stuff
FYI -- Use of the CD4030 has been deprecated for some time as there were mistakes in the original fabrication of the device. It has been replaced by the CD4070 which is correctly characterized and behave accordingly.
Here is the implementation of the CD4070
*
* 2-input exclusive OR-gate
* tpd 140n
* tr 100n
.SUBCKT CD4070B A B Y VDD VGND vdd1={vdd} speed=1 tripdt=5n
.param td1=1e-9*(140-40-10)*5/{vdd1}*{speed}
*
XIN1 A Ai VDD VGND CD40_IN_1 vdd2={vdd1} speed2={speed} tripdt2={tripdt}
XIN2 B Bi VDD VGND CD40_IN_1 vdd2={vdd1} speed2={speed} tripdt2={tripdt}
*
A1 Ai Bi 0 0 0 0 Yp 0 XOR tripdt={tripdt} td={td1}
*
XOUT Yp Y VDD VGND CD40_OUT_1X vdd2={vdd1} speed2={speed} tripdt2={tripdt}
.ends
The actual XOR function used is underlined. XIN1 & XIN2 are 4000 series input buffer subcircuits. XOUT is a 4000 series output buffer subcircuit.
Yes, it does. However, there is a caveat. It produces the CORRECT result for two inputs, but not for three or more inputs. I quote from the LTspice Help File:Does the underlined line of code completely define the XOR function in the simulation program?
As far as I can tell, it isn't possible to label the power supply output as Vdd or Vcc. In the simulation of your post #4, the power supply output is labeled V1.These are the LTspice digital simulation files I use.
Place the unzipped Digital file in the lib/sym folder.
Place the unzipped other two folders in the lib folder
To use the parts you must add the Spice directive (under Edit) .lib CD4000_v.lib or .lib CD74HC_v.lib to your simulation.
Also, on the circuit simulation, you must add a 3V-15V positive power supply with the output labeled Vdd for the CD4000 circuits, and a +5V power supply with output labeled Vcc for the CD74HC circuits.