While working on an automatic chest+cart filling station, I realized that I needed some way to detect when an empty chest+minecart was rolling up. This ability allows for some interesting mechanics: if a partially full minecart+chest pulls up, we can send it away without adding more to it (and potentially disturbing some track/redstone logic). However, if it's empty, I want to send a signal to some hoppers so that my minecart is filled up then sent on it's way.
After struggling with how to do this for some time, it turns out that it is pretty easy execute:
As a minecart+chest goes by, the detector rail powers the redstone directly below it. The signal passes through two repeaters to eventually reach (in this example) a redstone lamp. Of course, it doesn't have to be a lamp; it could be any circuit connected to the output repeater, which is the repeater furthest to the right. Simultaneously, a comparator "weighs" the chest and emits a signal if the cart contains anything. If so, a signal is passed through a repeater which locks the output repeater, inhibiting any output signal unless the passing cart is empty.
I'm working on an auto-load and return station which relies on this mechanism; I'll be showing that soon. Until then, here's the whole thing in action: