Visualizing Resistance With Arduino

by MakeCrate in Circuits > Arduino

624 Views, 2 Favorites, 0 Comments

Visualizing Resistance With Arduino

Measure the Resistance Web.png

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.

Connect to Ground.

Measure the Resistance Web4.png

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

Add an LED

Measure the Resistance Web6.png

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

Add Your First Resistor

Measure the Resistance Web10.png

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.

Power the LED

Measure the Resistance Web10.png

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.

Read the Resistance Level

Measure the Resistance Web12.png

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.

Add a Second LED

Measure the Resistance Web14.png

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.

Add the Second Resistor

Measure the Resistance Web16.png

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.

Power the Second LED

Measure the Resistance Web18.png

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.

Read the Second Resistance Level

Measure the Resistance Web20.png

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.

Code Your Circuit.

resistance code.PNG

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); }

Or Copy Our Code

resistance code.PNG