Introduction: Visualizing Resistance With Arduino

About: MakeCrate provides coding and engineering kits and online curriculum to get kids excited about making!

In this instructable, you'll visualize how varying resistors change a circuit. Using a 220 Ohm resistor and a 10K ohm resistor, you'll see the variation in light levels in two LEDs as well as see the variation in the voltage across those circuits by using the serial monitor.

Step 1: Connect to Ground.

Connect a jumper wire from the GND pin on the Arduino to the long negative line on the left side of your breadboard.

Step 2: Add an LED

Insert an LED into holes E1 and F1 on your breadboard, with the longer leg in hole F1.

Step 3: Add Your First Resistor

Insert one end of a 220 Ohm resistor into the long negative line on the left of the breadboard, and the other into spot B1 on the breadboard.

Step 4: Power the LED

Insert one end of a jumper wire into spot H1 on the breadboard, and the other into pin 10 on the Arduino. This wire will provide power to your LED.

Step 5: Read the Resistance Level

Insert one end of a jumper wire into spot C1 on the breadboard, and the other into pin A1 on the Arduino. This wire will measure the resistance in your LED circuit.

Step 6: Add a Second LED

Insert one end of a jumper wire into spot C1 on the breadboard, and the other into pin A1 on the Arduino. This wire will measure the resistance in your LED circuit.

Step 7: Add the Second Resistor

Insert one end of a 10K Ohm resistor into the long negative line on the left of the breadoard, and the other into spot B5 on the breadboard.

Step 8: Power the Second LED

Insert one end of a jumper wire into spot H5 on the breadboard, and the other into pin 9 on the Arduino. This wire will provide power to your LED.

Step 9: Read the Second Resistance Level

Insert one end of a jumper wire into spot C5 on the breadboard, and the other into pin A2 on the Arduino. This wire will measure the resistance in your LED circuit.

Step 10: Code Your Circuit.

int resistor1 = A5;

int resistor2 = A4;

int LEDPin1 =10;

int LEDPin2 = 9;

float voltage1;

float voltage2;

void setup() {

Serial.begin(9600);

pinMode(resistor1, INPUT);

pinMode(resistor2, INPUT);

pinMode(LEDPin1, OUTPUT);

pinMode(LEDPin2, OUTPUT);

}

void loop() {

int resistor1Value= analogRead(resistor1);

digitalWrite(LEDPin1, HIGH);

voltage1= resistor1Value*(5.0/1023.0);

Serial.print("Voltage 1 = ");

Serial.println(voltage1);

delay(2000);

int resistor2Value= analogRead(resistor2);

digitalWrite(LEDPin2, HIGH);

voltage2= resistor2Value*(5.0/1023.0);

Serial.print("Voltage 2 = ");

Serial.println(voltage2);

delay(2000); }

Step 11: Or Copy Our Code