Asking for guidance here since i don't want to spend weeks making up a subpar solution myself.
Where the input is coming from:
Sonar transducer output which has gone through an amplifier and then a comparator working as a zero cross detector so that the analog signal is turned into something the arduino can work with easily. (schematic of the amplifier, the values of the capacitors and resistors are wrong, the gain is also supposed to be 65 V/V, 36.6 dB)
See which transducer gives a receiving signal first then second and so on (there will be 5 or 6 transducers). i will also probably need to check if the signal is switching in the correct frequency through software. Then i need the arduino to send the data collected through a radio transceiver (still to pick)
then a trigonometric function based on the time delays between the transducers (if this turns out to be too slow, i can also do this on a computer on the receiving side of the radio).
You are dealing with transducers, meaning a device sends and receives. They cannot receive until the transmission has stopped and the physical vibration of the housing has stopped. That will not be identical for all 5 or 6 of your devices. Therefore they cannot all begin receiving at the same time. Or you going to force all to begin receiving at identical times?
i meant real time as in not having to pause to process the incoming data, i know that transducers will receive signals at different times and this is exactly what im trying to use. sorry for confusing wording
hello, im not fully sure what you mean by ping rate but i think 8 pulses (40KHz) 5 times a second. Thats how fast im planning to scan. The hardware and pcb for this all is still arriving so i dont know if there will be any bottlenecks yet
340m / 40 = 8.5m. More than sufficient enough for the 3m range (min) i am aiming for.
If i write a simple interrupt routine where anytime the signal rises the time stamp in micros() is saved in an array, will the arduino be fast enough to do this for all the 5 transducers?
haha very funny . Your right on that one. Sound localization indeed. I did realize a bit ago that i will need a MEGA if i want to do 5. But for the initial prototype the two interrupts on the UNO will do just fine.
And you are also right in that a large part of this is just reverse engineering the HCSR-04.
But i think what Tom said is still relevant. I still will need to worry about the 40 pings a second because the arduino will receive the signals as they come through the comparator, 40 times a second.