In this tutorial, we’ll build a simple light alarm system using an Arduino Uno and a 3-pin LDR sensor module. This system detects when someone blocks a light source—like breaking a beam—and triggers an LED alert, simulating a basic laser tripwire.
Light Alarm System
🔍 What Is an LDR Sensor?
An LDR (Light Dependent Resistor) is a sensor that changes its resistance based on the amount of light it receives. In brighter light, resistance drops; in darkness, resistance increases. By using the analogRead() function, we can detect the intensity of ambient light.
📦 What You’ll Need
To get started, you will need the following components:
Components required for this tutorial
✅ Arduino UNO × 1
✅ 3-pin LDR Module × 1
✅ Jumper Wires × 1
✅ USB cable for Arduino × 1
✅ Resistor 220Ω × 1
✅ Breadboard × 1
🛠️ Circuit Wiring
Here’s how to connect each component to the Arduino:
3-pin LDR module wiring
3-pin LDR Module
✅ VCC → 5V on Arduino
✅ GND → GND on Arduino
✅ A0 → Analog pin A0 on Arduino
LED and resistor wiring
LED and Resistor
✅ LED Anode (long leg) → Digital pin 9 on Arduino
✅ LED Cathode (short leg) → 220Ω resistor → GND on Arduino
The connection between components and Arduino
💻 Uploading the Code
After wiring everything up, connect the Arduino to your computer using a USB cable. Then, upload the following code, or you can download the code HERE.
int ldrPin = A0;
int ledPin = 9;
int baselineLight = 800; // Adjust based on your lighting
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int ldrValue = analogRead(ldrPin);
Serial.println(ldrValue);
if (ldrValue < baselineLight - 200) { // Sudden drop in light
digitalWrite(ledPin, HIGH); // Alert
} else {
digitalWrite(ledPin, LOW);
}
delay(100);
}
Open Arduino IDE and copy-paste the code
The system reads the LDR sensor using analogRead(ldrPin) (range: 0–1023), compares it to the baselineLight value representing normal ambient light, and if the light level drops significantly—by more than 200 units—the LED is activated to indicate an alert.
🧪 Test the System
Once you've uploaded the code and completed the wiring, it's time to test how the system reacts to different light levels:
Place your hand over the sensor, and the LED will turn ON.
Remove your hand, and once the light returns to normal, the LED will turn OFF
📌 Conclusion
This project is a simple and fun way to get started with analog sensors, security concepts, and Arduino programming. You’ve now created a basic light alarm system that responds to interruptions in a light beam—just like a basic tripwire!
Have you ever seen lights that automatically dim or brighten based on the lighting around them? In this project, we’ll show you how to make your own auto-dimming LED using an Arduino Uno and a Light Dependent Resistor (LDR) sensor.
Smart LED Dimming
📦 What You’ll Need
To get started, you will need the following components:
Components required for this tutorial
✅ Arduino UNO × 1
✅ 3-pin LDR Module × 1
✅ Jumper Wires × 1
✅ USB cable for Arduino × 1
✅ Resistor 220Ω × 1
✅ Breadboard × 1
🛠️ Circuit Wiring
Here’s how to connect each component to the Arduino:
3-pin LDR module wiring
3-pin LDR Module
✅ VCC → 5V on Arduino
✅ GND → GND on Arduino
✅ A0 → Analog pin A0 on Arduino
LED and resistor wiring
LED and Resistor
✅ LED Anode (long leg) → Digital pin 9 on Arduino
✅ LED Cathode (short leg) → 220Ω resistor → GND on Arduino
The connection between components and Arduino
💻 Uploading the Code
After wiring everything up, connect the Arduino to your computer using a USB cable. Then, upload the following code, or you can download the code HERE.
int ldrPin = A0;
int ledPin = 9;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
int ldrValue = analogRead(ldrPin);
int ledBrightness = map(ldrValue, 0, 1023, 255, 0); // Invert brightness
analogWrite(ledPin, ledBrightness);
delay(100);
}
Open Arduino IDE and copy-paste the code
The analogRead() function reads the ambient light level from the LDR (ranging from 0 to 1023), then map() converts that value to a PWM range (255 to 0) to invert the brightness, and finally analogWrite() sets the LED brightness based on the mapped value.
🧪 Test the System
Once you've uploaded the code and completed the wiring, it's time to test how the system reacts to different light levels:
Observe the LED in normal lighting—it should appear dim or completely off if the room is bright.
Slowly cover the LDR sensor with your hand or a piece of paper. You should see the LED gradually get brighter as the light decreases.
Fully cover the LDR sensor with your hand the LED will get brighter as the light level drops.
📌 Conclusion
This auto-dimming LED project is a fantastic introduction to how sensors can make electronics smarter. You’ve learned how to read light levels with an LDR, process the input, and control an LED with PWM based on real-world light conditions.
Have you ever wanted a light that turns ON automatically when it’s dark and OFF when it’s bright? In this beginner-friendly project, we’ll show you how to build a simple light-sensitive LED control system using an Arduino and an LDR (Light Dependent Resistor) module.
Simple LED Auto ON/OFF
📦 What You’ll Need
To get started, you will need the following components:
Components required for this tutorial
✅ Arduino UNO × 1
✅ 3-pin LDR Module × 1
✅ Jumper Wires × 1
✅ USB cable for Arduino × 1
✅ Resistor 220Ω × 1
✅ Breadboard × 1
🛠️ Circuit Wiring
Here’s how to connect each component to the Arduino:
3-pin LDR module wiring
3-pin LDR Module
✅ VCC → 5V on Arduino
✅ GND → GND on Arduino
✅ A0 → Analog pin A0 on Arduino
LED and resistor wiring
LED and Resistor
✅ LED Anode (long leg) → Digital pin 9 on Arduino
✅ LED Cathode (short leg) → 220Ω resistor → GND on Arduino
The connection between components and Arduino
💻 Uploading the Code
After wiring everything up, connect the Arduino to your computer using a USB cable. Then, upload the following code, or you can download the code HERE.
int ldrPin = A0;
int ledPin = 9;
int threshold = 500;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int ldrValue = analogRead(ldrPin);
Serial.println(ldrValue);
if (ldrValue < threshold) {
digitalWrite(ledPin, HIGH); // It's dark, turn on LED
} else {
digitalWrite(ledPin, LOW); // It's bright, turn off LED
}
delay(200);
}
Open Arduino IDE and copy-paste the code
The value 500 is the light threshold. You can check the actual LDR readings via the Serial Monitor and adjust this number depending on your room lighting conditions.
🧪 Test the System
In low light, the LED should turn ON.
In bright light, the LED should turn OFF.
📌 Conclusion
This project is a simple yet powerful introduction to sensor-based automation using Arduino. By combining a Light Dependent Resistor (LDR) with an LED, you’ve created a system that can react to ambient light—automatically turning the light ON in the dark and OFF in bright conditions.
Is your Samsung washing machine refusing to spin at the end of the wash cycle? Don’t panic — this is a common issue and is often caused by a faulty drain motor. In this blog, we’ll walk you through the step-by-step process to troubleshoot and replace the drain motor yourself.
Drain motor replacement guide.
🪛Step-by-Step Instructions
Step 1:🔍 Common Symptom
Washing machine not spinning.
Problem: The washing machine completes the wash and rinse cycle, but does not spin.
Likely Cause: The drain motor is not working, which means water stays in the drum and the spin cycle won't start.
Step 2:🔧Access the Drain Motor
To begin troubleshooting:
Unplug the washing machine for safety.
Remove the back cover by unscrewing two screws.
Remove the back cover.
Detach the hose inlet.
Remove the hose inlet.
If there’s still water in the drum, manually pull the drain valve to let the water out.
Pull the drain valve to let the water out.
Step 3:🔌Test Drain Motor Voltage
Tilt the washing machine backward for better access.
Tilt the washing machine.
Disconnect the drain motor wiring.
Pull the drain motor connector.
Plug the machine back in and set it to Spin mode.
Set it to Spin mode.
Use a multimeter to measure voltage at the motor connector. Normal voltage 230±10% VAC.
If voltage is present but the motor doesn’t operate, the drain motor is faulty.
Step 4:🪛Remove the Faulty Drain Motor
Remove the three screws holding the drain motor in place.
Remove the drain motor.
Disconnect the drain motor wire from the drain valve.
Carefully pull the motor out.
Step 5:⚙️Install the New Drain Motor
Reconnect the drain motor wire.
Attach the drain motor wire to the drain valve.
Align and secure the new drain motor in place.
Reattach the motor screws.
Test it by setting the machine to Spin.
The motor should pull the valve open.
Step 6:🧩Reassemble the Machine
Put everything back, reconnect the hose inlet and reinstall the back cover.
Install the back cover.
Step 7: 🧪Final Testing
Pour some water into the washing machine bucket and set it to Spin.
The drain valve opens, and water drains out.
Once the drain water empties, the washer begins spinning.
🎉Conclusion
A non-spinning Samsung washer is often caused by a faulty drain motor, and as you’ve seen, replacing it is a manageable DIY task. By checking the voltage and following a few simple steps, you can save both time and repair costs.
If you found this helpful, don’t forget to like the video, leave a comment, and subscribe to our channel for more tech tips and tutorials! Your support means a lot. 🙌