Go Down

Topic: How to detect voltage between 100v - 130v DC? (Read 16873 times) previous topic - next topic

localbroadcast

In a circuit I am building, I will have a source voltage of somewhere between 100VDC and 130VDC.  This voltage will vary at any time and is not predictable.  PWM will be used to turn a mosfet on/off at a rate that will turn the higher voltage into 36VDC EXACTLY to supply a load.

For example, if the source voltage is detected to be 100VDC, then the arduino board will calculate that a MOSFET will need to be turned on 36% of the time in order to supply 36VDC for the load. (36vdc / 100vdc)

For example, if the source voltage is detected to be 123.5VDC, then the arduino board will calculate that the MOSFET will need to be turned on approx. 29% of the time in order to supply 36VDC to the load.  (36vdc / 123.5vdc)

The thing that I am struggling with is... How can I detect the source voltage??  I know that the lowest it will ever be is 100vdc and I know the highest it will ever be is 130vdc, and it can be anywhere imbetween these two values.  Please help me understand how I can get my arduino board to detect the exact voltage that the source voltage is at any time?

Thanks.

MarkT

That's a sufficiently high voltage that safety is a major concern (what is the source
of voltage?  how much current could it source at max?).
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

screwpilot

that's not as easy as you imagine... you may need a PID algorithm (there's a library)

a simple voltage divider with a big (in both senses) resistor on the upper side may work but safety remains a concern

you may need an optocoupler and a P-channel mosfet on the 130v+ line for switching

if you are trimming a solar system you are wasting a HUGE amount of precious power

mart256

#3
Jan 21, 2015, 11:02 pm Last Edit: Jan 21, 2015, 11:09 pm by mart256
that's not as easy as you imagine... you may need a PID algorithm (there's a library)

a simple voltage divider with a big (in both senses) resistor on the upper side may work but safety remains a concern

you may need an optocoupler and a P-channel mosfet on the 130v+ line for switching

if you are trimming a solar system you are wasting a HUGE amount of precious power
There's no need for PID because this is not a closed loop control I think (yea, the load may affect a bit the supply but when it gets steady, there shouldnt be any more varations, I think those 100-130 V variations come from another reason, maybe due solar energy or something like that).

You just need to find the function that outputs duty cicle and its input is grid voltage level. I'd graphic some points and see if it is linear or an Hyperbole (you already have two points, (100,36) and (123,29)). Arduino should compute that function without trouble each time the voltage changes, then you get a fixed duty cicle to each voltage between 100 and 130 VDC.

And as suggested before, I'd use big resitors as voltage dividers and an opamp to adjust voltage between 0-5V and be readable by arduino analog pins.

raschemmel

2W resistors should be sufficient for a step down voltage divider. We're not talking about driving a load with a lot of current so the dissipation should be minimal.

screwpilot


KenF

#6
Jan 22, 2015, 02:09 am Last Edit: Jan 22, 2015, 02:09 am by KenF
a regulator without a feedback?????????
I don't think regulation has been mentioned yet.  for all we know the output is simply driving a servo to move a needle on a meter.

raschemmel

Quote
The thing that I am struggling with is... How can I detect the source voltage??  I know that the lowest it will ever be is 100vdc and I know the highest it will ever be is 130vdc, and it can be anywhere imbetween these two values.  Please help me understand how I can get my arduino board to detect the exact voltage that the source voltage is at any time?
 
Voltage Divider

Let VIN = 130V
Let Vout = 4V
Let ILOAD = 1 mA (0.001 A)

RTOTAL =Vin/ILoad
                             = 130Vdc /0.001 A = 130 k ohm

Vo / VTotal = 4V/130V =0.03076
R2 = (0.03076) * Rtotal = 4 k ohm
R1 = Rtotal - R2 = 130 k Ohm - 4 k ohm = 126 k ohm

R1 (from Vin to R2) = 126 k ohm
R2 (from R1 to GND) = 4 K ohm
Vout = connection point of R1 and R2
 
P(R1+R2) =  1 mA * 130V = 130 mW (use 1W or 2W for safe margin)
Analog input max voltage = 4V dc @ 130V in.


localbroadcast

#8
Jan 22, 2015, 05:46 am Last Edit: Jan 22, 2015, 06:28 am by localbroadcast
so raschemmel.. if I am understanding your description of the solution correctly.. I have drawn this circuit diagram of how I would have things wired up.  Is this correct?

In your calculations... Rtotal = Vin / Iload
Can you explain this?  Where is Iload?  is this the current through R1?  Did you pick 1mA for any specific reason?

So using the resistor values you have provided, when Vin = 130vdc, then Vout =4vdc.  Is this how I can calculate what the Vout will be when Vin = 100vdc?

R2 / Rtotal = Vout / Vtotal
4000 / 130 000 = Vout / 100v
Vout = 3.077vdc.
So when Vin = 100vdc, then the arduino will get a 3.077vdc signal at the analog input pin.  Correct?


For everyone else following this thread.. The source voltage is coming from an induction motor converted to a permanent magnet generator.  The voltage produced by this generator fluctuates depending on the speed that the generator is turning.  I need the constant 36vdc to power LED lighting.  By measuring the supply voltage (100 - 130vdc), I will be able to program the arduino board to turn a power mosfet on and off at the correct rate in order to produce the 36vdc needed for the LEDs.  If the supply is at 115v, then the mosfet will need to be turned on (36/115) x 100 % of the time, or 31.3% of the time.  If the supply is 130v, then the mosfet will need to be turned on (36/130) x 100 %, or 27.7% of the time.  Hope this makes sense to everyone.

Paulcet

It makes sense, but I don't think it will work that easily.  Will your LED driver tolerate 130V pulses?  You can approximate a 36V supply by feeding a capacitor.  But the pulse width required will vary greatly with load.  Is your LED light source variable?  And even if not, would you build in a way to "unload" the capacitor?

localbroadcast

It makes sense, but I don't think it will work that easily.  Will your LED driver tolerate 130V pulses?  You can approximate a 36V supply by feeding a capacitor.  But the pulse width required will vary greatly with load.  Is your LED light source variable?  And even if not, would you build in a way to "unload" the capacitor?
I kind of left my question vague at the start of this thread for this reason.. I really just wanted the answer to my voltage sensing question without having to explain every other detail about the system.

But since I've got my answer, I guess I can humor the rest of you and discuss my whole circuit.
To answer your question.. I will basically be buildling a "switching voltage regulator".  In order to get my switching regulator to output the most stable 36 volts possible, I needed to know the supply voltage being fed to it.  Now that I know how to accurately detect the source voltage with the arduino, I will be able to make a switching regulator that will use this information when creating the 36 volts dc.

It doesn't matter weather my LED load can handle 130vdc pulses.. The load will never see those pulses.  What the load sees will be a smoothed out version of the pulsed supply voltage.  This will be accomplished with appropriately sized capacitors and inductors, or simply a low pass filter.  Much like how an AC waveform is rectified and smoothed to create DC voltage.. The PWM pulses can be smoothed as well.

mart256

I kind of left my question vague at the start of this thread for this reason.. I really just wanted the answer to my voltage sensing question without having to explain every other detail about the system.

But since I've got my answer, I guess I can humor the rest of you and discuss my whole circuit.
To answer your question.. I will basically be buildling a "switching voltage regulator".  In order to get my switching regulator to output the most stable 36 volts possible, I needed to know the supply voltage being fed to it.  Now that I know how to accurately detect the source voltage with the arduino, I will be able to make a switching regulator that will use this information when creating the 36 volts dc.

It doesn't matter weather my LED load can handle 130vdc pulses.. The load will never see those pulses.  What the load sees will be a smoothed out version of the pulsed supply voltage.  This will be accomplished with appropriately sized capacitors and inductors, or simply a low pass filter.  Much like how an AC waveform is rectified and smoothed to create DC voltage.. The PWM pulses can be smoothed as well.
You should look some schematics of buck dc converter.

JimboZA

I will basically be buildling a "switching voltage regulator".
Is there a compelling reason to roll your own rather than buy one?
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

localbroadcast

Is there a compelling reason to roll your own rather than buy one?
is that a serious question???

If I build my own, I can customize the output voltage and current so that it matches my needs exactly.  If I want to tweak anything, like say, run the LEDs at 35 volts instead of 36 volts, I can make this change much easier on a regulator I've built vs. modifying a regulator I've bought.

An obvious benefit is the price.  Switching regulators, especially at the amperage I'm going to be building, can get pretty expensive.  Building it myself will dramatically reduce the cost.

localbroadcast

The buck converter is a great circuit to incorporate into my system here.  Thanks for the tip.  It's basically whats I was going to be building, but now that I know that it is called a buck converter, I can google that term and come up with lots of circuits that are already built and working to compare with.  It should help me figure out the correct size of the inductor and capacitor to use in the filtering aspect of my switching regulator.  Thanks.

I actually found a great site Buck-converter design demistified

This site goes step by step allowing you to size all the needed components.

Go Up