How to measure level of sand in a bucket/tank

Get an ultrasonic sensor and try what you suggested in your original post.