Another test would be, use a potentiometer on say A1 to adjust the code to produce a pulse train (green) around resonance.
i.e. vary the green trace frequency about resonance.
Note to Santa, consider giving @kgray9 an oscilloscope for Christmas.
Are you saying make the frequency of the Arduino's pulses externally adjustable to resonate the LC circuit perfectly? I could! I did calculate the capacitance already though to match the frequency of the Arduino rather than the other way around.
Okay! It was originally 5µs in that o'scope picture that I sent. In the original circuit (unmodified), it discharged for 20µs, so i changed it back to that.
Yeah! Do you know why it goes negative? I can't see how or why that would happen!
I added a Schottky diode as you showed in that schematic, and it does help a little, but that is it .
Exactly what I calculated it as! The 2n3906 I am using has a maximum collector current of 200mA.
The only difference is:
The first one has the Arduino switching the pinMode of the analog reading pin to OUTPUT, to drive the capacitor low.
The second one has a separate pin driving the capacitor to GND through a NPN transistor (2n3904).
Show us the changes to the schematic so we can visualize what’s happening.
Reviewing good images of the actual wiring helps us check things too.
Try to go back to where just the capacitor pin is used for both the analog input and discharge.
An NPN would only discharge the capacitor to VCE(sat), i.e. collector saturation voltage.
Using just a GPIO pin (open Drain) or a logic level N channel MOSFET (open Drain configuration) would be recommended, or, as in your original circuit, the same analog input pin that reads the voltage.
I am now using a much larger coil (4 wraps, ~13inch diameter, 14.86µH) with a circuit that uses a P-channel MOSFET with a base transistor to drive the coil. A transistor is used to discharge the capacitor and a voltage divider is used to read the capacitor so it can work above 12V now.
I found i had to decrease the frequency from 134.4kHz to 47.8kHz to use this larger coil... the original higher frequency wouldn't work at all, nor would 13.3kHz that i tried!
I think my next move, is to make another circuit, but this one just uses a 555 timer to generate a specific frequency pulse, and a ESP32 (because of its faster processor) to read the frequency from the inductor. A change in frequency would correspond with interference in the magnetic field.