morse through ultrasounds

Ultrasonic transducers like these are highly resonant - you must drive the transmitter at (or close to) 40kHz. Likewise the received signal will be at 40kHz and analogRead() isn't fast enough to follow such a rapid waveform.

You should look into adding an AM detector circuit to the receiver to convert that 40kHz AC down to its envelop. Perhaps even a single diode would be enough?

To get PWM to 40kHz means using frequency-correct mode in the relevant timer module - perhaps easiest to use a library to handle this - perhaps there's one for ultrasonic transducers?