Author Topic: Comparators output when both inputs are at same potential  (Read 11961 times)

0 Members and 1 Guest are viewing this topic.

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Comparators output when both inputs are at same potential
« Reply #25 on: March 09, 2017, 03:10:15 pm »
Quote
The sense resistor is not yet decided upon, but I want to keep it low enough value so I can chose 0603 size and not worry about power rating.

Good luck with finding 0603 0.033 ohm parts.

Who needs an 0603 part; or any part? As SMD parts have been mentioned we know there must be a PCB, so ... just fabricate a trace with the desired resistance. e.g. 1cm long, 6mil trace in 1oz copper => 0.034 ohms. Sure, it's going to be quite wide tolerance but from the sounds of it this isn't a precision job.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1440
Re: Comparators output when both inputs are at same potential
« Reply #26 on: March 09, 2017, 05:25:47 pm »
Hi,

Just a quick note about the sense resistor size and it's effect on the precision of the circuit.
I suppose you want to sense when the current is 100ma.

Starting with a 1 ohm sense resistor, 100ma produces 0.1v across it, so with a 5mv offset the precision is around 5 percent so you will sense current that is between about 95ma and 105ma.  This could change if the offset drift is appreciable but looks reasonable so far.

Going down to a 0.1 ohm sense resistor, 100ma produces 10mv across it.  With a 5mv input offset the tolerance now is around 50 percent.  This means you could be sensing a current that is 50ma to 150ma roughly.  You wont know without a measurement and it could change with offset drift.  This may or may not be acceptable for your application.

Going down to a 0.010 ohm sense resistor, 100ma produces 1mv across it.  With a 5mv input offset the tolerance is now up to about 500 percent, which means we will be detecting a current somewhere between 0ma and 500ma.  This is clearly unacceptable.

Going back up to a 0.050 ohm sense resistor, 100ma produces 5mv across it.  With the same 5mv input offset the tolerance is now about 100 percent.  That means we are now sensing current anywhere between 0ma and 200ma.  While 200ma may still be acceptable, 0ma will not be.  A measurement would show the actual value, but any drift will quickly mess things up.

It should be clear now that if we go down to 0.033 ohms it probably wont work very well.  In fact, the min resistor value is probably around 0.1 ohm unless you can get away with a wider range somehow.

By now you can probably see that sensing current is a little harder than sensing voltage.  There are ways to do it that dont involve just a simple sense resistor and comparator, but also involve some sort of amplification.  The amplifier amplifies the sense voltage and then a comparator works on a much higher voltage level.  There are also chips made just for this purpose.

If you intend to use a different circuit, it would be good to post that circuit here so we can take a look.
 

Offline HSPalmTopic starter

  • Regular Contributor
  • *
  • Posts: 106
  • Country: no
Re: Comparators output when both inputs are at same potential
« Reply #27 on: March 12, 2017, 04:33:20 pm »
Ok,

If you were to tie 7 volts to the Emitter of a PNP transistor,
Connect a load, say a lamp, to the Base of that transistor, and the other side of the lamp to the GND,
The voltage the lamp connected to the Base will be getting 6.3v, that is the internal switch on voltage of the Base, IE, the 1 diode voltage drop.  The lamp will receive 6.3v instead of 7v, but, it will always stay on.

Now, when I say that you shouldn't go above 300ma, IE, a strong lamp, you will burn out the transistor, both in heat and Base-Emitter junction.

If you don't connect anything to the Base, the Collector (current sense output) is freely pulled down to GND by the 10k resistor in my design, but, if you connect the lamp to the Base, this pulling down on the base turns on the transistor and pulls the output Collector to the 7v connected to the Emitter.  This is your load sense output.  With a connected load/lamp, the base is turned on and the Emitter goes high.  (If you run this at 7v, then the high output will be 7v.  If you are feeding a logic level MCU, a series resistor may be used is the MCU input has diode clamps, or, 2 resistors on the output using the center tap will divide the output voltage to a safe level in place of the 10k.) 

You should be able to try this out with a 2N3906, however, with that transistor, make sure your load, IE lamp doesn't go above 50ma, or the transistor will blow.

Once you are comfortable with this, we can take a look at adding either a power diode or just a beefier transistor if you need to support loads of 1 or more amps.

There is no comparator in this design.  The transistor is your comparator...

As for the comparator design, if you can place the Rsense resistor to the GND instead of the 7v, then all you need is a 5v comparator with 0v support inputs.  As for the + input on the comparator, just place a resistor to GND and another to the 5v and you should get a switch working once enough Rsense goes high enough.  This circuit also allow you to use any voltage for 7v like my transistor design since the comparator only needs 5v, or 3.3v if you have a 3.3v, or even less mcu supply.

Hi Brian, I just had the time to simulate your transistor design and I'm pleased with it. I will try to hack it in to my design when the PCBs arrive. The product is a battery pack with boost circuit, and I need the load sense signal to make sure that:
1* The low voltage beeper won't beep unless the battery is in use.
2* The LED voltage indicator should light when battery is in use, not otherwise unless button is pushed.

So as you can see no logic level/mcu involved. Thank you fo ryour time.

Hi,

Just a quick note about the sense resistor size and it's effect on the precision of the circuit.
I suppose you want to sense when the current is 100ma.

Starting with a 1 ohm sense resistor, 100ma produces 0.1v across it, so with a 5mv offset the precision is around 5 percent so you will sense current that is between about 95ma and 105ma.  This could change if the offset drift is appreciable but looks reasonable so far.

Going down to a 0.1 ohm sense resistor, 100ma produces 10mv across it.  With a 5mv input offset the tolerance now is around 50 percent.  This means you could be sensing a current that is 50ma to 150ma roughly.  You wont know without a measurement and it could change with offset drift.  This may or may not be acceptable for your application.

Going down to a 0.010 ohm sense resistor, 100ma produces 1mv across it.  With a 5mv input offset the tolerance is now up to about 500 percent, which means we will be detecting a current somewhere between 0ma and 500ma.  This is clearly unacceptable.

Going back up to a 0.050 ohm sense resistor, 100ma produces 5mv across it.  With the same 5mv input offset the tolerance is now about 100 percent.  That means we are now sensing current anywhere between 0ma and 200ma.  While 200ma may still be acceptable, 0ma will not be.  A measurement would show the actual value, but any drift will quickly mess things up.

It should be clear now that if we go down to 0.033 ohms it probably wont work very well.  In fact, the min resistor value is probably around 0.1 ohm unless you can get away with a wider range somehow.

By now you can probably see that sensing current is a little harder than sensing voltage.  There are ways to do it that dont involve just a simple sense resistor and comparator, but also involve some sort of amplification.  The amplifier amplifies the sense voltage and then a comparator works on a much higher voltage level.  There are also chips made just for this purpose.

If you intend to use a different circuit, it would be good to post that circuit here so we can take a look.

Hi MrAl,
Yes, these are the considerations I've had to make. Fortunately, comparators with far less than 1mV offset is cheap and readily available. Also, the load is actually around 200-400mA, usually, but depending how complicated the design would be I wanted to cater for lower loads too. I know it's hard helping with when I don't have specifics but the project is really in a research stage where I consider several implementations. Thank you for taking your time, I appreciate it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf