Using Arduino as a Simple 5V DC Power Source
No programming logic required - just constant voltage output
No programming logic required - just constant voltage output
Circuit 1: Simple LED Circuit (Ohm's Law Demonstration)
Arduino 5V Pin ----[220Ω Resistor]----[LED]---|>|---- GND
Component Layout:
┌─────────────────┐
│ ARDUINO UNO │
│ │
┌───┤ 5V │
│ │ │
│ │ GND ├───┐
│ └─────────────────┘ │
│ │
[R] 220Ω │
│ │
│ ┌───┐ │
└───┤ + │ LED (Red) │
└─┬─┘ │
│ │
└───────────────────┘
Materials Needed:
- 1× Red LED
- 1× 220Ω resistor
- 2× Jumper wires
Physics Principle: Ohm's Law
This circuit demonstrates the fundamental relationship between voltage, current, and resistance:
V = I × R
The LED is a diode that emits light when forward-biased. It has a forward voltage drop (Vf) that depends on the semiconductor material and color.
This circuit demonstrates the fundamental relationship between voltage, current, and resistance:
V = I × R
The LED is a diode that emits light when forward-biased. It has a forward voltage drop (Vf) that depends on the semiconductor material and color.
Calculations:
Given:
Vsupply = 5V (Arduino output)
Vf (red LED) = 2.0V
Desired If = 15mA = 0.015A
Step 1: Voltage across resistor
VR = Vsupply - Vf
VR = 5V - 2.0V = 3.0V
Step 2: Required resistance (Ohm's Law)
R = VR / If
R = 3.0V / 0.015A
R = 200Ω
Step 3: Use standard value
R = 220Ω (closest standard value)
Step 4: Actual current
I = VR / R = 3.0V / 220Ω = 13.6mA ✓
Step 5: Power dissipation
PR = I² × R = (0.0136)² × 220 = 0.041W = 41mW
(Well under 1/4W resistor rating)
Observations & Learning Points
- LED brightness is proportional to current (not voltage)
- Without resistor, excessive current would destroy LED instantly
- Different LED colors require different resistor values
- This is a series circuit - same current flows through all components
| LED Color | Vf (Typical) | Recommended R (5V) | Current |
|---|---|---|---|
| Red | 2.0V | 220Ω | 13.6mA |
| Yellow | 2.1V | 220Ω | 13.2mA |
| Green | 2.2V | 220Ω | 12.7mA |
| Blue | 3.2V | 100Ω | 18mA |
| White | 3.4V | 100Ω | 16mA |
Circuit 2: Series LED Circuit (Voltage Division)
Arduino 5V ----[100Ω]----[LED1]---|>|----[LED2]---|>|---- GND
Component Layout:
┌─────────────────┐
│ ARDUINO UNO │
│ │
┌───┤ 5V │
│ │ │
│ │ GND ├─────────────┐
│ └─────────────────┘ │
│ │
[R] 100Ω │
│ │
│ ┌───┐ │
├───┤ + │ LED1 (Red) │
└─┬─┘ │
│ │
┌─┴─┐ │
┤ + │ LED2 (Red) │
└─┬─┘ │
│ │
└─────────────────────────────┘
Materials Needed:
- 2× Red LEDs
- 1× 100Ω resistor
- 2× Jumper wires
Physics Principle: Kirchhoff's Voltage Law (KVL)
In a series circuit, the sum of all voltage drops equals the supply voltage:
Vsupply = VR + Vf1 + Vf2
All components carry the same current (series circuit property).
In a series circuit, the sum of all voltage drops equals the supply voltage:
Vsupply = VR + Vf1 + Vf2
All components carry the same current (series circuit property).
Calculations:
Given:
Vsupply = 5V
Vf1 = Vf2 = 2.0V (red LEDs)
Desired I = 15mA = 0.015A
Step 1: Total voltage drop across LEDs
VLED_total = Vf1 + Vf2
VLED_total = 2.0V + 2.0V = 4.0V
Step 2: Voltage across resistor
VR = Vsupply - VLED_total
VR = 5V - 4.0V = 1.0V
Step 3: Required resistance
R = VR / I
R = 1.0V / 0.015A = 67Ω
Step 4: Use standard value
R = 100Ω (provides safety margin)
Step 5: Actual current
I = VR / R = 1.0V / 100Ω = 10mA
(Slightly dimmer but safer)
Why This Works
- Two 2V LEDs in series = 4V total drop
- 5V supply - 4V LEDs = 1V remaining for resistor
- More efficient than parallel LEDs (uses less total current)
- All LEDs guaranteed equal brightness (same current)
⚠️ Important: With 5V supply, you can put maximum 2 red LEDs in series (3 would need 6V). Blue/white LEDs won't work in series with 5V (would need 6.4V+).
Circuit 3: Parallel LED Circuit (Current Division)
┌────[220Ω]────[LED1]---|>|────┐
│ │
Arduino 5V ───┼────[220Ω]────[LED2]---|>|────┼─── GND
│ │
└────[220Ω]────[LED3]---|>|────┘
Component Layout:
┌─────────────────┐
│ ARDUINO UNO │
│ │
┌───┤ 5V │
│ │ │
│ │ GND ├─────────────┐
│ └─────────────────┘ │
│ │
├──[R1]─[LED1]──────────────────────┤
│ 220Ω │
│ │
├──[R2]─[LED2]──────────────────────┤
│ 220Ω │
│ │
└──[R3]─[LED3]──────────────────────┘
220Ω
Materials Needed:
- 3× Red LEDs
- 3× 220Ω resistors
- Multiple jumper wires
Physics Principle: Kirchhoff's Current Law (KCL)
In a parallel circuit, total current is the sum of all branch currents:
Itotal = I1 + I2 + I3
All parallel branches see the same voltage (5V in this case).
In a parallel circuit, total current is the sum of all branch currents:
Itotal = I1 + I2 + I3
All parallel branches see the same voltage (5V in this case).
Calculations:
Each LED branch is independent:
Per branch: VR = 5V - 2.0V = 3.0V
Per branch: I = 3.0V / 220Ω = 13.6mA
Total current from Arduino:
Itotal = 3 × 13.6mA = 40.8mA
Power from Arduino 5V pin:
P = V × I = 5V × 0.041A = 0.205W
Arduino 5V pin can supply ~500mA, so this is safe.
Advantages of Parallel Configuration
- Each LED can be a different color (use appropriate resistor for each)
- If one LED fails open, others continue working
- Easy to add/remove LEDs without affecting others
- Each LED gets full brightness
How Many LEDs Can You Power?
Maximum from 5V pin ≈ 500mA (conservative)
Current per LED ≈ 13.6mA
Maximum LEDs = 500mA / 13.6mA ≈ 36 LEDs
Practical limit: 20-25 LEDs (leaves safety margin)
Circuit 4: Voltage Divider (Resistor Network)
Arduino 5V ────┬────── Measurement Point A (5V)
│
[R1] 10kΩ
│
├────── Measurement Point B (2.5V)
│
[R2] 10kΩ
│
GND ───────────┴────── Measurement Point C (0V)
Materials Needed:
- 2× 10kΩ resistors
- Multimeter (to measure voltages)
- Jumper wires
Physics Principle: Voltage Divider Rule
The voltage divider is one of the most fundamental circuits in electronics:
Vout = Vin × (R2 / (R1 + R2))
This circuit creates a reference voltage lower than the supply voltage without using a regulator.
The voltage divider is one of the most fundamental circuits in electronics:
Vout = Vin × (R2 / (R1 + R2))
This circuit creates a reference voltage lower than the supply voltage without using a regulator.
Calculations:
Configuration 1: Equal resistors (50% division)
R1 = R2 = 10kΩ
Vout = 5V × (10kΩ / (10kΩ + 10kΩ))
Vout = 5V × 0.5 = 2.5V
Configuration 2: 1/3 voltage (use R1=20kΩ, R2=10kΩ)
Vout = 5V × (10kΩ / (20kΩ + 10kΩ))
Vout = 5V × 0.333 = 1.67V
Configuration 3: 3/4 voltage (use R1=10kΩ, R2=30kΩ)
Vout = 5V × (30kΩ / (10kΩ + 30kΩ))
Vout = 5V × 0.75 = 3.75V
Current through divider:
I = 5V / (R1 + R2) = 5V / 20kΩ = 0.25mA
(Very low power consumption)
Practical Applications
- Creating reference voltages for analog circuits
- Scaling down voltages for measurement
- Bias networks for transistors
- Level shifting between different voltage systems
💡 Experiment: Try different resistor combinations and measure Vout with a multimeter. Verify your calculations!
| R1 | R2 | Vout (calculated) | Voltage Ratio |
|---|---|---|---|
| 10kΩ | 10kΩ | 2.5V | 1/2 |
| 20kΩ | 10kΩ | 1.67V | 1/3 |
| 10kΩ | 30kΩ | 3.75V | 3/4 |
| 1kΩ | 1kΩ | 2.5V | 1/2 |
| 100kΩ | 100kΩ | 2.5V | 1/2 |
Circuit 5: LED Brightness Levels (Manual PWM)
Configuration A: Full Brightness (Direct)
Arduino 5V ────[220Ω]────[LED]---|>|──── GND
Current: 13.6mA (100% brightness)
Configuration B: 50% Brightness (Series Resistors)
Arduino 5V ────[220Ω]────[220Ω]────[LED]---|>|──── GND
Current: 6.8mA (≈50% brightness)
Configuration C: 33% Brightness (More Resistance)
Arduino 5V ────[220Ω]────[220Ω]────[220Ω]────[LED]---|>|──── GND
Current: 4.5mA (≈33% brightness)
Materials Needed:
- 1× Red LED
- 3× 220Ω resistors
- Jumper wires
Physics Principle: LED Brightness vs Current
LED brightness is approximately proportional to forward current (in the normal operating range). By increasing resistance, we reduce current and therefore brightness.
Luminous Intensity ∝ Forward Current
(Relationship is roughly linear from 5mA to 20mA)
LED brightness is approximately proportional to forward current (in the normal operating range). By increasing resistance, we reduce current and therefore brightness.
Luminous Intensity ∝ Forward Current
(Relationship is roughly linear from 5mA to 20mA)
Calculations for Each Configuration:
Configuration A (220Ω total):
VR = 5V - 2.0V = 3.0V
I = 3.0V / 220Ω = 13.6mA
Relative brightness: 100%
Configuration B (440Ω total):
VR = 5V - 2.0V = 3.0V
I = 3.0V / 440Ω = 6.8mA
Relative brightness: 50%
Configuration C (660Ω total):
VR = 5V - 2.0V = 3.0V
I = 3.0V / 660Ω = 4.5mA
Relative brightness: 33%
Configuration D (1kΩ total - very dim):
I = 3.0V / 1000Ω = 3.0mA
Relative brightness: 22%
Observations
- Brightness changes are visible but not perfectly proportional to current
- Human eye has logarithmic response to light intensity
- Very low currents (< 2mA) may appear off in bright environments
- This demonstrates why PWM is preferred for smooth dimming
Circuit 6: RC Time Constant Demonstration
Arduino 5V ────┬──────────── Vout (measure with multimeter)
│
[R] 10kΩ
│
├──────────── Voltage rises exponentially
│
[C] 100µF
│
GND ───────────┴
Charging Curve:
V(t) = Vmax × (1 - e^(-t/RC))
5V ┤ _______________ ← 99% charged (5τ)
│ ___╱
│ __╱ ← 63% charged (1τ)
│ __╱
│__╱
0V └────────────────────────> time
0 1τ 2τ 3τ 4τ 5τ
Materials Needed:
- 1× 10kΩ resistor
- 1× 100µF electrolytic capacitor
- Multimeter
- Jumper wires
⚠️ Polarity Warning: Electrolytic capacitors have polarity! Connect the negative lead (marked with stripe) to GND, positive lead to the circuit. Reverse polarity can cause the capacitor to explode!
Physics Principle: Exponential Charging
When a capacitor charges through a resistor, the voltage rises exponentially according to:
V(t) = Vmax × (1 - e^(-t/τ))
Where τ (tau) is the time constant:
τ = R × C
The capacitor stores energy in an electric field between its plates. As it charges, the voltage across it increases, reducing the charging current (following Ohm's Law).
When a capacitor charges through a resistor, the voltage rises exponentially according to:
V(t) = Vmax × (1 - e^(-t/τ))
Where τ (tau) is the time constant:
τ = R × C
The capacitor stores energy in an electric field between its plates. As it charges, the voltage across it increases, reducing the charging current (following Ohm's Law).
Calculations:
Time constant:
τ = R × C
τ = 10,000Ω × 0.0001F
τ = 1 second
Voltage at specific times:
At t = 0s: V = 5V × (1 - e^0) = 0V
At t = 1s: V = 5V × (1 - e^-1) = 3.16V (63%)
At t = 2s: V = 5V × (1 - e^-2) = 4.32V (86%)
At t = 3s: V = 5V × (1 - e^-3) = 4.75V (95%)
At t = 5s: V = 5V × (1 - e^-5) = 4.97V (99%)
Rule of thumb: Fully charged after 5τ = 5 seconds
Energy stored when fully charged:
E = ½CV² = ½ × 100µF × (5V)²
E = 0.00125 Joules = 1.25 mJ
Experiment Procedure
- Start with capacitor discharged (short leads together briefly)
- Connect circuit with 5V from Arduino
- Watch multimeter voltage rise from 0V to 5V
- Note time to reach 3.16V (should be ≈1 second)
- Note time to reach ~5V (should be ≈5 seconds)
Try Different Values
| R | C | τ (Time Constant) | Full Charge Time |
|---|---|---|---|
| 1kΩ | 100µF | 0.1s | 0.5s |
| 10kΩ | 100µF | 1.0s | 5s |
| 100kΩ | 100µF | 10s | 50s |
| 10kΩ | 10µF | 0.1s | 0.5s |
Real-World Applications
- Timing circuits (delay before action)
- Filter circuits (smoothing power supplies)
- Oscillators (555 timer circuits)
- Flash photography (energy storage)
- Debouncing switches
Circuit 7: Resistor Color Code Practice Board
┌──[R1]──[LED1]──┐
│ │
├──[R2]──[LED2]──┤
Arduino 5V ─────┼──[R3]──[LED3]──┼──── GND
├──[R4]──[LED4]──┤
│ │
└──[R5]──[LED5]──┘
Where R1-R5 are different values:
R1 = 220Ω (Red-Red-Brown)
R2 = 1kΩ (Brown-Black-Red)
R3 = 10kΩ (Brown-Black-Orange)
R4 = 100Ω (Brown-Black-Brown)
R5 = 470Ω (Yellow-Violet-Brown)
Materials Needed:
- 5× LEDs (same color, e.g., all red)
- 1× 220Ω resistor
- 1× 1kΩ resistor
- 1× 10kΩ resistor
- 1× 100Ω resistor
- 1× 470Ω resistor
- Jumper wires
Learning Objective: Resistor Color Code Reading
This circuit creates visible brightness differences based on resistor values, helping you learn to identify resistors by their color bands.
Color Code System:
Band 1 & 2: Significant digits
Band 3: Multiplier (×10^n)
Band 4: Tolerance (Gold = ±5%, Silver = ±10%)
This circuit creates visible brightness differences based on resistor values, helping you learn to identify resistors by their color bands.
Color Code System:
Band 1 & 2: Significant digits
Band 3: Multiplier (×10^n)
Band 4: Tolerance (Gold = ±5%, Silver = ±10%)
Expected Brightness (all with red LEDs, Vf=2.0V):
R1 = 100Ω:
I = 3.0V / 100Ω = 30mA (Very bright - at LED max!)
R2 = 220Ω:
I = 3.0V / 220Ω = 13.6mA (Bright - recommended)
R3 = 470Ω:
I = 3.0V / 470Ω = 6.4mA (Medium)
R4 = 1kΩ:
I = 3.0V / 1000Ω = 3.0mA (Dim)
R5 = 10kΩ:
I = 3.0V / 10000Ω = 0.3mA (Very dim/barely visible)
Brightness order: R1 > R2 > R3 > R4 > R5
Visual Learning Exercise
- Build the circuit with all 5 LEDs
- Observe the brightness differences
- Remove one resistor at a time and read its color code
- Calculate expected current before measuring
- Swap resistor positions and see LEDs change brightness
Circuit 8: Maximum Power Transfer Demonstration
Scenario A: Mismatched Load (Inefficient)
Arduino 5V ────[10kΩ source]────┬──── 0.45V (only 9% of voltage!)
│
[1kΩ load]
│
GND ─────────────────────────────┴
Scenario B: Matched Load (Maximum Power)
Arduino 5V ────[10kΩ source]────┬──── 2.5V (50% of voltage)
│
[10kΩ load]
│
GND ─────────────────────────────┴
Scenario C: Low Resistance Load
Arduino 5V ────[10kΩ source]────┬──── 4.55V (91% of voltage!)
│
[100kΩ load]
│
GND ─────────────────────────────┴
Materials Needed:
- 1× 10kΩ resistor (source resistance)
- 1× 1kΩ resistor (load)
- 1× 10kΩ resistor (load)
- 1× 100kΩ resistor (load)
- Multimeter
Maximum Power Transfer Theorem
Maximum power is delivered to a load when the load resistance equals the source resistance:
Pmax occurs when Rload = Rsource
However, maximum efficiency (voltage transfer) occurs when Rload >> Rsource
Maximum power is delivered to a load when the load resistance equals the source resistance:
Pmax occurs when Rload = Rsource
However, maximum efficiency (voltage transfer) occurs when Rload >> Rsource
Calculations for Each Scenario:
Scenario A: Rload = 1kΩ (much smaller than Rsource)
Total R = 10kΩ + 1kΩ = 11kΩ
I = 5V / 11kΩ = 0.45mA
Vload = 0.45mA × 1kΩ = 0.45V
Pload = I² × Rload = (0.00045)² × 1000 = 0.20mW
Scenario B: Rload = 10kΩ (matched impedance)
Total R = 10kΩ + 10kΩ = 20kΩ
I = 5V / 20kΩ = 0.25mA
Vload = 0.25mA × 10kΩ = 2.5V
Pload = I² × Rload = (0.00025)² × 10000 = 0.625mW ← Maximum!
Scenario C: Rload = 100kΩ (much larger than Rsource)
Total R = 10kΩ + 100kΩ = 110kΩ
I = 5V / 110kΩ = 0.045mA
Vload = 0.045mA × 100kΩ = 4.55V
Pload = I² × Rload = (0.000045)² × 100000 = 0.20mW
Key Observations
- Matched impedance (Scenario B) delivers maximum power to load
- But only 50% voltage efficiency (2.5V out of 5V)
- High load resistance (Scenario C) gives best voltage transfer but low power
- This principle is critical in audio, RF, and power systems
/*
* Arduino as 5V DC Power Source
* No logic required - just constant outputs
*/
void setup() {
// Set pin 9 as OUTPUT and HIGH for 5V DC
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
// Optional: Built-in LED for power indicator
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
Serial.begin(9600);
Serial.println("Arduino 5V DC Power Source Active");
Serial.println("Pin 9: 5V constant output");
Serial.println("Pin 13: Power indicator LED ON");
}
void loop() {
// Nothing needed - pins stay in their states
// Arduino maintains constant 5V output on pin 9
}
💡 Pro Tip: You can also use the Arduino's dedicated 5V pin directly without any code! Simply connect your circuits to:
- 5V pin - Regulated 5V output (up to 500mA from USB, more from DC barrel jack)
- GND pin - Ground reference
Comparison Table: Arduino vs Battery Power
| Feature | Arduino 5V Pin | Arduino Digital Pin | 4× AA Batteries (6V) | 9V Battery |
|---|---|---|---|---|
| Voltage | 5.0V (regulated) | 5.0V (regulated) | 6.0V (fresh) → 4.8V (depleted) | 9.0V (fresh) → 7.2V (depleted) |
| Current Capacity | ~500mA (USB) ~900mA (barrel) |
40mA max per pin | 2000-3000mAh (1-2A continuous) |
500mAh (100mA continuous) |
| Stability | Excellent (regulated) | Excellent (regulated) | Decreases over time | Decreases over time |
| Cost | $0 (if Arduino available) | $0 (if Arduino available) | ~$4-6 (rechargeable cheaper long-term) | ~$2-4 per battery |
| Portability | Requires USB or adapter | Requires USB or adapter | Excellent (compact) | Excellent (very compact) |
| Best Use Case | Benchtop testing, multiple circuits |
Simple LED circuits, educational demos |
Portable projects, motor drivers |
Low-current sensors, 9V devices |
Safety Guidelines & Best Practices
⚠️ Critical Safety Rules:
- Never exceed 40mA per digital pin - Use 5V pin or external power for higher currents
- Never short 5V to GND - Will damage Arduino or blow USB port fuse
- Check polarity - LEDs, capacitors, and some components have polarity requirements
- Double-check calculations - Wrong resistor values can destroy components
- Use appropriate wire gauge - Thin wires can overheat with high current
✓ Best Practices for Circuit Building:
- Color code your wires: Red = +5V, Black = GND, other colors for signals
- Measure before connecting: Use multimeter to verify resistor values
- Build incrementally: Add one component at a time, test as you go
- Keep organized: Neat wiring makes troubleshooting much easier
- Document your work: Take photos, draw schematics, note calculations
- Use breadboard strategically: Keep power rails clean, use rows efficiently
Why These Circuits Are Excellent Learning Tools:
- Immediate visual feedback - See results instantly with LEDs
- No programming required - Focus purely on electronics fundamentals
- Safe voltage levels - 5V is safe to handle and work with
- Builds foundation - These principles apply to all circuit design
- Easy to modify - Swap components and see what changes
- Real measurements - Use multimeter to verify theoretical calculations