🌡️ Analog Inputs and Sensors: Potentiometer & LDR
When you’re building Arduino projects, analog inputs let your board read a range of values instead of just on/off signals. This is where sensors like potentiometers and LDRs (Light Dependent Resistors) come in handy—they provide variable signals that your Arduino can use to make decisions in your project.
🔹 What Are Analog Inputs?
Analog inputs measure a range of values, usually from 0 to 1023 on Arduino boards. Unlike digital inputs (HIGH/LOW), analog inputs can detect gradual changes like light intensity, temperature, or knob rotation.
🔹 Potentiometer (Variable Resistor)
A potentiometer is an adjustable resistor that lets you manually vary voltage. It’s perfect for controlling things like:
- LED brightness
- Motor speed
- Volume control in audio projects
🔹 LDR (Light Dependent Resistor)
An LDR changes its resistance based on the amount of light hitting it. This makes it ideal for:
- Light-sensitive alarms
- Automatic night lights
- Sunlight tracking projects
🚀 Getting Started
Connect your potentiometer or LDR to an analog input pin and use analogRead() in your sketch. Watch the values change in the Serial Monitor, and then use them to control LEDs, motors, or other devices. It’s a fun way to see real-world data in action!