Power Supply ..chossing caps and control voltage..

ok so my power supply remains in my head still but i have purchased some parts , but I have decided to make it a 24v variable supply , my question now is
about making the reference voltage so i can read it with an Arduinos Analog input , i was thinking of a voltage divider where i drop the 24v to 5v for the arduino to read and when i drop the 24volts the 5volts would also drop in proportion which is how i intend to display the "real" output of the power supple..
question is instead of a voltage divider, resistor method which is what i was thinking , can i just use an LM317 with fixed resistors to get a good solid 5v for the arduino and still have it drop accordingly to my 24volts dropping?
hope i am making my self clear :confused: ,
furthermore what size caps should i use? Though i'd prefer to know the method of choosing the right size caps as oppose to a specific value , you know the whole teach a man how to fish thing....

thanks in advance.

ps: i would also be using ANOTHER LM317 to actually vary the 24v

LM317 DS : LM317T STMicroelectronics | Mouser Europe

Adding a regulator to act as a voltage divider is total overkill. Not to mention the regulator wants to keep its output constant, so if the input varies the output won't. Wouldn't that make measuring with the Arduino pointless?

well as i vary the 24v via a pot i would also vary the "adjust" pin on the LM317 ... thus lowering its output in proportion to the 24 so when the i have 24v the LM317 will be at 5 and as i drop 24v ill also be dropping the LM317 ....forgot to mention it is an adjustable regulator

I guess I'm lost at, " is instead of a voltage divider... can i just use an LM317". A voltage divider is two resistors... done. Adding another regulator into the mix means a handful more components plus some testing. Not to mention you are probably burning more power.

You're adding a bunch of complexity to replace two resistors. I'm failing to see why that is a better option.

I was just thinking ONE adjustable divider being adjusted at the same time as the main voltage i am trying to adjust was better then dividing the voltage with resistors, then having to worry about power dissipation for the resistors , meaning i would have to go buy some , at least, 1 watt resistors and then also not being able to find the exact resistor value i need etc...
either way perhaps some insight on choosing caps?

i spelled "chossing" terrible.

You are over looking a number things.

  1. The LM317 has a minimum current requirement (5mA) to keep its regulated voltage. Which means regulating from 24V to 5V will dissipate at least 95mW. (See below #4.) It also means you need to add a load resistor on its output.

  2. You'll need to setup a divider for the 2nd LM317, which is more than 1 component, in addition to the load resistor.

  3. I think you are trying to suggest that your potentiometer is going to be connected to both LM317s at the same time. I'd suggest drawing a schematic of what you are thinking.

  4. You don't need 1W resistors for a divider. 24 / 5 = 4.8. Use a 56k/10k resistor to get a 5.6 divider. At 24V, you'll only be wasting 8.6mW. Pretty much any size resistor will work.

interesting what having the know how can do for an individual Kudos to you! because now that you mention it connecting both LMs to the same pot would cause major hiccups, because that WAS what i was thinking. Now back to the drawing board, on how to make a digital variable power supply...

well i can actually still do it right? just use the good old fashion divider method and some math on the software side and all is well?

eddiea6987:
well i can actually still do it right? just use the good old fashion divider method and some math on the software side and all is well?

As I was trying to explain, you were going WAY out of your way to make this much more difficult than necessary. In the end, you're going to be doing some math anyway. You'll still be setting up a divider anyway. :slight_smile:

yeah I appreciate it though , one more question

24 / 5 = 4.8. Use a 56k/10k resistor to get a 5.6 divider

what does the 4.8 mean ? and how did you find those values so fast? i usually have to look at how much my input is, say 24v and then how much output i want say 6volts and then figure out what percentage 6volts is of 24volts , which is 25% then i know one of my resistors has to be 25% of R1 + R2 .... hehe probably over complicating that as well :confused:

That's what I did, but instead of percent I used ratio.

5 / 24 = 20.8%. 1 / 20.8% = 4.8 (or 1 / 4.8 = 20.8%)

Then I thought you'd want standard resistor values. 56K and 10K are standard values. You need a ratio higher than (or equal to) 4.8, to make sure the divider's output is never more than 5V. None of the pins on the Arduino should ever go higher than VCC. Using the 56K/10K combo ensures that, but you will lose some resolution.

Very well explained sir. Thanks a million! OH WAIT !! what about cap size??

Yeah okay, my math was wrong. :roll_eyes:

R1 = 47K
R2 = 10K
At 24V, this means the Voltage of R2 is 4.21V

However, if you go to
R1 = 47k
R2 = 12k
At 24V, you'll see R2 = 4.88V Which is closer to 5V with some margin.

You might want to plug some resistor values into here:http://www.raltron.com/cust/tools/voltage_divider.asp

:wink:

still need to figure out size of my caps though, after some research im still lost
looking at this
Power Supplies after going to the smoothing section
and according to the formula presented
c = 5 x Io (output current from supply) <-- output from mains or the transformer??? if its mains then i DO NOT KNOW :?


Vs (120vAc) X F (frequency of AC supply U.S 60hz)

so the only part i do not know is Current of mains.. or do these value mean AFTER the transformer ,
which would be 24v @ 1.2 amps

In that expression, Io is the total DC drawn from the smoothing capacitor. This will be the maximum output current of your power supply, plus the current drawn by the supply itself (i.e. Arduino and everything else in it).

alright i get it, thanks