Back

How Circuits Work

Voltage Dividers, Voltmeters, and Pull-Up / Pull-Down Resistors

Chapter 4: Reading Voltages ·

This page sums up what you play through in ElecLab Chapter 4, "Reading Voltages", with diagrams and worked numbers. It explains that a voltage is a difference between two points, how a voltage divider splits a voltage by the ratio of two resistors, how a potentiometer changes it with a knob, how a microcontroller input pin reads HIGH or LOW and why it needs a pull-up or pull-down resistor, and how to read temperature and light by putting a sensor into a divider.

1. A voltage is a difference between two points: connecting a voltmeter

A voltage is the difference in "electrical height" between one point and another. Connect a voltmeter side by side (in parallel) across the part you want to measure: the red (+) lead on the side closer to the battery's +, and the black (−) lead on the far side. Swap them and the reading turns negative.

A voltmeter has a very large internal resistance (10 MΩ in ElecLab, about the same as a real digital multimeter), so almost no current goes through it. That's why connecting it in parallel hardly changes the circuit. But put it in series, in the middle of the loop, and its 10 MΩ almost stops the current, so the LED goes out.

B13VR11kΩVM13.00 V−+−+
+ (red) toward +: 3.00 V
B13VR11kΩVM1−3.00 V−+−+
Connected backward: −3.00 V

Wiring example from 4-1

Going once around a loop, the voltages across the parts in series add up to the battery voltage (Kirchhoff's voltage law). Example: a 1 kΩ resistor and a red LED in series on a 9V battery carry (9 − 2) ÷ (1000 + 10) ≈ 6.93 mA. The LED gets 2.07V and the resistor 6.93V, which add up to 9.00V.

2. Voltage dividers: splitting a voltage by a ratio

With two resistors in series, the battery voltage splits in the ratio of their resistances. This is a voltage divider. The same current flows through both, so the larger resistor gets the larger voltage.

Output voltage = battery voltage × R_bottom ÷ (R_top + R_bottom)

R_top is the resistor on the battery's + side and R_bottom the one on the − side. The output is the voltage between the point where they meet and −. In the figure, 3V is split by 1 kΩ and 2 kΩ into 1.00V and 2.00V.

B13VR11kΩR22kΩVM11.00 VVM22.00 V−+−+−+
1 kΩ and 2 kΩ: 3V splits into 1.00 V and 2.00 V (1 : 2)

Wiring example from 4-2

The same ratio gives the same voltage whatever the values. 1 kΩ with 2 kΩ, or 10 kΩ with 20 kΩ, both give 2.00V from 3V. What changes is the current: 1 mA for 1 kΩ and 2 kΩ, 0.1 mA for 10 kΩ and 20 kΩ. Larger values drain the battery less, but whatever you connect to the output affects them more. This circuit is used to pass a 5V microcontroller signal to a 3.3V part, and to turn a sensor's change in resistance into a voltage.

3. Potentiometers: changing the division with a knob

A potentiometer has two end terminals and a middle terminal (the wiper) that moves with the knob. The wiper splits the total resistance in two, so with the ends connected to the battery's + and −, the wiper gives you a divided voltage. Turning the knob changes the split, and so the voltage.

VR110kΩ 30%end 0end 1wiper
Knob at 30%: 3 kΩ from end 0 to the wiper, 7 kΩ from the wiper to end 1
R13kΩR27kΩend 0end 1wiper
The same as 3 kΩ and 7 kΩ in series, with a wire taken from the joint

Wiring example from 4-3

Using just one end and the wiper, the knob changes a resistance (for example, to dim an LED). But turned all the way, it drops to almost 0 Ω and too much current flows through the LED. Add a fixed resistor in series so the current stays under the limit even at the end of the knob. If you use only the two end terminals, the resistance between them stays at the full value however you turn the knob.

B15VVR11kΩ 50%L15.9 mA−++−
Knob at 50%: about 500 Ω, the LED lights
B15VVR11kΩ 0%L1Burned! 200 mA−++−
Turned all the way (0%): almost 0 Ω, it burns out

Wiring example from 4-4

4. Microcontroller input pins: HIGH, LOW, and floating

A microcontroller (such as an Arduino) input pin reads the pin's voltage and decides HIGH or LOW. ElecLab's input pin (running at 5V) reads HIGH at 3.5V or more and LOW at 1.5V or less (70% and 30% of the supply voltage, a common rule for CMOS chips). A voltage in between is neither.

Almost no current flows into an input pin. So a pin connected to nothing has no set voltage, and noise or a tiny leakage current can make it read HIGH or LOW. This is called floating. ElecLab works out how far the pin's voltage can move with the microcontroller's leakage current (up to ±1 µA), and calls the input floating if that range doesn't fit entirely in HIGH or entirely in LOW. Forgetting to connect the microcontroller's GND to the circuit's − also leaves it floating, because there's no reference for the voltage.

B15VMCU INH 5.00 V−+GNDIN
IN to +: HIGH
B15VMCU INL 0.00 V−+GNDIN
IN to −: LOW
B15VMCU IN? floating−+GNDIN
Not connected: floating

Wiring example from 4-5

5. Pull-up and pull-down resistors

With only a button on the input pin, the reading is set while you press, but when you release the pin floats. So you "pull" the pin toward + or − with a resistor. Pulling it to − is a pull-down (LOW when released, HIGH when pressed), and pulling it to + is a pull-up (HIGH when released, LOW when pressed).

Almost no current flows into the input, so even through the resistor the pin stays at the voltage it's pulled to. Pull-ups are the more common choice on microcontrollers, and many have built-in pull-up resistors (such as Arduino's INPUT_PULLUP).

B15VR14.7kΩMCU INH 5.00 V−+GNDIN
4.7 kΩ to +: HIGH (5.00 V)

Wiring example from 4-6

Choosing the resistor's size

If a pull-up is too small, current keeps flowing from + to − while the button is pressed (5V ÷ 1 kΩ = 5 mA, 5V ÷ 100 kΩ = 0.05 mA). If it's too large, the shift caused by leakage current (1 µA × resistance) grows: about 1V at 1 MΩ, and about 10V at 10 MΩ, so the reading is neither HIGH nor LOW. A few kΩ to a few tens of kΩ is the usual range.

Pull-up resistorCurrent while pressedShift from 1 µA leakage
1 kΩ5 mA0.001V
100 kΩ0.05 mA0.1V
1 MΩ0.005 mAAbout 1V
10 MΩ0.0005 mAAbout 10V (floating)

6. Sensors in a divider: thermistors and CdS cells

A thermistor is a part whose resistance drops as the temperature rises (an NTC thermistor). ElecLab's thermistor is modeled as 10 kΩ at 25°C with a B constant of 3435 K: about 28.7 kΩ at 0°C, 10 kΩ at 25°C, and about 2.98 kΩ at 60°C.

Put a part whose resistance changes in series with a fixed resistor, and the divided voltage changes with it, so you can read temperature as a voltage. Example: with 10 kΩ on the + side of a 5V battery and the thermistor on the − side, the voltage where they meet is about 3.71V at 0°C, 2.50V at 25°C, and about 1.15V at 60°C, falling as it gets warmer. Swap the two and the voltage rises as it gets warmer instead.

B15VTH10°CL11.0 mA−++−
0°C: about 2.9 kΩ, dim
B15VTH160°CL19.7 mA−++−
60°C: about 300 Ω, bright

Wiring example from 4-7 — To show the effect clearly, the figure puts a thermistor that is 1 kΩ at 25°C in series with an LED

A CdS cell (photoresistor) has lower resistance the brighter it is. ElecLab's CdS cell is 15 kΩ at 10 lux (a dim room), about 75 kΩ at 1 lux, about 3 kΩ at 100 lux, about 0.6 kΩ at 1000 lux, and stops at 1 MΩ in total darkness. In a divider it lets you read light as a voltage. Compare the output with the input pin's thresholds (HIGH 3.5V, LOW 1.5V) and you can make a decision like "HIGH when it gets dark". Remember that in series the larger resistance gets the larger voltage, and work out which side the CdS cell should go on.

B15VCDS11 luxL10.1 mA−++−
1 lux (dark): about 25 kΩ, barely glows
B15VCDS11000 luxL114.4 mA−++−
1000 lux (bright): about 200 Ω, lights up

Wiring example from 4-8 — To show the effect clearly, the CdS cell in the figure is 5 kΩ at 10 lux

Common misconceptions

Does a voltmeter go in the middle of the loop (in series), like an ammeter?
A voltmeter goes in parallel, across the part you're measuring. Its internal resistance is very large, so in series it almost stops the current.
Does an input pin connected to nothing read LOW (0V)?
No. An input connected to nothing is floating, and noise or a tiny leakage current can make it read HIGH or LOW. Set it with a pull-up or pull-down resistor.
Do smaller divider resistors give a more accurate voltage?
The same ratio gives the same voltage. Smaller values draw more current from the battery, and larger values are more affected by whatever you connect to the output, such as an input pin's leakage current.
Can a potentiometer's two end terminals alone change a voltage?
No. The resistance between the two ends stays at the full value however you turn the knob. To make a voltage, use the middle terminal (the wiper).

Try it in the Chapter 4 stages

You can check what you read by actually wiring it up. It runs in your browser with no sign-up.

Start with 4-1Choose a Stage