Author Topic: MOSFET low side switching, Opto-Isolated Driver, isolated Amp Votage sensing !  (Read 3316 times)

0 Members and 1 Guest are viewing this topic.

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Please see the attached schematic.

I am using a microcontroller to switch power into a 'LOAD' using a 'low side' switching design. This is working fine.

When I then add the other part of my circuit, namely a voltage divider to sense the LOAD voltage, I have an issue.

Initially the microcontroller did not sense the voltage correctly until I shared the GND both sides of the Opto-Isolator, which makes sense(so to speak!). The microcontroller measures the voltage okay when the MOSFET is switched on but when I switch it off, the microcontroller is showing random(ish) values instead of 0. This was the end of the day and my wife was calling me so I did not have to to check this with the meter.



Question 1: Is my microcontroller side of the Opto still protected from the MOSFET side if I share GND?


Question 2: Am I getting random voltages when the MOSFET is switched off because the voltage divider is finding a 'potential difference' path through the microcontroller like a false ground (so to speak).


Question3: Would 'High side' design be a better option.


I hope the KiCAD schematic is okay, I am still learning it.


Thanks, Paul
« Last Edit: August 31, 2018, 12:09:10 pm by castingflame »
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: MOSFET low side switching - voltage sensing question
« Reply #1 on: August 30, 2018, 08:57:25 pm »
Why do you think, the uC needs to be protected by an optocoupler?
The setup is in some points strange; I see no function for that led in the circuit; additionally you could simply take a logic level fet and spare you that circuit.

of course you are not getting 0V when the fet is off, there may appear some voltage from the positive rail depending from the impedance of your load. if load circuit and uC are galvanically separated, you cannot work like that at all; what reference would the ADC have with just one wire connection to the measured circuit? you need ground reference for that,

a high side switch is not necessarily needed

then I just see, that you want to drive the fet with a PWM; that's 1. unlikely to work any way properly with an 4N35 - it's far too slow for that and 2. even with a faster optocoupler I doubt you'd reach good rise/fall times with it.
« Last Edit: August 30, 2018, 09:03:40 pm by HB9EVI »
 

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #2 on: August 30, 2018, 09:28:03 pm »
The LED is there purely for diagnostic purposes so I know that my code is working into the 24v side of the opto. I had the uController pulse the opto every 0.5 seconds while I was watching the PSU and DC Load. (remember I am learning).

I also agree that an opto is not 'needed' but I included it as a precaution. I have had the MOSFET Gate driven from the microcontroller without it. It is worth mentioning that the 'LOAD' will eventually be a 24v 3Ah Ni-Mh battery pack and the opto was there just-in-case there was an issue with the battery pack. If you believe it adds no additional protection (even if the LOAD is a battery pack) then I will remove it.

At the moment I am testing this circuit with a lab DC Load in place of the N-Mh battery.

As I said, when I added the voltage sensing circuit, I realised that I needed the shared GND for that to work.

Quote
of course you are not getting 0V when the fet is off, there may appear some voltage from the positive rail depending from the impedance of your load

I could use the 'Enable LOAD' signal to switch the sensing voltage divider in and out of circuit. That seems like a fudge to me. What would you recommend (apart from many years study, and even more practical experience), as a better approach.


I am studying and learning and studying every day.


I appreciate your help.
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: MOSFET low side switching - voltage sensing question
« Reply #3 on: August 30, 2018, 09:44:53 pm »
In a more or less steady-state on/off setup you can keep an opto; but it will certainly pose a problem if you start switching the load at higher frequencies; from your word I conclude to some kind of charger circuit.

Actually you don't have much other choice than to set the voltage divider steadily between positive and negative rail of the load circuit; if you take the loads negative terminal as a reference, you will have that end floating if the fet is off, what means that you have the full load circuit voltage on the divider; sure you could clamp it with a series resistor and a zener, but I think it's the better solution to have a steady voltage reading from the divider; the Rdson of the Fet should be neglectable for a high power device and few 100 mAmps current

btw: if the led lights up in your circuit, it's fine, but in the schematic it has wrong polarity
« Last Edit: August 30, 2018, 09:55:29 pm by HB9EVI »
 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #4 on: August 30, 2018, 10:35:17 pm »
Yes you are correct it is a charging circuit. My initial design will use a steady voltage to the opto/MOSFET which will only change every few seconds at most. I did have a future plan to investigate using PWM into the opto/MOSFET as a learning exercise to see how much benefit it would bring so i would be interested to understand what issues I would have at your quoted 'higher frequencies'. Roughly what frequency were you concerned with? As I said, it is not essential though as it was just an exorcise to learn and investigating improvements.


Thank you for taking the time to help. It is appreciated.


Re LED ...Ooops!  :-DD






« Last Edit: August 30, 2018, 10:41:27 pm by castingflame »
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 789
  • Country: ca
Re: MOSFET low side switching - voltage sensing question
« Reply #5 on: August 30, 2018, 10:57:14 pm »
Data sheet FQP30N06L says Gate-Source Voltage Vgss +-20V absolute maximum.


 
The following users thanked this post: castingflame

Offline boB

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • my work www
Re: MOSFET low side switching - voltage sensing question
« Reply #6 on: August 30, 2018, 11:53:33 pm »

With the LED in that particular spot, the gate will require the R4 39K  resistor to go all the way to 0V  Vgs which is slower
than the 1K1 in series with the LED.  Hope that's OK.

boB
K7IQ
 
The following users thanked this post: castingflame

Offline bson

  • Supporter
  • ****
  • Posts: 2289
  • Country: us
Re: MOSFET low side switching - voltage sensing question
« Reply #7 on: August 31, 2018, 12:07:43 am »
You also can measure the voltage across the FET.  The load will be 24-Vd.

If you really need an isolated circuit then use an isolated amplifier (which is really more of a capacitively coupled buffer).

Oh, and put a large resistor, like 100k across the FET channel; otherwise if the load is open circuit and the FET is off Vd will be an antenna.
« Last Edit: August 31, 2018, 12:14:49 am by bson »
 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #8 on: August 31, 2018, 01:42:11 am »
Quote
With the LED in that particular spot, the gate will require the R4 39K  resistor to go all the way to 0V  Vgs which is slower
than the 1K1 in series with the LED.  Hope that's OK.

Thanks for spotting that. I am learning as I go along. I think I will just move the LED to the uController side. It is not a permanent feature and just for my diagnostics atm.




Quote
Data sheet FQP30N06L says Gate-Source Voltage Vgss +-20V absolute maximum


Well I dropped a clanger there. :-DD I have purchased several different MOSFETs while getting to grips with theory and practice. This MOSFET was initially not going to be driven by the opto but by the uController (via a 100R resistor). That would have been fine but now I have changed the Gate voltage from 5v to 24v!

While we are talking about this particular subject, I have seen 'Gate drivers' recommended for this application such as the
UCC27423 http://www.ti.com/lit/ds/symlink/ucc27424.pdf. What advantage would that bring to my current 'design' (and I use the term lightly!)? I have attached a design, stumbled across via google.




Quote
You also can measure the voltage across the FET.  The load will be 24-Vd.
Do you mean my LOAD (in the schmatic) will be 24v  - Vd. What is Vd?  Sorry if this is a stupid question, I am still trying to understand things and would rather looks stupid and learn, than not.



Quote
Oh, and put a large resistor, like 100k across the FET channel; otherwise if the load is open circuit and the FET is off Vd will be an antenna
It could have been a long while before I read about that particular issue so a big thanks for the advice. I will act upon it.  Also what is Vd again as in previous question!






Bugger it is 2:45am!  Thanks everyone for your help. I am very glad I asked for advice.  :-+


Paul
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: MOSFET low side switching - voltage sensing question
« Reply #9 on: August 31, 2018, 02:09:48 am »
Based on your first circuit, I would expect that the arduino is showing a full-scale output when the FET is off.

What are you reading?
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 789
  • Country: ca
Re: MOSFET low side switching - voltage sensing question
« Reply #10 on: August 31, 2018, 02:12:51 am »
Quote
Data sheet FQP30N06L says Gate-Source Voltage Vgss +-20V absolute maximum


Well I dropped a clanger there. :-DD I have purchased several different MOSFETs while getting to grips with theory and practice. This MOSFET was initially not going to be driven by the opto but by the uController (via a 100R resistor). That would have been fine but now I have changed the Gate voltage from 5v to 24v!

While we are talking about this particular subject, I have seen 'Gate drivers' recommended for this application such as the
UCC27423 http://www.ti.com/lit/ds/symlink/ucc27424.pdf. What advantage would that bring to my current 'design' (and I use the term lightly!)? I have attached a design, stumbled across via google.

 It's good to bring specifically designed MOSFET driver into perspective.  IMHO, galvanic isolator is right things for safety, and there are many IC to choose. For example, https://www.vishay.com/product?docid=81808
Study data sheets, there are a lot useful info there.
 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #11 on: August 31, 2018, 08:11:44 am »
Quote
It's good to bring specifically designed MOSFET driver into perspective.  IMHO, galvanic isolator is right things for safety, and there are many IC to choose. For example, https://www.vishay.com/product?docid=81808
Study data sheets, there are a lot useful info there.


After more hours of study, looking at various components and designs I am left with an additional question. If I use an Isolated Driver for the MOSFET (which will also help when I get to PWM control), I  believe I will have a problem with my voltage sensing design as I will no longer have a common GND reference. Is this correct?


I am currently using a ACS712 (hall effect) as a current sensor. It provides a scaled voltage that is proportional to current.
I am wondering if I could use the same type of sensor as a voltage sensor, or another model of hall effect voltage sensor, as common GND reference would not be an issue with this design.

ACS712 data sheet https://www.sparkfun.com/datasheets/BreakoutBoards/0712.pdf


Any other more appropriate/better suited ideas to overcome this issue are welcome. Please remember to treat me gently and I am learning as I go.



Thanks, Paul
« Last Edit: August 31, 2018, 08:35:12 am by castingflame »
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 789
  • Country: ca
Re: MOSFET low side switching - voltage sensing question
« Reply #12 on: August 31, 2018, 09:03:40 am »
After more hours of study, looking at various components and designs I am left with an additional question. If I use an Isolated Driver for the MOSFET (which will also help when I get to PWM control), I  believe I will have a problem with my voltage sensing design as I will no longer have a common GND reference. Is this correct?
Right. Use isolated amplifier as voltage sensor. Like:
https://www.broadcom.com/products/optocouplers/industrial-plastic/isolation-amplifiers-modulators/isolation-amplifiers/acpl-c870
Or
http://www.ti.com/lit/ug/tidua58/tidua58.pdf


 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #13 on: August 31, 2018, 09:16:55 am »
Quote
Right. Use isolated amplifier as voltage sensor. Like:
https://www.broadcom.com/products/optocouplers/industrial-plastic/isolation-amplifiers-modulators/isolation-amplifiers/acpl-c870
Or
http://www.ti.com/lit/ug/tidua58/tidua58.pdf

Fantastic. I'll study those and try and put together my thoughts/design in KiCAD  :-+
 

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Re: MOSFET low side switching - voltage sensing question
« Reply #14 on: August 31, 2018, 12:05:20 pm »
Okay, so another basics question about my choice of Isolated Driver for the MOSFET.

I have 2 that I am looking at;

UCC27424 has a supply voltage of 4-V to 15-V.  Datasheet http://www.ti.com/lit/ds/symlink/ucc27424.pdf

and

VO3150A has a supply voltage of 15 V to 32 V   Datasheet https://www.mouser.co.uk/datasheet/2/427/vo3150a-244703.pdf



With just supply voltage in mind, I am a little confused as to which side of the circuit should power the Driver to remain isolated; In as much as Arduino 5v Supply  -OR-  The 24v MOSFET 'power' side. 

The example circuits I have found for each driver have not really helped with my confidence. Initially I just thought it was it 5v Arduino side until I saw the Supply Voltage of the VO3150A was 15 V to 32 V. I don't want to guess at this point!



Paul
« Last Edit: August 31, 2018, 12:11:04 pm by castingflame »
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
I don't see, that the UCC27424 is isolated at all.

If you go for the VO3150, you are using it like your current opto; the LED is fed by the uC circuit, the rest by the load circuit.
 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Thank you HB9EVI. Appreciated  :-+  1 down, 1 to go.


On to the next ...
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Still, you should watch out for the Vgs; the VO3150 has a typical high voltage level of Vcc - 2,1V, so you are about to exceed the typical Vgs of 20V.
 
The following users thanked this post: castingflame

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Yes, I need to make sure I reduce the voltage for the VO3150 and the FQP30N06L.

With that in mind I have looked at the voltage and current requirements for both components in their datasheets.



VO3150  MOSFET driver    Datasheet http://www.ti.com/lit/ds/symlink/ucc27424.pdf][url]http://www.ti.com/lit/ds/symlink/ucc27424.pdf[/url]

Supply Voltage = 4 to 15v
(A/B) Input Voltage = -2 to 15v

OUT_DC Output current (OUTA, OUTB) DC = 200mA    <-----
Output Current @14v  = 4A                  <---- I am confused between these two quoted figures as they both quote Output Current.




FQP30N06L MOSFET    Datasheet  http://www.mouser.com/ds/2/149/FQP30N06L-112819.pdf

I can not see in the data sheet the Gate to Source current requirements.




While I understand that a MOSFET is a voltage controlled component, the reason - as I understand it, for using a 'Driver' is to over come the capacitance issues when trying to switch the Gate of the MOSFET at a higher frequency - by 'Driving' the Gate with a higher current. Of course my fundamental understanding could be incorrect as I have had to try and get to grips with a lot over the last few days.


What I am really trying to understand is...


To provide the correct voltage and current for the VO3150 to drive the MOSFET correctly from my 24v 'n'Amp supply ...


Do I need a Buck Converter to supply the correct voltage and current for the VO3150 to drive the Gate of the MOSFET using my 24v supply OR can I use passive components, like a voltage divider, to supply the correct voltage at a much lower current? I can not see the figures in the data sheets to enable me to work out exactly what I need other than an educated guess. I wish to understand what I am doing, not just get the circuit working.


It is also worth noting that I may not even use PWM for the Driver/Gate in the final design but at this point I wish to include that as part of my design so I can treat it as a practical learning exercise and change the design later if need be.



 :phew:  Paul
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
You are messing with the datasheets; you don't have the parameters of the VO3150 but of the UCC27424.

The VO3150 delivers up to 0,5A

You're right; the FET is voltage controlled, since its gate is isolated from the conducting channel, it acts like a capacitor; to build up a voltage in a cap, there has to flow a current - the higher this current is, the faster you reach a certain voltage.

So, if you drive a FET directly from a uC which sinks or sources maybe 25mA, it can take a considerable time to get the gate of high power FET charged and conducting - in other words - when using a FET driver, the parameter of sink- and sourceable current tells you, how fast you can switch the FET on and off - via I = dQ/dt

0,5A for a driver is not such a great parameter; there are drivers, which can sink and source several Amps, but it's surely better than your setup with a common opto or directly driven by a I/O-pin of a uC
 

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Quote
You are messing with the datasheets; you don't have the parameters of the VO3150 but of the UCC27424.
    :palm:  Stupid mistake is a reflection of the state of my brain at the moment   |O   What a tool. There is no hope for me!

Anyway, i'll take a look at the correct datasheet.



Quote
You're right; the FET is voltage controlled, since its gate is isolated from the conducting channel, it acts like a capacitor; to build up a voltage in a cap, there has to flow a current - the higher this current is, the faster you reach a certain voltage.

So, if you drive a FET directly from a uC which sinks or sources maybe 25mA, it can take a considerable time to get the gate of high power FET charged and conducting - in other words - when using a FET driver, the parameter of sink- and sourceable current tells you, how fast you can switch the FET on and off - via I = dQ/dt


I will spend some time looking at your coulombs over time equation, to try to get a better general understanding of it, as it's another fundamental concept I need to understand in the future and add it to my various personal documentation folders.



Quote
0,5A for a driver is not such a great parameter; there are drivers, which can sink and source several Amps, but it's surely better than your setup with a common opto or directly driven by a I/O-pin of a uC

Indeed and as I said, PWM fast switching is not a Must, so any improvement in this area for my own education I am happy with at this point and I really was more concerned with the isolation so I am happy that this is as you said "surely better than your setup with a common opto or directly driven by a I/O-pin of a uC".  :-+


I have come back to electronics a year or so ago after many years away and I have really only been dealing with the digital stuff for my own amusement. More analog base circuits and the many fundamentals, principles, laws, algebra etc can not be all learned in a week.

I recently purchased The Art of Electronics  by Thomas Hayes book which has been a pretty great book so far and I am also following a Udemy course by Andre LaMothe  Crash Course Electronics and PCB Design which is 88hrs long and has also been very useful. At the same time I am trying to build this project which is quite a bit above my current ability level for my Father. With this in mind I appreciate all the time and advice that has been given to this 48 year old student  :clap:  :-+  I am trying hard, but also a bit 'trying' at times too :)


Paul
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19605
  • Country: gb
  • 0999
Initially the microcontroller did not sense the voltage correctly until I shared the GND both sides of the Opto-Isolator, which makes sense(so to speak!). The microcontroller measures the voltage okay when the MOSFET is switched on but when I switch it off, the microcontroller is showing random(ish) values instead of 0. This was the end of the day and my wife was calling me so I did not have to to check this with the meter.
It think others have answered the other questions adequately, but unless I've missed something, no one seems to have dealt with this.

When the MOSFET is on, the voltage on the ADC input will be V = VIN*R6/(R5+R6) =  24*10/(100+10) = 24*10/110 = 22/11V

When the MOSFET is off, the voltage on the ADC input will theoretically be 24V, because the MOSFET will disconnect the lower side of the potential divider R5 & R6, leaving only R5 in series with 24V. In reality, the ADC input's ESD protection diode will start conducting, so the voltage on the ADC input, will one diode drop above the power supply voltage. Because the voltage would be outside the acceptable range for the ADC pin, the reading will be unreliable, hence the random values.

If you don't need any isolation, then the voltage across the load can be roughly measured by connecting the potential divider across the MOSFET. When the MOSFET is off, the ADC input will read 22/11V and when it's on, it'll read a very low voltage, probably around zero, as it will be under one ADC count. For a more accurate measurement, monitor the 24V, using a potential divider and the voltage across the MOSFET using a single current limiting resistor.
 
The following users thanked this post: castingflame

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Quote

When the MOSFET is off, the voltage on the ADC input will theoretically be 24V, because the MOSFET will disconnect the lower side of the potential divider R5 & R6, leaving only R5 in series with 24V. In reality, the ADC input's ESD protection diode will start conducting, so the voltage on the ADC input, will one diode drop above the power supply voltage. Because the voltage would be outside the acceptable range for the ADC pin, the reading will be unreliable, hence the random values.


Good job Hero.  I have been monitoring this thread, and shaking my head.  While I wanted to answer, I took the Socratic approach but flame refused to respond to my opening salvo. 
 

Offline castingflameTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: gb
Quote
Good job Hero.  I have been monitoring this thread, and shaking my head.  While I wanted to answer, I took the Socratic approach but flame refused to respond to my opening salvo.


I think this is a bit unfair. I have at no point pretended to be anything else but trying to learn and appreciate the help that was given. I have quoted that this is somewhat above my level and I am trying to help my father out. I am also spending a lot of time studying and I am very aware of my lack of knowledge. That is why I have asked for help.


"refused to respond to my opening salvo"  as you quote is not true either. I have refused nothing. In actual fact, I needed some time for my fried brain to relax a bit again for a day or so to process exactly what you meant. When I did understand I was not able to get back to the bench to measure it until today.


Quote
I have been monitoring this thread, and shaking my head.
I help out in other areas when people request help. I would never mock or belittle them especially if they are trying hard and putting effort in to learn.




Quote
It think others have answered the other questions adequately, but unless I've missed something, no one seems to have dealt with this.

When the MOSFET is on, the voltage on the ADC input will be V = VIN*R6/(R5+R6) =  24*10/(100+10) = 24*10/110 = 22/11V

When the MOSFET is off, the voltage on the ADC input will theoretically be 24V, because the MOSFET will disconnect the lower side of the potential divider R5 & R6, leaving only R5 in series with 24V. In reality, the ADC input's ESD protection diode will start conducting, so the voltage on the ADC input, will one diode drop above the power supply voltage. Because the voltage would be outside the acceptable range for the ADC pin, the reading will be unreliable, hence the random values.

If you don't need any isolation, then the voltage across the load can be roughly measured by connecting the potential divider across the MOSFET. When the MOSFET is off, the ADC input will read 22/11V and when it's on, it'll read a very low voltage, probably around zero, as it will be under one ADC count. For a more accurate measurement, monitor the 24V, using a potential divider and the voltage across the MOSFET using a single current limiting resistor.


Thank you for such a detailed review of what was going on. I had a very rough idea where the problem was happening but not with any amount of detail, equations, sound proof. Just a guess really. I'll spend time this evening when things are little quieter and go though your details. Thank you , I appreciate it.  :-+


For that part of the monitoring, I have actually moved to an i2c current/voltage sensor so I will be 'playing' with that over the next few days (life allowing). I have just spent today documenting everything I have learned so far along the way.

« Last Edit: September 04, 2018, 01:35:42 pm by castingflame »
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us

I asked one question: "What are you reading?"
You did not answer. 

No harm no foul.  Hope your circuit is working now.

Sorry if I hurt your feelings.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf