I have a pair of variable reluctance sensors at a known precise distance apart to be used to measure the velocity of an object passing by both of them (not the more typical single sensor where the object spins near the sensor).
My goal is two parts:
1. Measure the velocity using a micro-controller like an ESP32 by detecting the two signals and measure the time between them to calculate the speed
2. Since testing it in the "real world" is challenging, Id like to be able to test/validate my circuit and code via purely electronic means (ie: I don't want to devise a way to accurately pass an object past the two sensors so I can measure it).
Digging through various options and considering price, part availability and circuit complexity, it seems something like an LM139 comparator would be excellent for detecting the voltage cross 0V which should correspond with the object directly above the sensor. Looking at the data sheet:
https://www.st.com/content/ccc/resource/technical/document/datasheet/bf/7e/d7/a4/67/86/4e/89/CD00000460.pdf/files/CD00000460.pdf/jcr:content/translations/en.CD00000460.pdfI see two sample circuits which might work? Figure 16 & 20. The latter seems "more correct" since the input is an AC waveform which more correctly corresponds to a VR waveform? That said, it seems to require both positive and negative voltage rails which I'm not really sure of a good way to generate (device is battery operated and I'll have both +5 and +3.3V available).
So guess my first question is "Figure 16. Zero crossing detector (single power supply)" viable for this use case or do I need to come up with a negative voltage rail for "Figure 20. Zero crossing detector"
If I need the negative voltage rail... any simple/cheap suggestions?
Lastly, I'd like a way of testing the accuracy of my circuit & code doing the measuring. Testing it in the real world will be challenging so I was thinking it might be useful to generate a pair of digital pulses with a known time between them to simulate the VR sensor using a 2nd micro-controllers digital outputs. At least I can think of no good way to generate an accurate VR waveform? The closest I can come up with is something like this which I'm not at all convinced is any more useful: