You could pull the sonar out of an old polaroid camera and hook it up to a microcontroller, some DIYers use a similar setup for robotics projects. However it is most likely not worth the effort.
Redundancy and control will offer protection.
I have run 2 float switches (1 main 1 backup) on my 120 w/ 100gal basement sump for nearly 10 years, the setup is house water to RODI to tank. I haven't had an issue with a flood and many will say it is too risky, I would do it different if I redid it.
When I setup my BC29 I made it much safer. 2 float switches. Top off water is stored in a container and fed through a 10ml/min dosing pump. An apex controller limits the pump to 1 minute every half hour, so even if both switches were stuck open the amount of water pumped would be minimal. If either float switch stays open for more than 1 hour than an alarm goes off and sends an email/txt. There isn't a catch for the switches getting stuck closed but I'd likely either see the water level drop visually, or see no top-off activity on the Apex.