Over Current Sensing by Microcontroller

Thread Starter

fastbike

Joined Dec 29, 2020
120
OK, I'll check the characteristics of the load. That would simplify things considerably.
Short circuit faults can cause asymmetric currents to flow, so I'll stick with the dual comparator concept.
Microchip have an interesting dual comparator with this little gem in the datasheet.
1617503562901.png

Bingo !
Section 4.2 of that document also states
"The open-drain output is designed to make level-shifting and wired-OR logic easy to implement." which was also stated in #19 above.
 

Thread Starter

fastbike

Joined Dec 29, 2020
120
I think I'll need to invert those gates as I want the signal to go high when the voltage is outside the window. Something more like
1617516843604.png
 

Thread Starter

fastbike

Joined Dec 29, 2020
120
What value has Vref? Exactly in the middle between Vs and GND?
Yes, it sets the mid point bias for the output from the Hall effect current sensor. So for a 5v supply and a 200mV/A sensor and 5A AC load the output will vary from 1.5 to 3.5 volts.
 

Ian0

Joined Aug 7, 2020
9,803
AC current draw is almost always symmetrical around zero, so all you have to do is sense one side of the waveform.
Generally, it is illegal for it not to be symmetrical (EN61000-3-2) but hair-dryers are an exception!

Even so, I'd still sense both sides - somehow, it just seems right, if not strictly necessary. And if you've bought a LM393, you've already bought two comparators, and it only takes one more resistor to sense both sides. If a load starts drawing an asymmetric current, it might be a sign that it's in trouble.

Your post #15 circuit is how I would have done it. I don't think I would have bothered with R4 and R5, and you can lose one resistor from R2.1, R3.1, R2.2, R3.2 by having one resistor to 5V, one resistor to 0V, and one between the inputs, and as @dendad said, wire-or the outputs with a single pull-up.
One thing to watch out for are loads which draw high pulse currents - things with toroidal transformers and large smoothing capacitors. They would trigger your circuit long before you expect it to.
 

Thread Starter

fastbike

Joined Dec 29, 2020
120
Your post #15 circuit is how I would have done it. I don't think I would have bothered with R4 and R5, and you can lose one resistor from R2.1, R3.1, R2.2, R3.2 by having one resistor to 5V, one resistor to 0V, and one between the inputs, and as @dendad said, wire-or the outputs with a single pull-up.
One thing to watch out for are loads which draw high pulse currents - things with toroidal transformers and large smoothing capacitors. They would trigger your circuit long before you expect it to.
Thanks for the constructive feedback. R4 & R5 from that circuit are definitely gone, and the setpoints are now set with a 3 resistor chain as the original diagram did not make it clear which was the low and high setpoints.
I've built the comparator/inverter part of the circuit, and redrawn it (below) so can confirm it works as intended. I.e. the output is high when input voltage is lower than the low setpoint, or higher than the high setpoint.
I also stumbled across a YouTube video from the EEVBlog which gave me exactly what I wanted: EEVblog #471 - Overload Detector Circuit Design

The output of this circuit will be latched into the micro on a rising signal interrupt, and the latched value read when the 50Hz voltage crosses zero (i.e. 100 times per second). Sixteen successive latched values puts the channel driving the mosfet into a fault state which disables the output devices. This is configurable, but that is for another post.

1617618289502.png
 

Thread Starter

fastbike

Joined Dec 29, 2020
120
I'm looking to replace the MCP6547 with a MIC841, which does the voltage window detection with fewer components.
https://www.microchip.com/wwwproducts/en/MIC841
It is also available in an active High or active Low output configuration.
Device is available as SC-70-5 package so that will save space on the board (4 channels required)
Looks like a win-win for this design
 

Ian0

Joined Aug 7, 2020
9,803
Looks more like lose-lose to me, as the 841 isn't a window comparator. It sets the output when it goes above the high threshold and resets when it goes below the lower one, and seems like it uses the same number of resistors.
 

Thread Starter

fastbike

Joined Dec 29, 2020
120
Looks more like lose-lose to me, as the 841 isn't a window comparator. It sets the output when it goes above the high threshold and resets when it goes below the lower one, and seems like it uses the same number of resistors.
Good catch thank you. You are correct in that the datasheet notes "the difference between the threshold voltages being the hysteresis voltage"
Back to the drawing board.
 
Top