I want to make a basic TOF distancing circuit inspired by the square-wave phase shift method here.
But I don't know how to measure charge stored in capacitors.
However, I thought of a simplification. Perhaps I could just measure if one value is bigger than other?
More specifically, I could make a device that returns a binary (digital) signal saying whether or not there is an object within a predefined distance L away.
Let's say L = 5 meters. The total distance will be 10m, which means approximately 33 ns phase shift. So we can just determine whether there is a phase shift of less than 33ns.
If we generate a square wave at 7.5 mhz, it will be on for 66ns and off for 66ns, and we need only check if the phase shift is less than 50% of the "on" part of the square wave.
So we can have a photodiode whose output is switched between two wires in sync with the 7.5mhz output LED signal, we use a capacitor on both lines to smooth out the signal, and whenever the "on" wire voltage is higher than the "off" wire voltage, it means there is an object within 5 meters.
My questions are:
- Will this design work, or have I made a mistake somewhere?
- I want to use these parts: IR LED TSML1000 and IR Photodiode TEMD1000. Is that reasonable?
- Can you suggest a suitable voltage comparator part for this circuit? Or should I use a current comparator?