How petrol pumps know when to turn themselves off