I'm trying to work out resistor values for a voltage divider, I've used small voltage dividers in the past no worries but this ones a bit bigger than I've done in the past and I cant think of how to work out the individual values. that may also have something to do with me trying to work it out at 1am
I'm using a voltage divider so I can setup multiple buttons on a single analog input. 5 buttons in total.
running of the 5v on the arduino through 6 resistors (in practice may be more to get correct values) the voltage values I'm aiming for are 3.185, 2.695, 2.205, 1.715, 1.225. on the ADC these read 650, 550, 450, 350 and 250 respectively.
I'm sure there has to be a way (apart from trial and error) to work this out. but it isn't coming to me... :~
OK, it's not complicated, just rather tedious and repeated application of basic ohms law formula. Your voltage divider will have to have 6 series resistors to obtain your desired five output voltages. First you have to start with what you want the total series resistance to be as that will determine the source impedeance of the network. In the case of arduino analog input pins it's desirable for the driving source to have a 10,000 ohm or less impedenace, so we will set 10,000 ohm for the total series resistance. Do draw a series string of six resistors wired between +5vdc at the top of the top resistor and ground to the bottom of the bottom resistor. Label the resistors R1 to R6 from top to bottom. Next you determine the total series current that will flow through the divider which will be I = 5vdc / 10,000 ohms = .0005 amps. Now starting from the bottom resistor R6 calculate for individual resistor value by voltage drop / series current. So for R6 R= 1.225 / .0005 = 2,450 ohms. Next calculate for R5 which is voltage drop across R5 (1.715 - 1.225) = .490 volts and solve for R5 resistance as .490 / .0005 = 980 ohms. Repeat this process until all the resistors are solved for. A check of your work is to add all the resistors values together and check that the results are equal to 10,000 ohms.
So final answers are:
R1 = 3,630 ohms
R2 = 980 ohms
R3 = 980 ohms
R4 = 980 ohms
R5 = 980 ohms
R6 = 2,450 ohms
I will leave it to you to check my work as it's been many decades sense I had attended my military basic electronics training classes.
There are several ways of doing it, but really they all come down to proportions - how big is the slice of cake that each person gets. You know you want the voltage split up into 5 different voltages, so you need to work out what the difference between each of those 5 voltages is and you can then work what value each resistor is proportionally to the others.
I have attached a picture which simplifies your problem, and then works it through until you can find every resistor value based on just one.
In this case, you just have to pick a value of R2, and work out the rest from there.
If you want to use standard values, then you have to use a bit of trial and error to get as close as you can. In this case, if you pick R2 = 1.5k, you get R1 ~= 5.6k, and R6 = 3.75k. R6 can be made approximately with a 470R and a 3.3k resistor in series.
thanks heaps guys, believe it or not, I had actually worked out the method Tom mentioned in my sleep. woke up at about 3am thinking "now why didn't I think of that earlier?" lol. dont know if it's because I have used it before or if I did actually work it out in my sleep but weird either way.
that said, Lefty your approach seems allot simpler. I might try both out myself not only to double check lefty's maths but to also refresh my memory/understanding :).
That is the Finest Kind of learning... Also the way I've worked out Many, many different issues... I usually do my finest work in the shower... and I used to go to work with most of the previous day's issues worked out.
And choosing resistors from an E6 or E12 set that match some ideal ratio can be pretty tricky. There are several calculators out there, but this one is my favourite: