Electronics > Beginners

MOSFET low side switching, Opto-Isolated Driver, isolated Amp Votage sensing !

(1/5) > >>

castingflame:
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

HB9EVI:
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.

castingflame:
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
--- End quote ---

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.

HB9EVI:
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

castingflame:
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






Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod