Arduino Light Intensity Lamp

Introduction: Arduino Light Intensity Lamp

This project main purpose is make a lamp or light bulb automatically turn on when it is dark and turn off when it is light (This can be changed to make it so that the light will turn on when there is light and turn off when it is dark). There is 7 main materials needed to complete this project, which are:

  1. (1) An LDR or Light Detecting Resistor this will allow the circuit to detect whether it is light or dark.
  2. (1) Arduino Micro controller this will allow us to take the information from the LDR and control other parts in the circuit.
  3. (1) Light Bulb as we need a light source for this circuit.
  4. (1) A relay as a light bulb need 120 V of power while the Arduino only provides 5 v of power.
  5. (1) A power supply.
  6. (1) 1000 ohm resistor
  7. (11) Jumper wires


  1. (1) Bread Board, This will make it easier to build the circuit and will make it more clean and organized.


  1. Some basic coding is required for this project. (Although if you have no experience with it and wish to still do thin project I will have a picture of the code in one of the upcoming steps)

Step 1: Step 1: Placing All Components

The first step will be placing all the components on and around the breadboard this step is so the next step wiring can be done much more easily.

Step 2: Step 2: Wiring Relay Circuit

In this step we will be wiring the relay the light bulb and the power supply. This first thing to do is to wire terminal 1 of the light bulb to terminal 7 in the relay chip. Next connect the other end of the light bulb to the red or positive terminal to the power supply and connect the negative or black terminal of the power supply to the first terminal of the relay. Finally connect the 5 th terminal of the relay chip to the 4 digital pin on your Arduino. make sure you wire up the relay correctly as it uses lower voltages and coverts it to control higher voltages in the circuit this is important at the Arduino only supplies 5 V while the light bulb needs 120 V.

Step 3: Step 3: Wiring the LDR Circuit

The light detecting resistor circuit is what is going to detect the light and wiring it is quit simple. First you are going to connect the second terminal of the LDR to the A1 port on your Arduino you also have to connect the same terminal to voltage through a 1 k ohm resistor. and the final part is to wire the 1 st terminal to ground.

Step 4: Step 4: Coding

Void Setup:

In the void setup the main thing that is happening is defining whether each of the pin are inputs or outputs the A1 port is input in this case and the digital pin 4 is an output pin.

Void Loop:

What is happening in this loop is quite simple. within this loop there is a if else statement which is checking whether light is being detected but the LDR (It sees whether the A1 port is high or low) if it is than power is sent to the light bulb through digital pin 4 if not than no power is sent.

Step 5: Step 5: Test the Circuit

If you have done all the previous steps correctly your circuit should light up the light bulb if it is dark and turn off when there is light.

Be the First to Share


    • Metal Contest

      Metal Contest
    • Space Contest

      Space Contest
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge