← Back to Basic Projects

⚑ Ohm's Law Interactive Trainer

Prove V = IR on a breadboard. Swap resistors and watch the voltage drop change in real time β€” the most important equation in electronics.

πŸ“‹ Overview

Ohm's Law (V = I Γ— R) is the cornerstone of all electronics. This project creates a live 'lab bench' on your breadboard: swap resistors, measure voltages, and visually confirm the law holds true.

Technical Insight: By using Arduino's 10-bit ADC (analogRead), which measures 0–5V across 1024 steps (β‰ˆ4.9 mV per step), you can accurately resolve voltage drops across different resistors in a simple series circuit. This is exactly how industrial data-acquisition systems and digital multimeters work.

In simple terms: Connect a known resistor in series with a known supply voltage and a current-limiting resistor. The Arduino reads the voltage across the unknown resistor and calculates: Current (mA) = (V_supply βˆ’ V_read) / R_known.

What you'll learn: Voltage divider principles, analogRead() for voltage measurement, Ohm's Law verification, series circuit analysis, and unit conversion in code.

Estimated time: 30-45 minutes. Difficulty: ⭐ Beginner-friendly β€” ideal for physics/electrical students.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R3ATmega328P, 5V1Any Uno-compatible board
Resistors (assorted)100Ξ©, 220Ξ©, 470Ξ©, 1kΞ©4Swap to see different readings
LED5mm Red1Visual current indicator
Breadboard + WiresHalf-size1
USB CableType A to B1

πŸ—ΊοΈ Component Pin Mapping

Ohm's Law Interactive Trainer Component Pin Mapping Infographic

πŸ“– Step-by-Step Tutorial

1

Build the Series Circuit

Wire: Arduino 5V β†’ 220Ξ© fixed resistor β†’ analog pin A0 β†’ test resistor β†’ GND. The voltage at A0 is the voltage across the test resistor.
2

Upload the Code

Upload the sketch. The Arduino reads A0, converts it to voltage, and calculates current using Ohm's Law.
3

Open Serial Monitor

Set baud to 9600. You'll see: Voltage (V), Current (mA), and Resistance (Ξ©) printed every second.
4

Swap Resistors

Replace the test resistor with a different value. Watch the voltage and current readings change β€” Ohm's Law proven live!
5

Record Readings

Fill a table: R (Ξ©) | V (V) | I (mA). Check that V/I = R in every row. This is your lab report!
πŸ’‘
Pro Tip: Arduino's 5V pin is usually around 4.8V when powered by USB. For accurate results, measure the actual supply voltage first (connect 5V to A1) and use that as your reference in the code.

πŸ’» Arduino Code

ohms_law_trainer.ino
INO
// Ohm's Law Trainer β€” Volt X
// Circuit: 5V --> 220Ξ© (fixed) --> A0 --> Test Resistor --> GND

const float SUPPLY_V = 5.0;     // Supply voltage (adjust if needed)
const float FIXED_R = 220.0;    // Known series resistor in Ohms
const int   SENSE_PIN = A0;     // Voltage divider midpoint

void setup() {
  Serial.begin(9600);
  Serial.println("=== Ohm's Law Trainer β€” Volt X ===");
  Serial.println("Swap the test resistor and observe changes!");
  Serial.println("V(drop) | Current | Test Resistance");
}

void loop() {
  int raw = analogRead(SENSE_PIN);
  float v_test = raw * (SUPPLY_V / 1023.0); // Voltage across test resistor
  float v_fixed = SUPPLY_V - v_test;        // Voltage across fixed resistor
  float current_mA = (v_fixed / FIXED_R) * 1000.0; // I = V/R in mA
  float r_test = (current_mA > 0) ? (v_test / (current_mA / 1000.0)) : 0;

  Serial.print(v_test, 3); Serial.print(" V  |  ");
  Serial.print(current_mA, 2); Serial.print(" mA  |  ");
  Serial.print(r_test, 1); Serial.println(" Ohm");
  delay(1000);

⭐Reviews & Ratings

β€”0 reviews
5β˜…
0
4β˜…
0
3β˜…
0
2β˜…
0
1β˜…
0
...

Loading reviews...

volt-X / Ohm's Law Interactive Trainer β€” Arduino Tutorial