Cheapest Ultrasonic Range Finder

getting it to resonate "right" is easy.
it is like worrying about the sound of a tuning fork, no matter how you hit it, it resonates at it's natural frequency.
"about 40 kHz" is all you need to know to work effectively with them.

I tried a long time to produce varying frequency chirps using piezo, to no avail. what you receive back is the resonance frequency with a varying amplitude.

that reduces the optimisation to easy testing like "from how far you still detect an echo".

If anybody else has better info, I'd love to hear it !

ps I do have an oscilloscope, and indeed that comes in handy.
the arduino itself is usable as a frequency generator. maybe even as a replacement scope. using the adc is a challenge, but there is another way :
detect whether the signal is above a threshold voltage using the comparator, and compile a few runs at varying threshold values.
Sampling this way can be done at about 2 Mhz in a 16 Mhz Arduino.
you have about 512bytes = 512 samples x 8 runs. Aiming at about 10 samples per wave the max frequency would be 200 khz.
This assumes that the arduino knows when to start measuring, but that is easy when it is generating the chirp itself...