Usualy the senders go bad because the float fills with gas and sinks. Or, the wire wound resistor get varnished and fails to make electrical contact. There are generic floats available for replacement though you may have to tweak the wire arm with pliers to secure it. The resistor can often be cleaned by a prudent application of oven cleaner to remove the varnish. I've also found it helpful to solder a THIN wire from the wiper arm to the to the internal point it is sending the current to. I do this just to insure a good electrical connection.
I say this because if it is either of these two things you wouldn't have to figure out the mystery, you would just have to fix it. As with anything associated with the gas tank - DO AT YOUR OWN RISK - and be wise and careful. But, whether you replace or repair you still pretty much have to do the same process.