Tuesday, 30 April 2013

Why We Test

The Magic of FETs


I've never had a lot to do with FETs before so I've been keen to experiment with and learn about FETs on my home projects.

As I wrote before in Basic Protection I like the simplicity of using a P-FET to provide reverse bias protection, and with my Alarm Interface I was planning on combining this reverse bias protection with current limiting.

As usual, I got it wrong the first time....



In Theory


This is Bad, m'kay

Taking a look at the figure above, I've set up Q1 to provide reverse bias protection.  Now, thinking of it as a high side switch, the basic rule here is pull the gate low to turn it on, or high to turn it off.  So that's what I wanted Q2 to do - R2 acts as a current shunt resistor, and when enough current flow though it, the voltage across R2 equals Vbe of Q2 and Q2 conducts, pulling the gate of Q1 high and turning Q1 off.  


In Practice


Well, in this case pebkac....

Below you can see some pics of my test rig that I built up to test the theory.  It's a hack of an earlier circuit and you can ignore the 7805 regulator on the PCB, it's not used here.



Testing, Testing...

I hooked up the circuit to my power supply, and yes, it flowed current (the LED came on) so I pronounced it as 'working'.  But my dilemma was how to test the current limit?  As I didn't have and decent load resistors to hand I tried something quick and dirty.  I hooked up my (friends!) multimeter in current measurement mode across the output.  I need to get one of these.

When the current limit kicks in, the meter will show what the limited current is, right?  Besides, the PSU is limited to 1A, so I could't do too much damage, right?

Well, I *shoudl* have set the meter's range to 20A, not 400mA.  Of course the current limit didn't work, but the meter acted promptly and blew it's HRC fuse to protect me from my own stupidity.  Okay, so that's a $13 lesson learnt there....



The Beastly Circuit

Okay, besides blowing the fuse, one thing I noticed was the the output voltage from the FET dipped when I was torturing the meter.  During my ohnosceond moment I realised what I was doing to the meter and I also realised what I had overlooked in my circuit.  I'm sure a few readers out there are grinning to themselves as to how I've been so stupid.

FET Construction.

There's plenty of information out there about how a FET is made, I wont go over it here, but I want to make note of two aspects.

1.  The FET is often made symetrically, which pretty much makes the choice between Drain and Source arbitrary.  More on this later.

2. The body of the FET is a slab of silicon, and for a P-FET it's N doped.  So far, still symmetrical.

But during production, the body of the FET is connected to the source of the FET, and when you look at the connection between the Body and the Drain, you have a PN junction, or a body diode - and we should be aware of the body diode as we use this to turn our reverse bias protection FET on.

Almost Current Limiting

So, with my circuit above, I observed a drop in the voltage output when I was short circuiting my output (after fragging the meter, I simply shorted the output for testing).  Why?  Well, the sense resistor was developing enough volts across it to turn on Q2, and it WAS turning Q2 off.  But the body diode was forward biased, and conducting in place of the FET and the reason I was measuring a small voltage drop was that I was actually measuring the forward voltage of the body diode itself.  D'oh.

So, swapping the Source and Drain connections on my FET I'd lose the reverse bias protection, but be able to test the current limit.  And this time it worked.  The phot below shows my test setup - the smaller PCB actually carries a FET set up as reverse bias protection circuit, and the larger PCB as current limit.  



It ain't pretty, but it works.

Bi-Directionality

For my low power circuits, I was curious as to how the FET would react bi-directionally.  For example if I supply power to a circuit, using a FET for reverse bias protection, would the FET also protect my supply from power on my circuit?  A practical example could be a micro controller switching prototype LED drivers on a  bread board, and I was curious as to what would happen if a reverse bias voltage were applied, or if an overvoltage were applied

Basic Reverse Bias Protection

Now, remember how a FET is a symmetrical device?  Once biased on, the conduction channel in the FET is basically a resistor.  Apply a voltage at one end and a current will flow.  

So, for example, if you accidentally apply 12V to the '5V output' in the figure above, the 12V can flow back into your supply, and if you haven't designed for this, you will over-volt your 5V supply and send your micro board to God.  Ouch!



Letting the Smoke Out

If you were to reverse bias the FET, you are in real trouble.  Thanks to our friendly body diode, the above will forward bias the diode.  The FET will be turned off, but the diode will conduct and again, if you're not prepared for it you will again lose your micro board.  (Yes, this also applies to using a diode for reverse bias protection).


Body Diode Shenanigans!

You can protect from this position with diode clamps / tvs / zeners but not with a simple FET.  This isn't a criticism, but rather an observation that should help guide any design decisions.

Practically Speaking

I wanted to test this protection circuit before committing to ordering my PCB's for my Alarm Interface along with some other projects.  So I'm happy I've picked up the error now rather than having to hack my nice PCB later.

For the Alarm Interface, it wasn't that important that I minimise voltage drop on the power supply - I wasn't chasing any inefficiencies as I was planning on running it from DC power from the alarm panel itself.  So for reverse bais protection I'll just run with a normal diode.  For other low voltage circuits I'm looking at the reverse bias protection offered by the FET is great as the voltage drop and power loss in that circuit is much smaller.

What I am happy with however is that the current limit circuit is much more accurate than any polyswitch, and it's actually cheaper to build this circuit from discrete parts than it is to use a single polyswitch.  Woot!

Here's the iteration I'm taking to manufacture:



A quick note on what I've used a pair of resistors to bias Q1.  The VGS on my FET is less than my intended 12V input, and if I only used the one resistor my FET would be damaged when VGS is exceeded.  Using a simple resistor pair limits VGS to half my input rail. 

Most alarm panels have a 15V AC supply (to allow charging of their back up batteries, typically 12V) and supply 12V for things like PIRs.  I'm planning to use this to power my interface.  Built in battery backup is a nice touch.  Oh yeah, this has been tested now :)




Next step, update my Alarm Interface design, order some boards and get testing. Stay tuned!


2 comments:

  1. Hey mate. You can use a n channel MOSFET as a level converter. I've used a package with 9 FETs, with one used for biasing the other 8. Basically you get 8 bidirectional level translators. Look up the gtl2003 for more details than I'm willing to type with my phone. Just be careful that the current drawn through the gate combined with the Rds-on doesn't screw up your logic levels.

    ReplyDelete
  2. Thus the properties of the current in the conductor to be recorded pass on to the clamp without any physical contact.www.themultimeterguide.com

    ReplyDelete