Introduction: LDR Buzzer Using Arduino

Picture of LDR Buzzer Using Arduino

Hey, peeps!! I'm Sridhar Janardhan back with another ibles.In today's project, I am teaching about the basic principle of a security system installed in the bank system.we know that light has got many uses, We being an electronic hobbyist have made an alarm out of it.If there is any absence or reduction of light around a sensor the buzzer pings.this can be achieved using a light dependent resistor or LDR.Seems interesting ??

Let's now start gathering electronics.

Step 1: Components Required

Picture of Components Required

Components required for this projects are:

  • Arduino Uno
  • Buzzer
  • Breadboard
  • Jumper wire
  • Light dependent resistor

Let's now connect LDR to the Arduino.

Step 2: Connection of the LDR to Arduino

Picture of Connection of the LDR to Arduino

The LDR is also called as a light sensor that gives out a control signal to the Arduino Uno when the light around its surface decrease and it's very cheap.LDR is a light controlled variable resistor, the resistance of the resistor will decrease with the increasing incident light rays.It varies from few hundred ohms to mega ohms purely depending on light

LDR has no terminal or polarities dis-similar to other sensors available in the market.

We have used a 10kohm resistor to the LDR.

The connection of LDR is as follows:

  • One leg of the LDR is connected to the A0 pin of the Arduino since it is analog in nature and the same leg is connected to the ground via a 10k ohm resistor.
  • another leg is connected to the Positive supply i.e 5v Pin of the Arduino.

Step 3: Buzzer Connection

Picture of Buzzer Connection

A Buzzer is an electronic sound machine that converts the electrical impulse sent by the input device and converts them into sound energy.

the buzzer which I have used here has two wires in red and black color.

The connection of buzzer is as follows:

  • The buzzer positive or red wire is connected to the digital pin 3.
  • The buzzer negative or negative is connected to the GND pin of the Arduino.

Step 4: Coding

Picture of Coding

const int buzzerPin = 3;

const int ldrPin = A0;

void setup () {

Serial.begin(9600);

pinMode(buzzerPin, OUTPUT);

pinMode(ldrPin, INPUT); }

void loop() {

int ldrStatus = analogRead(ldrPin);

if (ldrStatus >= 400) { tone(buzzerPin, 100);

delay(100);

noTone(buzzerPin);

delay(100);

}

else {

noTone(buzzerPin);

} }

Step 5: Output

Comments

About This Instructable

87views

1favorite

License:

Bio: I am an electronic hobbyist on Arduino, Photon, Raspberry Pi and common electronics.A passionate cook.Any assistance in electronics and web development feel free ... More »
More by callmeappytechie:PIR Controlled Buzzer Using ArduinoDIY LampshadeTasty Egg Bonda
Add instructable to: