MOSFET control on sensing current direction - Page 1
Forum section: electronics / projects

author: dfindlay
author_rank: Contributor
timestamp: November 16, 2024, 07:02:03 am
content: Hi, I'm looking for some advice and simple solutions to sense DC current flow. Basically if the current is flowing in one direction, turn on a MOSFET and if its not flowing, or flowing in the reverse direction, turn off a MOSFET. Now I don't actually need it to be a MOSFET, it could be a transistor, relay, or other means to control a separate circuit. I have attached a simple block diagram. My intention is that this is a discrete on/off control but the current in the red 24V wire could be anywhere from 0.5 amp, to 10 amps. Any ideas or suggestions would be appreciated.

author: johansen
author_rank: Super Contributor
timestamp: November 16, 2024, 07:37:46 am
content: look up ideal diode circuits.but that being said, what you ask is technically impossible. if you sense current flowing in the wrong direction, and turn off the switch.. the current is no longer flowing and the switch stays off, because you also desire the switch to be off in the event current is not flowing.thus the switch will never turn on because current will never flow in the other direction again either.you can use two mosfets back to back with a common source to gate floating supply to make a 4 quadrant switch.otherwise if you do use a single mosfet, the battery will always be able to discharge, or charge, depending on the orientation of the mosfet, because it has a body diode that allows reverse current to flow.

author: Andy Chee
author_rank: Super Contributor
timestamp: November 16, 2024, 07:39:22 am
content: This appears to be some kind of automatic power transfer switch; upon loss of 24V supply, the battery module is switched in. Also, whilst 24V is available, you want to maintain battery charge.Is this assessment correct?

author: dfindlay
author_rank: Contributor
timestamp: November 16, 2024, 08:19:26 am
content: Thanks, I’ll look that up. I should have given more context previously, the area where the arrow is pointing is just to control the gate of a MOSFET, it’s not actually controlling the connection to the battery. Basically when any current is flowing out of the battery module, I would like to be able to sense this current flow and turn on other things in a separate isolated circuit. Things like an alarm, or fan. This other circuit will likely have a different source.

author: dfindlay
author_rank: Contributor
timestamp: November 16, 2024, 08:26:07 am
content: Essentially yes, but the charge circuit isn’t shown and not really part of my question. Basically when the batteries are discharging, I would like to enable a separate circuit for things like an alarm and fan. But the challenge I have is that there will be little to no voltage change, just a change in current on that wire with the arrow.

author: SteveThackery
author_rank: Super Contributor
timestamp: November 16, 2024, 08:53:19 am
content: Will a Hall effect device fixed to the wire pick up enough of a magnetic field to trigger?

author: Andy Chee
author_rank: Super Contributor
timestamp: November 16, 2024, 09:00:01 am
content: Quote from: dfindlay on November 16, 2024, 08:26:07 amActually it is, because one simple solution is to use a diode to isolate the two current paths, and just put the measurement current shunt into the diode isolated pathway (the battery and BMS). However, this solution requires consideration of the charging circuit.

author: youngda9
author_rank: Regular Contributor
timestamp: November 16, 2024, 06:25:59 pm
content: You can set up a uni-directional (or bi-directional) current sensor that outputs a proportional voltage to the current sensed. The output voltage(s) can be fed directly to the Gate of a MOSFET to turn it ON/OFF or into a comparator with a more stable & defined threshold used to turn ON/OFF a MOSFET.Here are a whole bunch of current sense ideas:https://www.analog.com/en/resources/app-notes/an-105fa.htmlCheck out this part for a simple uni-directional solution:https://www.analog.com/media/en/technical-documentation/data-sheets/ltc6101.pdf

author: dfindlay
author_rank: Contributor
timestamp: November 16, 2024, 11:13:23 pm
content: Yes thanks for suggesting this. I looked into some ICs that package this and this would be a good solution.

author: dfindlay
author_rank: Contributor
timestamp: November 16, 2024, 11:43:49 pm
content: With everyone's help, I modeled this circuit using an OP AMP to measure a voltage drop across a diode when the battery is discharging. Seems to work in the circuit simulator. The moment the main power supply drops even a little bit, the OP AMP activates the P type MOSFET and disables current on the Auxiliary loads (screenshots attached).Thanks!!

author: johansen
author_rank: Super Contributor
timestamp: November 17, 2024, 11:28:09 pm
content: circuit is excessively complicated.google "highside current sensing opamp"basically 4 resistors divide the voltage down so the opamp can compare them.you can then modify the circuit to use a comparitor with hystersis so the output is on-off rather than proportional.

author: dfindlay
author_rank: Contributor
timestamp: November 19, 2024, 07:55:23 pm
content: That helps, I'll simplify it. Thanks!!

author: rteodor
author_rank: Frequent Contributor
timestamp: November 19, 2024, 08:16:38 pm
content: You can also sense the current with INA169 high side shunt of 5...10mOhm for example. This one has analog output. Its basically the circuit you modeled but integrated in an IC made for current measurement (without the output switch of course).There are other variants with I2C output if that suits into your application.