Devices such as laser diodes are used in various different applications. Many applications require the laser diode to be on for a relatively short period of time. If a device such as a laser diode is on for a prolonged length of time, due to a fault, there may be a risk that safety is compromised. For example, such devices are often used in consumer products such as mobile phones. Safety may be a particular concern in such devices. Alternatively or additionally the problem may be that if a device is on when it should be off, excess power is consumed. This may be disadvantageous in situations where power is provided, for example, by a battery.