I had a similar scenario a few years ago. I wanted to check the distance from my cars bumper to the rear wall. I looked at ultrasonic distance measurement and all sorts. I asked a car parts dealer about the “traffic light” ultrasonic garage sensor he sold..... his words to me were a surprise ...... “Sir, would you really trust the bumper of your £30K+ car to a £20 sensor gadget built down to a minimum cost ?” He was right. The better solution was a physical ‘stop’ to prevent my cars rear wheels going beyond certain point and so stopping me hitting the rear wall. I use a pair of heavy concrete house building type blocks. Worked a treat. Simple, effective and cheap.
With that in mind, have a think about simple solutions to your scenario that do not rely on a technical solution that can fail you. You could consider a wood batten screwed to the floor that prevents your wheels going too close to the side, like is used in some drive through car washes, or you could position a mirror on the end wall that lets you see the gap between your car and the wall.
The KISS principe is often cheapest and most reliable
If you just want to build an ultrasonic distance meter for the fun of it, then no worries. I did that years ago. One design used TX and RX ultrasonic transducers with very short TX pulse duration for ‘time of flight’ calculations at short distances. I also used an ‘all in one’ ultrasonic module as used in old Polaroid instant cameras. They are sold for distance measuring projects using Arduino etc. They use ‘time of flight’ measurement as well. Ultrasonic can be deflected in some cases resulting in a low reflected signal level. This can make such measurement unreliable in some cases, especially against soft targets that provide a poor reflection.
10GHz Radar modules are also fun to work with. They used to be expensive and complex, now they are an inexpensive PCB module with the antennas and electronics all in place for the experimenter to use. Doppler shift is commonly used when these modules are used in movement detection scenarios. You would want ‘time of flight’ to measure true distance and the modules may not provide that capability.
Another option is a ‘break beam’ system where a narrow beam of light, such as a laser illuminates a sensor. If something comes between the light source and receiver sensor, an alarm in generated. In your case, the cars side would break the beam and alert you to the fact that you crossed the safety zone. You would have to work in the NIR spectrum to avoid daylight interference with the systems receiver sensor. If the receiver sensor became illuminated by extraneous light that looked like its transmitter signal, you gave a fail UNSAFE condition ! The use of a coded or non CW signal from the TX and decided by the RX is an option if spurious input detection is desired.
Have fun
Fraser