Author Topic: I wrote a "voltage divider resistor chooser"  (Read 4347 times)

0 Members and 1 Guest are viewing this topic.

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
I wrote a "voltage divider resistor chooser"
« on: March 03, 2016, 10:15:53 pm »
It's a Javascript based voltage divider calculator with a twist, use it here:

http://eleccelerator.com/voltage-divider-resistor-chooser/

You put in your input and desired output, and the values of every resistor in your collection of junk, and it spits out the two resistors that will get you closest to the desired output

I wrote it because I had to make a divider for some band gap voltage referenced ADC and didn't want to buy more resistors. Calculating the traditional way was a little too tiresome

What do you think?
 

Offline dcel

  • Regular Contributor
  • *
  • Posts: 179
  • Country: us
Re: I wrote a "voltage divider resistor chooser"
« Reply #1 on: March 03, 2016, 10:46:05 pm »
Atm I am on my phone so i have not checked out your program yet, but will when i get home.
I wanted to see if you were aware of ElectroDroid. I have used it for years, since my first android phone. It has the best selection of ele tronics calculators and reference info i have seen, so I bought it. My first paid app. Check it out. No affiliation.
Chris
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: I wrote a "voltage divider resistor chooser"
« Reply #2 on: March 04, 2016, 06:33:38 am »
I added two more inputs to optionally specify input resistance and output resistance, to account for things like output load and battery internal resistance
 

Offline FlyingHacker

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Re: I wrote a "voltage divider resistor chooser"
« Reply #3 on: March 04, 2016, 07:21:29 am »
Looks pretty slick. Thanks!

What makes this useful is the ability to list you junk bin components and get a result based upon those. Good thinking!

I only tested it a hint, but it seemed to work OK.
--73
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: I wrote a "voltage divider resistor chooser"
« Reply #4 on: March 04, 2016, 08:44:02 am »
It would be good if there was an option to use standard values such as E24 & E96 or a mixture of both.
 

Offline Shadetreeprops

  • Regular Contributor
  • *
  • Posts: 132
  • Country: us
  • Backwater building
Re: I wrote a "voltage divider resistor chooser"
« Reply #5 on: March 04, 2016, 03:32:46 pm »
This made me think, why is there not a calculator strictly for EE, One that will do all the functions Show all the work, and take any thinking out of it, that would spell wonders for me. I am horrid at the maths.

If i make one mistake, which i generally do, that can mean the death of a circuit for me. But If there was a calculator that did every possible formular for just EE, by you just imputing values you now. It will spit out what resistors you need, all combinations of diffrent size ones, one kind of pot you should use, and its ratings.

It would be a Specialized tool. Id pay for something like that.

something along the lines of. I have a 9v source running a leds in series, and parralle, 2 ea in parralle, wired in series to a total of 10 leds..do i calulate it for the 0.020mA or do i calculate it for 0.040mA since they are in parralle..casue that 2 diffrent resistors.


plus thats 1.7v per led, or will it be 3.4v needed for the parralle. so that formula looks something like this R=(Vf-Vs)/I

But like i said math was never my strong suit. only math i excelled at was geometry. but algebra, advanced math, trig calc, i struggled though it, it was like rolling a square up a ice covered slope.

I remember blanacing chemical equations, was a struggle till one day something clicked, then there was not a equation i could not balance, unless it was purposley made not to be.. i keep hopeing that click happens with the maths of this..and the universe will open up to reveal its secrets too me.
Buy it, use it, break it, fix it, Trash it, change it, mail upgrade it, Charge it, point it, zoom it, press it, Snap it, work it, quick - erase it,
 

Offline FlyingHacker

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Re: I wrote a "voltage divider resistor chooser"
« Reply #6 on: March 04, 2016, 04:44:10 pm »
There is a pretty cheap app for IOS called EEToolkit. It handles a lot of calculations, and let's you double check resistor or capacitor codes, etc.
--73
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: I wrote a "voltage divider resistor chooser"
« Reply #7 on: March 04, 2016, 08:33:34 pm »
It would be good if there was an option to use standard values such as E24 & E96 or a mixture of both.

After some thinking, I've decided not to add this feature. However, I change the resulting output to show all the results instead of just the best one. This way, you can easily decide if a result is invalid due to tolerances.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: I wrote a "voltage divider resistor chooser"
« Reply #8 on: March 04, 2016, 10:16:56 pm »
It would be good if there was an option to use standard values such as E24 & E96 or a mixture of both.

After some thinking, I've decided not to add this feature. However, I change the resulting output to show all the results instead of just the best one. This way, you can easily decide if a result is invalid due to tolerances.
Alright. Here's a list of E96 + E24 values to cut and past into the program but I think you've broken it. Now it doesn't work with these numbers. It did when I tried last night.

Code: [Select]
10
10.2
10.5
10.7
11
11.3
11.5
11.8
12
12.1
12.4
12.7
13
13.3
13.7
14
14.3
14.7
15
15.4
15.8
16
16.2
16.5
16.9
17.4
17.8
18
18.2
18.7
19.1
19.6
20
20.5
21
21.5
22
22.1
22.6
23.2
23.7
24
24.3
24.9
25.5
26.1
26.7
27
27.4
28
28.7
29.4
30
30.1
30.9
31.6
32.4
33
33.2
34
34.8
35.7
36
36.5
37.4
38.3
39
39.2
40.2
41.2
42.2
43
43.2
44.2
45.3
46.4
47
47.5
48.7
49.9
51
51.1
52.3
53.6
54.9
56
56.2
57.6
59
60.4
61.9
62
63.4
64.9
66.5
68
68.1
69.8
71.5
73.2
75
76.8
78.7
80.6
82
82.5
84.5
86.6
88.7
90.9
91
93.1
95.3
97.6
100
102
105
107
110
113
115
118
120
121
124
127
130
133
137
140
143
147
150
154
158
160
162
165
169
174
178
180
182
187
191
196
200
205
210
215
220
221
226
232
237
240
243
249
255
261
267
270
274
280
287
294
300
301
309
316
324
330
332
340
348
357
360
365
374
383
390
392
402
412
422
430
432
442
453
464
470
475
487
499
510
511
523
536
549
560
562
576
590
604
619
620
634
649
665
680
681
698
715
732
750
768
787
806
820
825
845
866
887
909
910
931
953
976
1000
1020
1050
1070
1100
1130
1150
1180
1200
1210
1240
1270
1300
1330
1370
1400
1430
1470
1500
1540
1580
1600
1620
1650
1690
1740
1780
1800
1820
1870
1910
1960
2000
2050
2100
2150
2200
2210
2260
2320
2370
2400
2430
2490
2550
2610
2670
2700
2740
2800
2870
2940
3000
3010
3090
3160
3240
3300
3320
3400
3480
3570
3600
3650
3740
3830
3900
3920
4020
4120
4220
4300
4320
4420
4530
4640
4700
4750
4870
4990
5100
5110
5230
5360
5490
5600
5620
5760
5900
6040
6190
6200
6340
6490
6650
6800
6810
6980
7150
7320
7500
7680
7870
8060
8200
8250
8450
8660
8870
9090
9100
9310
9530
9760
10000
« Last Edit: March 04, 2016, 10:18:27 pm by Hero999 »
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4540
  • Country: gb
Re: I wrote a "voltage divider resistor chooser"
« Reply #9 on: March 04, 2016, 10:23:02 pm »
It would be good if there was an option to use standard values such as E24 & E96 or a mixture of both.

After some thinking, I've decided not to add this feature. However, I change the resulting output to show all the results instead of just the best one. This way, you can easily decide if a result is invalid due to tolerances.

Just leaving my opinion, here.

I tried your program/application, earlier today. Thanks!

As other(s) have suggested. It could really do with having the standard, E24 etc, resistor values available as a simple button or some other mechanism. It would make your program, easier and more useful.

Think about it another way.

If you are buying so many resistors, that you can choose your own value(s). Your program is NOT needed. As they can choose the value they want. E.g. 100,000,000 of 12.75656346364K.

Otherwise they are limited to E24, etc etc.

But it is your program, to do with, whatever you like with.
 

Offline Aodhan145

  • Frequent Contributor
  • **
  • Posts: 403
  • Country: 00
Re: I wrote a "voltage divider resistor chooser"
« Reply #10 on: March 04, 2016, 10:28:24 pm »
I made one in c# a while ago make it so you can choose vin and vout. Then select E12 E24 etc. And list the closest values. I had some fun with making it.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: I wrote a "voltage divider resistor chooser"
« Reply #11 on: March 04, 2016, 10:31:41 pm »
There are plenty of online calculators which will do that with the standard E24, E96 values etc. but none that I know of which can use both the E24 and E96 values simultaneously. Some of the E24 values are missing from the E96 set (e.g. 390 & 240) and it would be good to take advantage of them.
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: I wrote a "voltage divider resistor chooser"
« Reply #12 on: March 04, 2016, 11:32:45 pm »
Quote
If you are buying so many resistors, that you can choose your own value(s). Your program is NOT needed. As they can choose the value they want. E.g. 100,000,000 of 12.75656346364K.

My problem is that I didn't buy standard values but I have a big collection of none standard values anyways. I've shifted from a career of "freelance EE" to a full time job. So my resistor buying style has shifted from "bill client for it" to use what I had left over from those days.

It could really do with having the standard, E24 etc, resistor values available as a simple button or some other mechanism. It would make your program, easier and more useful.

So basically, you are asking for maybe a table of values and clicking on a number in the table inserts it into the text box? This is reasonable and I can do it, but it feels so cumbersome than just typing.

Or do you want a table of checkboxes?

Are you asking me to also calculate a range of output voltages with +5% and then another with -5%?
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4540
  • Country: gb
Re: I wrote a "voltage divider resistor chooser"
« Reply #13 on: March 04, 2016, 11:46:44 pm »
Quote
If you are buying so many resistors, that you can choose your own value(s). Your program is NOT needed. As they can choose the value they want. E.g. 100,000,000 of 12.75656346364K.

My problem is that I didn't buy standard values but I have a big collection of none standard values anyways. I've shifted from a career of "freelance EE" to a full time job. So my resistor buying style has shifted from "bill client for it" to use what I had left over from those days.

It could really do with having the standard, E24 etc, resistor values available as a simple button or some other mechanism. It would make your program, easier and more useful.

So basically, you are asking for maybe a table of values and clicking on a number in the table inserts it into the text box? This is reasonable and I can do it, but it feels so cumbersome than just typing.

Or do you want a table of checkboxes?

Are you asking me to also calculate a range of output voltages with +5% and then another with -5%?

Yes, it can be hard, to change habits, when you are use to things being a particular way. In your current situation, the text box makes the most sense (for you, especially). Because you have got packets of specific values, leftover. (If I understand what you said, correctly).
But most people are either ordering from the [E24] or other ranges and/or taking them from standard [E24] resistor kits.

I meant something on the lines of...

The text box, as it is, and in addition...

[E24] [E48] [E96] Check boxes or similar.

So if the text box = 1.5K, and ONLY checkbox [E24] is ticked.

The result will be any resistor, in the set {1.5K, 1K, 390, 4K7 .. rest of E24 values, here}
But doing it as text insertions is ok as well. All things being equal, I would prefer the check boxes.

Inserting it in the text box, would make it harder, to switch it off again. E.g. disable [E48], without lots of messing about, or starting from scratch.

Quote
Are you asking me to also calculate a range of output voltages with +5% and then another with -5%?
No. I was NOT going that sophisticated.
« Last Edit: March 04, 2016, 11:49:03 pm by MK14 »
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7589
  • Country: au
Re: I wrote a "voltage divider resistor chooser"
« Reply #14 on: March 05, 2016, 09:36:38 am »
This made me think, why is there not a calculator strictly for EE, One that will do all the functions Show all the work, and take any thinking out of it, that would spell wonders for me. I am horrid at the maths.

If i make one mistake, which i generally do, that can mean the death of a circuit for me. But If there was a calculator that did every possible formular for just EE, by you just imputing values you now. It will spit out what resistors you need, all combinations of diffrent size ones, one kind of pot you should use, and its ratings.

It would be a Specialized tool. Id pay for something like that.

something along the lines of. I have a 9v source running a leds in series, and parralle, 2 ea in parralle, wired in series to a total of 10 leds..do i calulate it for the 0.020mA or do i calculate it for 0.040mA since they are in parralle..casue that 2 diffrent resistors.


plus thats 1.7v per led, or will it be 3.4v needed for the parralle. so that formula looks something like this R=(Vf-Vs)/I

But like i said math was never my strong suit. only math i excelled at was geometry. but algebra, advanced math, trig calc, i struggled though it, it was like rolling a square up a ice covered slope.

I remember blanacing chemical equations, was a struggle till one day something clicked, then there was not a equation i could not balance, unless it was purposley made not to be.. i keep hopeing that click happens with the maths of this..and the universe will open up to reveal its secrets too me.

As an adult,you will be able to "pickup"with ease a lot the stuff you struggled with as a kid.
It's not fashionable to say so,but kids are dumb!

In fairness,though,Maths teachers don't have time to do things properly,& will progress into "short-cuts" before some of the class have grasped the basics.

For instance,if you never latch onto the fact that everything you do with one side of an equation entails doing the
same to the other side,when the teacher starts rabbiting on about "transferring" terms from one side to the other,it sounds like black magic!----It did to me!

By the way,your LEDs will all differ slightly in characteristics,so you might be better to give each of them a resistor.

And with voltage dividers--draw a bit too much current from the "tap" & your nice "division" won't be correct anymore.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: I wrote a "voltage divider resistor chooser"
« Reply #15 on: March 05, 2016, 09:41:30 am »
results from best to worst:
R1= 1M ; R2= 10K ; Vout= InfinityV
R1= 1M ; R2= 15K ; Vout= InfinityV
R1= 470K ; R2= 10K ; Vout= InfinityV
R1= 1M ; R2= 22K ; Vout= InfinityV

yay, Infinite voltage


(Used 1e999 as input voltage)
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline frank26080115Topic starter

  • Regular Contributor
  • *
  • Posts: 74
Re: I wrote a "voltage divider resistor chooser"
« Reply #16 on: March 05, 2016, 04:34:05 pm »
results from best to worst:
R1= 1M ; R2= 10K ; Vout= InfinityV
R1= 1M ; R2= 15K ; Vout= InfinityV
R1= 470K ; R2= 10K ; Vout= InfinityV
R1= 1M ; R2= 22K ; Vout= InfinityV

yay, Infinite voltage


(Used 1e999 as input voltage)

Javascript numbers only go up to 1.79E+308
 

Offline profany

  • Contributor
  • Posts: 12
  • Country: pt
Re: I wrote a "voltage divider resistor chooser"
« Reply #17 on: March 06, 2016, 06:52:51 pm »
yes
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf