I used a time of flight sensor in an attempt to measure the specific gravity of beer - https://www.anfractuosity.com/projects/zymeter-simple/
https://www.sparkfun.com/products/12784 - Is the little board I used, and used a logic level converter.
I attached a little polystyrene circle to the top of the hydrometer, for the IR to bounce off.
Unfortunately the approach didn't work too well because of yeast krausen pushing the hydrometer about.