Scheme of simple night light which works only when there is not enough light and motion sensor is active.
# Instead of potentiometer you should use photo-resistor.
# Instead of switch you should use some motion sensor (my sensor is working with 3.3v, so I added another voltage source for it)
# Red led just shows if sensor is active, you can change it to ordinary diode
# Capacitor near potentiometer used to smooth photo-resistor noise
# Capacitor near LED is used to smooth switching on and off of LED when motion sensor became active or inactive.