MOSFET low side switching, Opto-Isolated Driver, isolated Amp Votage sensing ! - Page 1
Forum section: electronics / beginners

author: castingflame
author_rank: Regular Contributor
timestamp: August 30, 2018, 08:32:25 pm
content: 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

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 30, 2018, 08:57:25 pm
content: 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 neededthen 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.

author: castingflame
author_rank: Regular Contributor
timestamp: August 30, 2018, 09:28:03 pm
content: 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.QuoteI 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.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 30, 2018, 09:44:53 pm
content: 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 currentbtw: if the led lights up in your circuit, it's fine, but in the schematic it has wrong polarity

author: castingflame
author_rank: Regular Contributor
timestamp: August 30, 2018, 10:35:17 pm
content: 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!

author: MasterT
author_rank: Frequent Contributor
timestamp: August 30, 2018, 10:57:14 pm
content: Data sheet FQP30N06L says Gate-Source Voltage Vgss +-20V absolute maximum.

author: boB
author_rank: Frequent Contributor
timestamp: August 30, 2018, 11:53:33 pm
content: 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 slowerthan the 1K1 in series with the LED. Hope that's OK.boB

author: bson
author_rank: Unknown
timestamp: August 31, 2018, 12:07:43 am
content: 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.

author: castingflame
author_rank: Regular Contributor
timestamp: August 31, 2018, 01:42:11 am
content: QuoteThanks 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.QuoteWell I dropped a clanger there.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 theUCC27423http://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.QuoteDo 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.QuoteIt 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

author: Wimberleytech
author_rank: Super Contributor
timestamp: August 31, 2018, 02:09:48 am
content: 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?

author: MasterT
author_rank: Frequent Contributor
timestamp: August 31, 2018, 02:12:51 am
content: Quote from: castingflame on August 31, 2018, 01:42:11 amIt'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=81808Study data sheets, there are a lot useful info there.

author: castingflame
author_rank: Regular Contributor
timestamp: August 31, 2018, 08:11:44 am
content: QuoteAfter 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 sheethttps://www.sparkfun.com/datasheets/BreakoutBoards/0712.pdfAny 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

author: MasterT
author_rank: Frequent Contributor
timestamp: August 31, 2018, 09:03:40 am
content: Quote from: castingflame on August 31, 2018, 08:11:44 amRight. Use isolated amplifier as voltage sensor. Like:https://www.broadcom.com/products/optocouplers/industrial-plastic/isolation-amplifiers-modulators/isolation-amplifiers/acpl-c870Orhttp://www.ti.com/lit/ug/tidua58/tidua58.pdf

author: castingflame
author_rank: Regular Contributor
timestamp: August 31, 2018, 09:16:55 am
content: QuoteFantastic. I'll study those and try and put together my thoughts/design in KiCAD

author: castingflame
author_rank: Regular Contributor
timestamp: August 31, 2018, 12:05:20 pm
content: Okay, so another basics question about my choice of Isolated Driver for the MOSFET.I have 2 that I am looking at;UCC27424has a supply voltage of 4-V to 15-V. Datasheethttp://www.ti.com/lit/ds/symlink/ucc27424.pdfandVO3150Ahas a supply voltage of 15 V to 32 V Datasheethttps://www.mouser.co.uk/datasheet/2/427/vo3150a-244703.pdfWith 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

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 31, 2018, 12:26:52 pm
content: 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.

author: castingflame
author_rank: Regular Contributor
timestamp: August 31, 2018, 12:29:10 pm
content: Thank you HB9EVI. Appreciated1 down, 1 to go.On to the next ...

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 31, 2018, 12:41:20 pm
content: 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.

author: castingflame
author_rank: Regular Contributor
timestamp: September 02, 2018, 09:54:34 am
content: 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.VO3150MOSFET driver Datasheethttp://www.ti.com/lit/ds/symlink/ucc27424.pdf]http://www.ti.com/lit/ds/symlink/ucc27424.pdfSupply Voltage = 4 to 15v(A/B) Input Voltage = -2 to 15vOUT_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.FQP30N06LMOSFET Datasheethttp://www.mouser.com/ds/2/149/FQP30N06L-112819.pdfI 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.Paul

author: HB9EVI
author_rank: Frequent Contributor
timestamp: September 02, 2018, 11:36:42 am
content: 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,5AYou'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/dt0,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

author: castingflame
author_rank: Regular Contributor
timestamp: September 02, 2018, 12:33:08 pm
content: QuoteStupid mistake is a reflection of the state of my brain at the momentWhat a tool. There is no hope for me!Anyway, i'll take a look at the correct datasheet.QuoteI 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.QuoteIndeed 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 purchasedThe Art of Electronics by Thomas Hayesbook which has been a pretty great book so far and I am also following a Udemy course by Andre LaMotheCrash Course Electronics and PCB Designwhich 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 studentI am trying hard, but also a bit'trying'at times tooPaul

author: Zero999
author_rank: Super Contributor
timestamp: September 03, 2018, 10:49:00 am
content: Quote from: castingflame on August 30, 2018, 08:32:25 pmIt 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/11VWhen 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.

author: Wimberleytech
author_rank: Super Contributor
timestamp: September 03, 2018, 01:07:36 pm
content: QuoteGood 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.

author: castingflame
author_rank: Regular Contributor
timestamp: September 04, 2018, 01:18:54 pm
content: QuoteI 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.QuoteI 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.QuoteThank 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.

author: Wimberleytech
author_rank: Super Contributor
timestamp: September 04, 2018, 01:37:02 pm
content: 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.