Measuring output voltage of Buck Regulator, Ground switched

Hi again!

I’ve been thinking about how to measure the voltage coming off of my buck regulator and I’m hoping someone here may have an idea.

If I attempt to use a simple voltage divider and run into the analog pin, I would have to measure from the output ground / power. The issue with this is that the arduino is hooked to the Non-switched ground. So if I connect a line from the switched ground to my arduino, it suddenly becomes the path for 20+ amps when the FET switches… I’m thinking I might find out what color the magic smoke is if I try that.

Does anyone know how to build a simple voltage to digital converter? Would that even be viable since the A/D would still be sharing the switched ground?

Just looking for any ideas anyone has that I might be able to use. Would using an optical barrier work?

Am I completely off base here? Would a voltage divider just to main ground be ok? I’m just missing something but can’t put my finger on it.

Why do you want to know the voltage over the peltier.
Wouldn't measuring the current with a high-side current module be easier.
Leo..

I was just reading up on the ACS715T, which seems like it would work very well for current!

I was wanting to keep track of voltage so I can see if something is going wrong with the buck regulator. It's a home built deal out of scavenged parts from PSU's.

Current it probably more relevant for the Peltier control, but I just like to know what's going on without having to open boxes and shove my leads down in there any time I think something might not be quite right.

Given the output is flying, you need a differential measurement - either a fast opamp
in differential mode, or perhaps easier you'd RC low-pass filter the two terminals of the
peltier and send them each to an ADC input (suitably scaled) and take the difference
in software.

A resistive divider with a capacitor across the lower resistor will low-pass filter and
divide at the same time. perhaps 15k upper, 10k and 100nF for the lower will
have a cut-off freq of 250Hz which will defeat the 31kHz switching frequency nicely.

Thank you for the response!

Heh, maybe I won't be measuring voltage across the output side. I'm running three of these so size is starting to be an issue. My little DIY boards are getting a bit on the tight side, and while I'm sure that I 'could' squeeze more components in, I'm beginning to run the risk of causing more problems than I solve.

I'll keep an eye out, maybe I can find a isolator for cheap that will do what I need, or maybe I'll end up going with an ADC in the end... Boy this would have been much easier if I would have designed that stupid circuit to switch the power leg instead of the ground leg......

Yes I wondered why you weren't using standard topology.

There were a couple of reasons in my head. I probably should have asked before I purchased the components and built it..

  1. I was worried about the hard current swings on the positive leg doing bad things to my PSU, I figured with the ground leg switched and the buck circuit, the PSU would see a more consistent draw rather than 20 amp spikes as the positive leg was switched.
  2. I'm not as familiar with MOSFETs as, oh, I dunno, anyone? So I figured that a NPN needed to be switched ground side and PNP's seemed like a rarity.

It's all entirely my own fault, I didn't ask enough questions, I started reading up on theory, built a design in my head, ordered in some drivers and MOSFETs, scavenged the rest from old PSU's and went to work with a soldering iron. Oops. Live and learn for sure! It's a great learning experience regardless.

I had an idea I wanted to test this evening, but ended up blowing up my input capacitor when I moved some components... damn electrolytic, I forget to check the ground stripe waaaay to often. Unfortunately when it blew it took my driver with it.... :-*

What I'm wondering is, instead of using isolation, op amps ect. Why can't I measure from source ground to output ground?

Shouldn't that just give me the inverse of the voltage? So say I'm running 7.8 volts, my reading would be 4.8 volts from ground to ground (11.8 max under load). So I could take that reading and do something like:

y = map(voltage, 0, 1023, 11.8, 0);

Of course the analog reading is just an arbitrary guess until I actually do some measurements. But would that work? I'll test it tomorrow once I replace the driver, but just in case I'm going to blow something up (again) figured I'd ask first :wink:

I just had a better look at your diagram.
Some things are not right there.
AFAIK, the 2500pf gate cap is not supposed to be there.
They may have used that in the datasheet so simulate a fet.

I also wonder if a drive IC is really needed.
It’s not a logic fet, but an Arduino pin (with 220ohm resistor in series) might be able to drive the mosfet directly.
Depending on the voltage/current of the peltier.
Leo…

Wawa:
I just had a better look at your diagram.
Some things are not right there.
AFAIK, the 2500pf gate cap is not supposed to be there.
They may have used that in the datasheet so simulate a fet.

I also wonder if a drive IC is really needed.
It's not a logic fet, but an Arduino pin (with 220ohm resistor in series) might be able to drive the mosfet directly.
Depending on the voltage/current of the peltier.
Leo..

Here is a picture of the recommended circuit:

While I haven't been impressed with the drivers durability to me making idiot mistakes... it has done it's job very well, when I'm not screwing up!

Here is the data sheet:

As to if it's needed? I would think that or a transistor at a minimum, I chose a driver because I am switching at 31Khz. I had the IRFZ44N mistaken for a logic level when I first hooked everything up and was driving it with 5v. It reached 80c in seconds due to not being switched fully.

Even with a logic level FET, I would still think that a driver of some type is needed for my application. The MOSFET requires typically around 175mA to operate properly for Vds drop correct? If I ran directly off the Arduino with a current limiting resistor, my fall times would be pretty long. Wouldn't that not allow my voltage to drop as I want?

On top of that question, I am running dual MOSFETS, the schematic is a bit old, the setup is identical, just with parallel logic level FETs now. Logic level to get them off of my 12v supply where the worst noise is, dual to help the heat dissipation at 23 amps.

The voltage for the peltiers (three of them, on three different circuits) will be 0-11.8 volts. My input voltage is 11.9 volts. Two of them draw 12 amps ea and one draws closer to 23 amps.

Note the CL next to the 2500pf capacitor, and no fet!!!
CL = C load. They assume a fet with ~2500pf gate capacitance.
So DON’t use that cap if you use a fet.

Using TWO mosfets could be worse than usning ONE.
Two mosfets is double the gate capacitance, so double the gate drive is needed for the same switching time.
Without sufficient drive, the mosfets switch slower, and get hotter.

You could try ONE 30A logic mosfet, e.g 30N06L, with a 100ohm gate resistor, directly driven from the Arduino.
Add a 100k resistor from gate to source for security during startup.
That would probably be ok for the 12A peltier.
Guestimation: ~6-9watt losses/heat in the mosfet and about 500mv max S/D when “on”.

Did you calculate the 15uH inductor, or just grab one.
Value seems very low for 31Khz.
What is the size.
Leo…

Wawa:
Note the CL next to the 2500pf capacitor, and no fet!!!!
CL = C load. They assume a fet with ~2500pf gate capacitance.
So DON't use that cap if you use a fet.

Using TWO mosfets could be worse than usning ONE.
Two mosfets is double the gate capacitance, so double the gate drive is needed for the same switching time.
Without sufficient drive, the mosfets switch slower, and get hotter.

You could try ONE 30A logic mosfet, e.g 30N06L, with a 100ohm gate resistor, directly driven from the Arduino.
Add a 100k resistor from gate to source for security during startup.
That would probably be ok for the 12A peltier.
Guestimation: ~6-9watt losses/heat in the mosfet and about 500mv max S/D when "on".

Did you calculate the 15uH inductor, or just grab one.
Value seems very low for 31Khz.
What is the size.
Leo..

I will remove that cap, I really appreciate that!

The calculated size is actually 8uH at 31Khz, Switching Converter Power Supply Calculator is the calculator I used. But I did just grab one, I salvaged inductors from old ATX PSU's, I'm reusing the main inductors, 5 wire, originally for 3.3, 5 and 12 in a PSU, I just run 12v through all the lines, I have an inductance meter so that's how I know it's 15uH. I'm not sure of it's saturation amperage, but I'm reasonably sure that it should handle the max of 25a. At least I really hope so....

The driver I'm using is rated at 6 amps, I wish I had screen shots but I still haven't repaired from my 'oops' on the electrolytic... It did seem to be driving dual FET's with no issues, I had nice clean pulses. (even with a bit of ahem extra capacitance...)

The FET I am swapping to is a logic level - AUIRLI2505
http://www.mouser.com/ds/2/200/auirli2505-321030.pdf which was one of the better ones that I found. A bit expensive, but I was shooting blind, I've never designed a circuit before and you are the first person who's replied with more than a "you should use this" and then never shows back up! (this is in different forums mind you)

I really appreciate the advice and help! I'm not sure I have a large enough heat sink to dump the heat if I run a single FET though. (again, salvaged heat sinks from PSU's, cut in half to fit on a 2x3 board)

Here are my thoughts on using the driver:

  1. If I screw up, I blow up the driver, not the Arduino (and I WILL screw up at some point, 3 drivers later I'm absolutely positive of that :wink: )
  2. Running multiple MOSFETs, the driver is only a single output, but has more than enough current to sink Vds on multiple FET's.
  3. I had another reason here..... But I lost it. I'll think of it later!

The FET that I chose should run just fine off the Arduino and it would really really simplify my circuit! I'm just not sure that I have the cooling capacity for running just one (which was why I went parallel, testing the IFRZ44N it reached 50c running a 10a load with a single FET and heatsink, figured that would go up as I increase the amperage across it).

Again, I'm all ears for advice and I really appreciate everything you've gone over so far! I'm not by any stretch of the imagination an engineer, so I am leaning towards the conservative side on my heat dissipation and amperage ratings of the components. I would rather over build then under build....

If you are going to use that driver IC, supplied from the 12volt line, then just use a single normal (not logic) mosfet with low "on" resistance.
That will give you the lowest losses/heat.

There are basically two things that heat up a mosfet.
One is easy to calculate/read off the datasheet graph.
The volt drop caused by the on resistance/current through the mosfet.
And the switching losses.

e.g the 30A logic fet I mentioned has a 0.5volt drop at 12A with 5volt at the gate.
You have to weigh off the 1-6watt "on" losses (0-100% duty) against the switching losses.
Leo..

My entire circuit only drops 0.1v at 100% duty cycle. 11.9 in, 11.8 out :-D, well, at least with the IFRZ44N, I haven't built the circuit out with the other FET yet.

The reason I swapped to the logic from the IRFZ44N was to get off the 12v line. I initially built the circuit with no snubber... oops. When you fully switch the IFR with no snubber in there you see 60v spikes as the inductor does it's thing. With the snubber I've gotten them down to around 6-10v spikes over base voltage. But I figured even with a clamping diode across the input of the driver, I'd be safe and move it to a 5v Vcc to remove all ringing and spikes!

The 10v spike was again, just with parts available. I have more parts on the way to test with, but it's more of a guesstimate (I think I ordered MEF 0.47uF caps, 0.047uF caps, 4.7 ohm resistors and 10 ohm resistors to play with). I'm hoping to drop the spikes and ringing even farther with a better tuned snubber.

I think you're getting good results with the drive IC and the IFRZ44N.
And the extra drive current allows for two or three mosfets in parallel.

With the double snubber circuit in post #1, the schottky diode dumps the spike on the 12volt line.
So your "spike" is 12volt + 0.4volt.
A snubber network is a necessary evil. It consumes power.
Spikes upto ~40volt are ok with this 55volt mosfet. Don't fight it.
Leo..

Wawa:
I think you're getting good results with the drive IC and the IFRZ44N.
And the extra drive current allows for two or three mosfets in parallel.

With the double snubber circuit in post #1, the schottky diode dumps the spike on the 12volt line.
So your "spike" is 12volt + 0.4volt.
A snubber network is a necessary evil. It consumes power.
Spikes upto ~40volt are ok with this 55volt mosfet. Don't fight it.
Leo..

Thanks!

The reason I'm moving the driver off the 12v is because of the spikes, they popped a driver. So my next revision had a 18v clamping diode across Vcc, but I figured better safe than sorry, the FET that I spec'd out should on paper... be a better FET than the IFRZ44N.... and allow me to put my driver onto the 5v line and completely remove the risk of spikes feeding back through it.

Again I really appreciate all of the insight you've given me, it's been a huge help!

I would say leave the driver IC on the 12volt line.
That line should be well decoupled. I suggest with multiple Panasonic FR capacitors.
Look at the datasheet at their maximum ripple current.
Use multiple caps that add to once, or maybe twice the current of the peltier you're using.
Imagine the current path through those caps>switch coil>peltier>mosfet>caps.
Make a star ground near the capacitor bank/mosfet.
Connect the +12volt to the capacitors.

You could always use a small 47-100uH inductor between the 12volt rail and the drive IC's 12volt rail.
Decouple the IC also with a low ESR (FR) cap.
The IC's VCC is a place to use a TVS diode (if you need to).
But an 18volt (standoff) TVS is not going to protect an 18volt max IC.
I hope you did not mean a zener diode as protection...
Leo..

Why wouldn't I use a zener as a voltage protection? You select a max voltage, in this case 18v, anything over that activates the zener and is shunted to ground, leaving only 18v at my Vcc, no more popped driver? It was just an old zener that I had floating around, if purchasing new I would have gone to a 15v. Or better yet, fix my design so that an over voltage protection isn't necessary :-[

So you are saying to add multiple capacitors to my 12v input line? So for instance, I will be running a peltier that draws about 21 amps. I would need to add enough capacitors to handle 42 amps of ripple current? So instead of the 1 I have now, I need 15? Holy freaking crap on a stick! That is a whole PILE of capacitors....

A zener is not very good at "eating" high energy spikes.
Transzorbs or TVS diodes (super zeners) are made for that. e.g. P6KE15 (12.8volt standoff/600watt).

Yes, add more caps on your 12volt line.
Why do you think a computer supply is full of them.
I think ~2200uF is the sweet spot. Use one for each 2.5A of peltier current.
You might already have some capacitance in your power supply...
Leo..

Wawa:
A zener is not very good at "eating" high energy spikes.
Transzorbs or TVS diodes (super zeners) are made for that. e.g. P6KE15 (12.8volt standoff/600watt).

Yes, add more caps on your 12volt line.
Why do you think a computer supply is full of them.
I think ~2200uF is the sweet spot. Use one for each 2.5A of peltier current.
You might already have some capacitance in your power supply...
Leo..

Ah, transorb! I knew I was missing something! You are right, a zener probably wouldn't eat the super fast spikes I see, but a transorb sure would!

A PSU isn't full of capacitors... it usually has one on each output rail, depending on amperage rating it could be a 1200, 2200 ect. The rest of them are on the regulators and acting as low pass filters, but as far as the output.. one per rail typically in a PSU (I just disassembled four old PSU's from 400w to 750w). They use the inductors to soak up current ripple, the capacitor to smooth voltage and a snubber or low pass to eat the transient voltage spikes. But they sure don't have 12 capacitors per rail!

There are typically more low voltage capacitors, 6v and 10v, and I'm assuming the extras are on the feed back lines and regulators, but that's just a guess. But tearing apart a 500w PSU with two 12v rails I get 4 capacitors over 16v. Typically two 25v 470uF and two 16v 2200uF, the rest are all low voltage or AC caps on the AC lines.