Build your own nightlight with an Arduino board, which uses a light dependant resisistor as a sensor to switch an LED on and off dependant on the current light situation.
C++, Arduino, Arduino IDE
-
Have an Arduino UNO kit or similar microcontroller. See the official Arduino website for more information
-
Install the Arduino IDE on your computer
-
Select your Arduino board and correct port in the Arduino IDE. For more information see the official Arduino documentation
-
Meassure min and max resisitance of your light dependant resistor and calculate the reference resisitor for the voltage divider using the Alex Benz formula
-
Download the code repository and unzip the folder
-
Build the voltage divider with your Arduino kit (description will follow!)
- Open nightlight.ino in the Arduino IDE and transfer the program on your Arduino board
Code copyright 2019 Almesberger Marcel. Code released under the MIT Licence