# OhmsLaw
Ohm's Law

Ohm's Law is one of the most important rules in electronics. It describes how **voltage**, **current**, and **resistance** are connected in any electrical circuit. Whether you are adding an LED to a breadboard or trying to figure out why a motor is stalling, Ohm's Law explains what is happening.

**Why does this matter?**

Every wire, battery, sensor, and motor in your robot follows Ohm's Law. Understanding it helps you predict how your circuit will behave — and helps you fix problems when something goes wrong.

**The Three Key Ideas**

The best way to understand these three ideas is to imagine electricity flowing through a water pipe:

- **Voltage (V)** — Measured in Volts. Voltage is like the **water pressure** in the pipe. It is the force that pushes electricity through the circuit. Higher voltage means a stronger push, which allows electricity to do more work.

- **Resistance (R)** — Measured in Ohms (Ω). Resistance is like a **kink or squeeze** in the pipe. It fights against the flow of electricity, slowing it down. Every wire, component, and material has some resistance.

- **Current (I)** — Measured in Amps (A). Current is like the **amount of water actually flowing** through the pipe. It is the rate at which electricity moves through the circuit.

**The Equation**

Ohm's Law says that these three values are always connected by one simple formula:

$$V = IR$$

Where:
- $V$ is voltage (Volts)
- $I$ is current (Amps)
- $R$ is resistance (Ohms)

Using basic algebra, you can rearrange this to solve for any of the three values:
- $V = I \times R$ — Find voltage if you know current and resistance
- $I = V / R$ — Find current if you know voltage and resistance
- $R = V / I$ — Find resistance if you know voltage and current

**How the Values Affect Each Other**

Because this is a ratio, changing one value always affects the others:

- **If Voltage goes up** (and Resistance stays the same): The push gets stronger, so more current flows. Think of turning up the water pressure — more water flows through the pipe.
- **If Resistance goes up** (and Voltage stays the same): The path gets more restricted, so less current flows. Think of squeezing the pipe tighter — less water gets through.

**A Real Example**

Say your Arduino outputs 5V and you want to safely light up an LED. A typical LED needs about 20mA (0.02A) of current. Using Ohm's Law, you can figure out what size resistor you need:

$$R = V / I = 5 / 0.02 = 250 \text{ Ohms}$$

So you would pick a resistor close to 250 Ohms to protect the LED!
