How to make a Dark activated light system with Arduino Pro Mini board

How to make a Dark activated light system with Arduino Pro Mini board

Hello and welcome back. In this project, we will learn how to make a dark activated light system with an Arduino Pro Mini board. For that, I have mainly used the LDR (Light Dependent Resistor) sensor. The LDR sensor detects changes in ambient light levels, allowing our system to activate the lights when it gets dark. Also, I have added the IRF9540 MOSFET transistor to this circuit. Therefore we can control High ampere 12v LED bulbs with this system. Additionally, you need an Arduino Nano board, Arduino UNO board, or TTL converter for programming this Pro-mini board. For that, I used the Arduino UNO board. Also, I have designed a PCB (Printed Circuit Board) for this project with JLCPCB. Therefore, we can assemble this system easily. This system is perfect for outdoor lights, gate lights, and more. If you are a beginner of this, Please visit the tutorials below.

OK, let’s do this project step by step. The required components are given below.  

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, order PCBs for this project. Follow the instructions below for that.

  • First, go to the JLCPCB official website and log in to your account. If you are a new member of this, please use this link. Then, you can get a 60$ coupon for orders to PCBs.
  • JLCPCB: 48-Hour Turnaround for 6 Layer PCBs! — Click on me
  • Now, click the instant quote button and upload the Gerber file. You can download it using the link below.
  • Gerber file — Download
  • I have ordered 5 PCBs with Green color. You can also remove the order number on PCBs.
  • Then, select the build time and shipping. Finally, click the save to cart button.
  • Now, open your cart and click the secure checkout button. Then, enter your shipping details and shipping method.
  • Next, submit your order and pay for this using Paypal, Debit Card, Credit Card, or Coupon. Now waiting for your PCB package.

Step 3

Next, unbox the PCB box and check your PCBs.

Step 4

Then, prepare the female headers to mount the Arduino Pro Mini board.

Step 5

Next, solder all components to the PCB.

Step 6

Now, connect the Pro Mini board to the PCB.

Step 7

OK, let’s program this system using the Arduino UNO board. For that, follow the instructions below.

  • First, connect the Arduino UNO board to the Pro Mini board. For that, use the GND, 5V, Rx, and Tx pins.
How to make a Dark activated light system with Arduino Pro Mini board
  • Then, connect the Arduino UNO board to the computer.
  • Now, upload an Empty sketch to the Arduino UNO board. For that, select the Arduino UNO board and port. After, click the upload button.
  • Next, copy and paste the following program to the Arduino IDE.
  • Program and Gerber file — Download
#define output 3 //output pin
#define LDR A1 //Sensor pin

void setup() {
  pinMode(output, OUTPUT);//set as output
  Serial.begin(9600);//enable serial monitor
}
void loop() {
  int value = analogRead(LDR);//get the sersor values
  Serial.println(value);//print these values on serial monitor

  //  value = map(value, 0, 1024, 0, 255);
  //  analogWrite(output, value);

  if (value > 900) {//check the value
    digitalWrite(output, HIGH);
  } else {
    digitalWrite(output, LOW);
  }
}
  • Now, select the Arduino Pro Mini board and port. After that, click the upload button. In this case, when the “uploading” is displayed on the IDE, press and release the reset button for 2 seconds.

Step 8

OK, now you can remove the Arduino UNO board. Then, connect the 12V LED bulb to this system. I have used a 12V LED strip for that. Finally, provide a 9v – 12v power supply to this system. You can also use a 9v battery.

Now, you can test this project by covering the LDR sensor with your hand. The full video guide is below. So, we hope to see you in the next project. have a good day.

How to make a Dark activated light system with Arduino Pro Mini board

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *