Skip to main content

Automatic Night Lamp using arduino

 Project Name:- Automatic night lamp.
 I am going to make automatic night lamp using Arduino. For this we need some hardware component named as below

  1. Arduino
  2. Computer
  3. Led
  4. LDR sensor
  5. Resister(2.2k)
  6. USB cable 

And a software named Arduino Ide in computer.
This project is based on the LDR[light dependence resistor] sensor whose value is dependent on the light i.e its value is high during the night time and low during day time.
 The voltage divider circuit is made in the analog input of arduino between  LDR and 2.2k resistor provided 5v power supply.A voltage divider is a simple circuit which turns a large voltage into a smaller one. Using just two series resistors and an input voltage, we can create an output voltage that is a fraction of the input. Voltage dividers are one of the most fundamental circuits in electronics.
program coding 
int led =13;
int ldr = A0;
void setup()
{ pinMode(led,OUTPUT);
   pinMode(ldr,INPUT);
   Serial.begin(9600);
}// to establish the serial communation between arduino and computer.
void loop()
  int value = analogRead(ldr); // to read the analog value of the sensor
{
   Serial.println(value);
   // to print the serial value in  serial monitor
  if (value>500)  
 {
  digitalWrite(led,HIGH);
 }
else
 {
 digitalWrite(led,LOW);
}
}
}
during the day time the value of the LDR is low  that means the value is less than 500 so the led is off but during the night time value of the sensor is high that means the value is greater than 500 so the led is turn on.
This is the sample of automatic night lamp.

Popular posts from this blog

SMPS of computer

                                            fig:- working principle of SMPS       fig :- SMPS of computer From the above figure, we came to know that the function of SMPS in computer which is to convert  the high 220V-AC to 0-12V DC.SMPS contain several color of wires which carry the different voltage to the different parts of the computer.The following table shows the different color cables and its carrying voltage.      

warm clothes distribution program

‘ Small step can make a big difference ’ Rural Women Development Centre from morang,Nepal distributed the warm clothes to the needy people. They manage it possible by collecting fund from working staffs and management committe. Here is the video link of the distribution program. https://youtu.be/AxaHbivcQUM

Multiple mcp23017 interfacing with Arduino

MCP23017 is the I/O port extender that runs on 12C. It is 16-bit I/O expender.in this tutorial we are going to interface the single and multiple  mcp23017 with arduino.  fig:- mcp32017 module IT has 16 I/O ports from PA0 to PA7 and PB0 to PB7. first of all we are going to interface the single mcp23017 with Arduino. For this  connect the circuit as shown on figure. Download the library for mcp23017  from  sketch-- include library -- manage libraries.