This post is closely related to this one. I guess I'm taking a step back now, but it's still good to visit it for background.
I had issues "picking up voltage" in "pre-steady state" time-frame. So I guess a better, more problem-focused (though in this case more general) question would be (as the title said):
Can I setup a Serial LC circuit in anyway and connect Analog Arduino pin between L & C (or wherever) to stimulate it and immediately pick up (sorta listen to) the natural response/resonance frequency?
Assume it's an unknown set of inductance & capacitance, that's why you want to listen to it instead of do the math... (could also be good to validate the math.)
Please ignore the breadboard mess, I think CH1 wave is what I want to pick up.
It gets murdered when I plug A1 pin. CH2 (blue) is the digital pin square wave input.
Thanks, this approach would be brute-force scanning?
I thought it'd be possible to just hit it and listen to the "to steady-state" progress so you can know the frequency, instead of hitting every frequency to measure voltage?
If you hit it, how long would you expect the response to be?
If I am on a swing, someone pushes me, I might still swing after 30 seconds.
The time your LC system will swing is dependent on the quality of your components and the dissipation of your measuring sytem (and pushing system if still connected).
To be honest, I do not know the answer to this question, but it seems relevant here.
Also your story about plugs connected or disconnected is highly unclear to me. If not both of your probes are connected to the LC system, and one probe is loose in the air, you will basically pick up some radiation that has nothing to do with your LC system.
Both probes are connected, Ch2 to power source (square), Ch1 to LC legs connecting.
The swinging analogy is perfect. Time is irrelevant, any freq within 2KHz-44KHz should be fine, my software would need 3-4 peaks to take a guess on the frequency. It works with a sinus function generator but gets tricky with the natural response, because the A1 pin affects the dampening(less sinus peaks), and the GND pin makes it critically dampened (exponential).
The radiation idea I think is discarded by the fact that the signals are in sync, blue and yellow.
Anyway, my intention only works with under dampened responses. So maybe an algo change to measure time to steady state can serve as input for a sensible window for later brute-force scanning?
The under dampened gives the right Frequency for free, if you can listen. the other two just give a max time to convergence. In which case you'd need to use @Paul_KD7HB 's method:
At fundamental resonance, the voltage across the L will be zero and across the C will be maximum.
But scanning frequencies that would have max 6 periods between zero (or say 1/10th * time to convergence) and the time to convergence. which is an improvement over pure brute force I imagine.
I guess ground (or cathode) can be not connected as C takes some current before it's charged. After input is interrupted it'd discharge on L.
Ok, now there is a scheme. In this scheme indicate (draw) where is A1 connected, where is arduino ground connected, where is oscilloscope ground, ch1, ch2 connected?
On your breadboard I also see resistors. Add those to your scheme as well.
What exactly is V on the left hand side?
A series system should have low R to resonate. A parallel system should have high R to resonate. The resistance from A1 to arduino ground is almost infinite... so should not have influence, unless in series with your LC system.
This drawing represents the different scenarios (I'm not sure about the right value of resistors, not familiar with the colored lines code, and lines are too thin anyway, LCR tester shows 5K resistance on a single resistor piece).
Gate G representes pathway to GND.
The resistors on Breadboard are all over the place as I was testing with and without.
'Scope probes' GND were always on Arduino's GND, regardless of G state.
Before you get confused completely; please understand that with oscillating circuits, resistance (value not the physical resistor) is called impedance for L and C values. You cannot say the resistance of "C to Gnd)" if the voltage applied between C and Gnd is AC.
You really, really need to model these circuits mathematically first, the prototype to visualize real-world implementations.
I just unboxed the LCR tester (put it in 20K setting and read 5 on screen), haven't used it before. the 100 I guessed from the Arduino Starter kit'd resistors label (see image above).
I think 2X 5k is far too much in your series system...
I just wanted any R to not have issues on A1 pin. (not sure it's safe to connect Digital pin 22 as output straight to A1 input.). My goal is to have a signal (any signal) to read and test my algorithm. Already tested on Fn generator. But wanted a more realistic scenario LC.
Thanks! I'm aware of impedance dynamic nature. I don't have any real purpose rather than "find the natural freq"; no actual need or use for an (R)LC, other than testing my Arduino software ATM.
Math is great to see if my reading make sense. But I wanted a reading to start with, and it's getting tough to have a clear signal (before steady state).
My goal:
Plug Arduino board in ANY LC and let it find the resonant Freq, and hit the pulses at that Freq to resonate the circuit. requirements:
No need to know anything about the circuit in advance. Except it's LC.
needs to find natural Freq
generate pulses in that Freq
Manually Test that circuit is in resonance after the prev items are complete.
Have Arduino periodically retest the natural Freq in case voltage or capacitance changes alter the natural freq.
So far I have:
An Arduino fn to find peaks in the under dampened (any sinus) wave and output the frequency.
But it looks like I'll have to make it work with critically dampened scenario too. Thus my board guesses on periods and Ts