Some nightlights include a photocell, which enables them to switch off when the ambient light is sufficiently bright. Other designs also feature a built-in passive infrared sensor to detect motion and only switch on when somebody is passing by in the dark.