A fluid level sensor (160) measures fluid level in a container (220) containing fluid displaced by movement of a driving mechanism (120). The fluid level sensor comprises: at least one energy source (55); at least one energy detector (555) to detect energy emitted by the at least one energy source (55), the at least one energy detector (555) further configured to generate a signal to be processed by a processor; and a regulator to regulate the level of energy received by the at least one energy detector (555) based, at least in part, on the fluid level in the container (220).