Sound Location with the Qwiic Sound Trigger and the u-blox ZED-F9x
Accuracy and Sources of Error
Looking at the datasheet for the ZED-F9P high precision GNSS module, we see that it quotes a 99% accuracy for its time pulse signal of 60 nanoseconds. If we look at the datasheet for the ZED-F9T high accuracy timing module, we see that it offers a big improvement: 5 nanosecond accuracy for the time pulse in absolute timing mode; and 8 nanosecond time-mark resolution. So, really, if we want the highest accuracy, we should be using the ZED-F9T.
Now 60ns is really not very long. It is 0.00000006 of a second. But how far does sound travel in 60ns? If we multiply 343.42 by 0.00000006, we get 20.6 x 10-6 metres. Or 0.02 mm. OK. That’s pretty good! So we don’t need to worry too much about the timing accuracy of the ZED-F9P. And don’t forget that the TIM_TM2 message, which captures our time-mark or interrupt, has nanosecond resolution.
But what about our VM1010 sound trigger? Well, the datasheet doesn’t contain the numbers we really need, which is the minimum and maximum delay from the sound crossing the detection threshold to the TRIG (DOUT) signal going high. But, so long as there is not a big difference from chip to chip, the delay doesn’t really matter. If the time delay is fixed, it will cancel out in our calculations. But if one chip has a different delay to another, that will affect the accuracy. So let’s measure it!
Here is an oscilloscope trace of 100 sound events detected on two VM1010’s. The oscilloscope is being triggered by one VM1010 on the yellow trace. The purple trace is the TRIG (DOUT) signal from the second VM1010. They were being triggered by a short ‘click’ sound from a dog training aid. And, yes, we were careful to make sure they were both the same distance from the click!
One of the interesting things I noticed is that when I press the button on the dog training aid, to produce the first of a pair of clicks, the output signal from the second VM1010 follows the rising edge group at ~140 microseconds before the first. When I release the button on the training aid, to make a second click, the output from the second VM1010 follows the group ~50 microseconds after the first. I don’t yet have a theory about why it does that… But it must have something to do with slight differences in the intensity or frequency spectrum of each click.
Anyway, if we take 140 microseconds to be the worst case error between these two VM1010’s, that corresponds to a distance of 343.42 * 0.00014 = 0.048m or 4.8cm. That’s still pretty respectable and not too far away from the accuracy we could expect if we were to survey-in the position of each sensing point.
In summary, we can make a hand-waving argument that we can expect the accuracy of our sound location system to be better than 10cm. Happy days!