You can keep your sensors functioning correctly, but it does take an amount of effort to do so. In time, you will get a "feel" when it's time to dump your tanks and won't depend on the sensors at all.
Still, it's nice to have them working, right?
Your fresh water tank sensors will work the best, and most of the time.
The black black tank needs cleaning. I have found the best cleaning happens with a black tank wand that attaches to the end of a garden hose, and the wand is pushed down through the bottom of the toilet, water turned on, and then it sprays everything down inside the tank. This works well, but does take some extra effort.
Another way to keep the tank sensors working is to dump completely before hitting the road. Then add a few gallons of water to each tank, a bit of laundry soap, or some dishwashing liquid and hit the road. The sloshing on the road will help clean them. Once you reach your destination, dump the tanks to remove all the "stuff" that was clinging to the sides, top, and bottom.
If you have a black tank built in "flusher" this helps keep the black tank clean, but almost never cleans off the sensors inside the tank.
In the end, you'll eventually learn by actual use how often and when it's necessary to dump. I go by the sound. When the black tank is empty and water is running when it's flushing, the water hits the bottom of the tank. It has a very distinct "pitch". As the water rises in the tank, the "pitch" gets higher (changes) and that my best clue.
If you are on a full hook up campsite, you never, never, never want to leave the black tank valve open and let it drain on it's own. It takes water to move the solids. If the valve is open, the solids will stay behind and the small of the water won't be enough to push it out. The solids begin to stick and stick and stick, creating a dam. We call this "the dreaded poop pyramid", which can actually clog up your black tank and reduce it's capacity greatly. So, always dump with a full tank.
Another option is to learn to how "backflush" using the grey water from the shower/sink/washing machine. (this is another subject). The backwashing process is magnificent for flushing out the contents in the black tank that "stay behind." But again, backflushing will not clean the sensors. To clean the sensors, the wand down the toilet is the best method.