Voltage Divider Resistor Selection Help

Hello all,

I am a high school student who is trying to measure the voltage of a DC circuit. This circuit will run between 30v and 50v but I need to measure the voltage with an Arduino with a maximum voltage measurement of 5v. My solution to this is a voltage divider to bring the voltage down to a safe level for the Arduino to read. Using a voltage divider calculator I decided I needed a 1st resistor value of 1500ohms and a 2nd resistor value of 100ohms. However when deciding what resistors I need to purchase I was wondering what kind of wattage these resistors would be encountering and at 50v the 100ohm resistor would have 25w flowing across it. Am I correct with these calculations? Do I really need such a high wattage resistor?

Thanks

Hello 2098489,

Please allow me to address several points in your question:

Voltage divider

The governing equation in your application is the voltage divider rule:

V_{Out} = V_{in}\dfrac{R_2}{R_1 + R_2}

You have selected 1.5 kΩ for R1 and 100 Ω for R2. With a presumed Arduino running using the default rail (5 VDC) as the voltage reference for the Analog To Digital Converter (ADC):

5 = V_{in}\dfrac{100}{100 + 1500}

Solving for V_{in} yields approximately 80 VDC. Your calculations are reasonable but could be improved as we will explore later in this note.

Power Dissipation

We can use Ohm’s Law to determine the power dissipation.

R_{total} =R_1 + R_2 = 1500 + 100 = 1600\ \Omega

Current = \dfrac{Voltage}{Resistance} = \dfrac{80}{1600} = 0.05\ A

Power = Current \ x \ Voltage = 0.05 * 80 = 4 \ W

Consequently, you will be able to use 1/4 W resistors. Through-hole resistors of this size are reasonably easy to work with. However, you may want to use 1/2 W resistors as they are slightly larger and easier to read.

This is unnecessarily high dissipation. Let’s shift all values up by a factor of 10 and recalculate.

R_{total} =R_1 + R_2 = 15000 + 1000 = 16,000\ \Omega

Current = \dfrac{Voltage}{Resistance} = \dfrac{80}{16,000} = 0.005\ A

Power = Current \ x \ Voltage = 0.005 * 80 = 0.4 \ W

This is an improvement but still higher than necessary. I’ll leave it to you to select a better resistor pair. Know that the maximum recommend value for R2 is approximately 10 kΩ. However, to be safe, perhaps 5 kΩ is a better value.

Improvements

Chances are, you will be unhappy with the results as the voltage will be off and the resolution (smallest measured voltage increment) will be larger than desired. There are three things you can do to improve this situation:

  1. Shift the Arduino to an internal voltage reference. Instead of using the voltage rail you should use one of the internal references such as analogReference(INTERNAL1V1). By comparison the internal reference is more stable and doesn’t drift as the Arduino is loaded down. It also eliminates the uncertainty associated with your PC’s USB port. Note that you will need to adjust your voltage divider accordingly.

  2. Optimally select your resistors as I outlined in this article. The trick is to determine the ratio of R1 and R2. You then find the closest resistor pair. For your application, recommend selecting the input voltage as 10% higher than the highest anticipated voltage e.g, 50 * 1.10 and the output voltage as the ADC reference e.g., 1.1.

  3. Use low tolerance resistors sush as 1%. They will cost a bit more, but the values will be closer improving your chance of correctly measuring the voltage. Alternatives include hand selecting resistors from the batch or providing a calibration value for the Arduino.

Be safe as you have crossed into the world of high voltage with the very real potential to hurt of kill you or someone you love. Here defined as anything above approximately 30 volts.

Recommend you find a mentor to guide you in this exciting endeavor.

Best Wishes,

APDahlen

Ref:

Voltage Divider Conversion Calculator | DigiKey

1 Like

Hello APDahlen,

Thank you for your response.

The information about the voltage divider and the improvements that I should make to get more accurate readings make a lot of sense.

I will plan on using high tolerance resistors as well as recording there resistance with a multimeter so I can make my calculations more accurate.

I will also plan on using a 1st resistor value of 1500ohms and a 2nd resistor value of 150ohms so that at 55v my Arduino will read 5v. (This should give me some headroom over 50v) At 30v the Arduino should read 2.72v. I can’t find a way to make this any more accurate. Is this as accurate as I can get?

As for shifting the Arduino to an internal voltage reference,

I am not a very talented Arduino programmer but I assume this would compare the voltage on the analog pin to an internal ground instead of comparing it to the Arduinos GND pin? Also, I am not planning on having this Arduino connected to a USB port during the tests if this changes anything. The Arduino will be powered off a DC-DC taking the same higher voltage that I am trying to read and bringing it down to 5v to power the Arduino. Should I still be comparing the analog pin to the Arduinos internal ground? Also is it a problem that I am planning on powering the Arduino from the same power source that I am trying to measure?

I have an LCD as well as a SD card to store the data on since the Arduino will be measuring voltage inside a prototype vehicle.(If you are interested I can give you more information on the bigger picture of what I am trying to do here.)

As for the wattage of the resistors I need to select I am still confused.

Originally I was assuming that I needed to divide the voltage by the smaller resistor to find how much current is flowing over that resistor, however taking the sum of both resistors to find the current flowing through the circuit makes much more sense. I still don’t understand where you get 0.05W from however. When I do these calculations with 80v over a 1600ohm circuit I get 0.05amps and then I believe we have to multiply this value by the voltage (80v) to get 4w. With this math and my new voltage (55v) and resistor combinations(1650ohms) I get 1.83W. Is this correct?

I have worked with these higher voltages before and will be sure to take the proper safety precautions.

Thank you for your help.

You are correct, 2098489.

My apologies for the math error. I’ve corrected the posting.

The problem with the “rail referenced” ADC remains even when powered by a battery or DC-DC converter. In both cases, the precision of the ARC is determined by the rail voltage. It’s like taking the rail voltage and dividing it into 1023 slices. As the rail voltage changes so too does each little division.

It’s like scribing a ruler onto a balloon. Adding more air is like changing the rail voltage. Everything moves together in an undesirable direction. This is eliminated when the ADC is configured to use the internal reference as it is independent of changes to the rail voltage.

As to your specific questions:

  • Everything is ground referenced including the power supply and ADC measurements. Measurements can be isolated but that adds considerable complexity.

  • Yes, it’s fine to measure the power supply providing power to your Arduino. As an interesting experiment, you could add a voltage divider and measure the rail voltage - that is assuming you use the internal ADC voltage reference.

  • Yes, keep in touch. Documenting your project on a forum is an excellent way to improve your writing skills. It also gives you something to add to your future resume.

No worries about talent. That comes with time and experience.

Keep up the good work!

Sincerely,

Aaron

1 Like

Aaron,

The Arduino programming makes sense. Thank you for the guidance and extra info there.

For my voltage divider I believe I could use a 1st resistor value of 15kohms and a 2nd resistor value of 1.5kohms to get a wattage of 0.183 with a 55v source. Then I could use 1/4 W or 1/2 W resistors.

Sounds good. I will continue documenting what I am doing on here.

I am the lead designer of an eco marathon car that my engineering class is building this year. (We race our cars at the Shell Eco-marathon every year.) I designed the programs car last year and we finished 9th in the competition. This year we are planning on switching fuel sources from battery-electric to hydrogen and I want to be able to directly compare the efficiencies of the two cars as well as have more data to optimize this years car. (different motors, motor driver settings, gear ratio)

I am planning on using this voltage divider coupled with a 20amp Arduino amperage sensor (I can’t go down to a 5amp but I would like to use a 10amp if anyone can find one) connected to an Arduino Nano so I can record the watts being used by the motor as well as the Watt hours consumed during a run. (a joulemeter of sorts) I am connecting a small display to the Arduino to display the Wh consumed as well as connecting the joulemeter to a separate PCB to log how many watts the car is consuming at any part of the drive.

The separate PCB that I mention is the main computer in the car. It will be powered by a Teensy 4.1 and be logging GPS, lots of temperature data, speed, throttle percentage, the ratio of the CVT we are incorporating, as well as the info from the joulemeter. This PCB will log this info onto the SD card that is built into the Teesny 4.1 as well as transmitting it to the drivers steering wheel with a HC-12 transmitter so the driver can get real time data on the car.

If you have more questions on the project feel free to ask. I would like to keep this forum open when I inevitably have more questions or problems.

When I finish the joulemeters schematic in Eagle and the code I will attach it if you would be willing to review it.

Thanks,
Scott

Hi Scott,

Appreciate the response.

That sounds like a wonderful challenge.

If few random thoughts for your consideration:

No promises, but yes, please post your material as it will be interesting for our readers to explore. you never know what comments or tips you will receive.

Good luck to you and your team.

Sincerely,

Aaron

Please know that anything “Arduino” can be compared to frozen pizza; they’re easy, convenient, and good enough for many purposes. But, they’re made from ingredients that are readily available, and taking some time to learn to use those ingredients oneself opens up new worlds of possibility.

You’re already talking about doing schematics in Eagle, so clicking the “board” button shouldn’t be a huge stretch. The non-contact current sensors referenced in a prior post are a (very) decent option, but a more blunt approach needs only 5 resistors and a suitable op amp to make a decent front end for voltage and current measurements.
image

The parts themselves could probably fit in less space than needed to accommodate gozinta and comzouta connectors suitable for a 10A circuit in a high-vibration environment. You’d also want to be mindful about where other electronics are referenced; the bottom and top of R1 above 'aint the same thing…

And to throw another option in the air, there’s an entire class of parts including the LTC6102 designed to do the V=IR current sensing trick while putting the resistor on the positive side of the load, thus reducing complications from having slightly different 0v reference points in the system.

If the foregoing causes confusion on your part, my apologies. Skippit an’ just buy the frozen pizza for now if it fills the need, knowing that other options are available.

I offer +1 affirmation points for your industriousness and communication skills. Know that you harbor qualities of value, deserving of further refinement.

1 Like