Introduction: Simple Night Lamp

Here is a very fast and simple night light which is not disturbing you at night until you sleep. Also it`s economic(using just 5V from the card). It`s very simple and some people will find it useless but it`s for fun.

Step 1: What We Need

1xArduino Uno rev. 3


6xDupont wires



1x1kOhm resistor

1x220Ohm resistor

Step 2: Source Code

const int sensorMin = 0;

const int sensorMax = 600;

void setup() {


if (!Serial) {};

pinMode(8, OUTPUT);


void loop() {

int sensorReading = analogRead(A0);

int range = map(sensorReading, sensorMin, sensorMax, 0, 1);

switch (range) {

case 0:

digitalWrite(8, HIGH);


case 1:

digitalWrite(8, LOW);





Step 3: Info

The original source code is not mine. I just modified it to work for this case.

With this one the LED will switch on when you switch off the light. At least you will have some light in the room as much as not to break your nose in the wall if you go night time for glass of water.

Make It Glow! Contest

Participated in the
Make It Glow! Contest