current direction detection

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

I was wondering how can I dectect the direction of current? Thanks

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you're talking about the current through a resistor, the voltage across it will change polarity when the current changes direction.

Sid

Life... is a state of mind

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a variety of bipolar current sensing ICs. Some based on Hall Effect and some based on resistor drop. In both types, the voltage is some bias voltage +/- signal. The sign of the signal depends on the current direction.

Hall types tend to work best at currents above a half amp or so. Resistor based current sensors tend to work best for currents under about an amp.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yesterday I found this interesting little chip from TI:

INA219

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is really interesting!

Works with bus voltages up to 25V. Monitors both voltage and current (with an external current shunt). It works with either high-sde current shunt or low-side current shunt.

Internal ADC with I2C interface. It has an internal digital multiplier to compute power.

Lots of very cool features! Thanks!

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks guys :-)

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

My question might be silly, so how can I take advantage of this, the change of polarity.

I have a looked at the the datasheet of an atmega16, the input voltage of any pin is -0.5v to Vcc + 0.5v(except reset).

so say if at some point, I might get a voltage of -1v to 1v, how can I handle the -1v?

ChaunceyGardiner wrote:
If you're talking about the current through a resistor, the voltage across it will change polarity when the current changes direction.

PS:
I found this
http://cds.linear.com/docs/Appli...

Zhuhua Wu - Electronic Engineering Student

Last Edited: Sun. Sep 23, 2012 - 01:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I was wondering how can I dectect the direction of current?

Are you measuring nano/micro/milli-amps or Amps. Different solutions for different orders of magnitude.

Considering the "observer effect", what voltage drop is permitted in the detector.

If order of current is in the milliamp range and you can afford to drop a volt or two, a pair of photo-couplers with the photo-diodes wired back to back(and suitable current limiting) will give you a logic output for either direction.

I used to use this for testing for reversals in telephone circuits (detection of Karlsson signals)

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you add 1 V to the signal then you will get a new signal of 0 to 2 V, which the AVR can handle quite nicely.

Some would use a simple resistive adder, others would use an Op-amp adder circuit.

The advantage of the op-amp circuit is that you can also give it gain, and scale the 0-2V to 0-5V so that you can take full use of the ADC scale when using V+ as the Vref, and the op-amp output can drive the ADC input easily. One can also include a Low Pass Filter within the op-amp circuit to bandlimit the input signal. Google Shannon-Nyquist for more info on this, as well as digital signal sampling. For a slowly changing input signal without any high frequency noise you can skip the LPF. The op-amp also easily meets the <=10K input impedance spec for the signal source driving the AVR ADC inputs, (most of them, anyway).

The disadvantage of the op-amp adder approach is cost, parts, and board space.

You have not provided enough information about what you are measuring to meaningfully suggest which approach would be "best".

JC

Edit: cross post with Lee.
Lee, What's a Karlsson signal?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

You have not provided enough information about what you are measuring to meaningfully suggest which approach would be "best".

I made this mistake a few time, and yet I made it again. (for my defense, I didn't know what exactly I am looking for, but a few early replies to this post, lead me to do some googling, I got a clearer picture now)

here is what I want to do:

monitoring the current flowing in/out of a SLA battery, the purpose of this is to find out when the battery is charging/discharging.

Monitoring the current is my solution, but other suggestions are welcome.

the magnitude of the current is not important at this stage, but low current consumption is important. and the direction of the current.

the battery which is going to be monitored is a SLA battery, with the capacity of about 3Ah to 5Ah.

the info will need to be processed by a uC in some way. (analog/digital/I2C...)

An single chip solution is always welcome, but I do want to understand the operation behind it (as I am a student).

I found this:
http://cds.linear.com/docs/Appli...
but I am not quite understand all of it at this stage.

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LDEVRIES wrote:
Quote:
I was wondering how can I dectect the direction of current?

Are you measuring nano/micro/milli-amps or Amps. Different solutions for different orders of magnitude.

Considering the "observer effect", what voltage drop is permitted in the detector.

If order of current is in the milliamp range and you can afford to drop a volt or two, a pair of photo-couplers with the photo-diodes wired back to back(and suitable current limiting) will give you a logic output for either direction.

I used to use this for testing for reversals in telephone circuits (detection of Karlsson signals)

the current going to be monitored is in mA range;

Actually, I haven't thought of the allowable voltage drop, but I believe if I can limit the drop to a reasonable small level is good, as I will need to minimize the energy waste as small as practical possible.

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, if you put a resistor in the load so that the voltage drop is at least 2 Volts. You now put the photo-diodes back to back with one 150 resistor. Connect the emitters of the opto's to Vss and connect the collectors to two I/O pins with pull-ups enabled.
You can now detect
-no current
-current one way or the other
-AC if you want to!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is your dilemma and why you REALLY need one of the integrated solutions.

Lets suppose that you put a current sense resistor in the positive lead of the battery. In most cases, the battery voltage is higher than the microcontroller Vcc. So, you cannot just connect ADC inputs to opposite ends of the battery. Micro will fry. Smoke. Flames, even.

Lets suppose that you "solve" this by making two voltage dividers to ground, one from each end of the current sense resistor. Now, you have standby current and a major tolerance problem (getting the two dividers matched). The high-side current sense IC solves exactly this problem. And, for a very modest price.

OK, so, lets suppose that you put a resistor in the negative lead of the battery. Everything is OK as long as the voltage drop is positive. As soon as it becomes negative, your ADC no longer functions (unless xMega or external bipolar ADC).

The simple answer is - just trying to measure an inline resistor with an ADC is a looser. It takes so many "fixes" that you are far better off doing it right.

You can get high-side sense ICs for less than 1.5 USD at DigiKey:

http://www.digikey.com/product-d...

This is an SOIC-8 package which IS smt but not that hard to work with.

Thats my opinion -

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that the INA270/271 are unidirectional.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Uggg - yes! So, about 2.5USD for bidirectional ones.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Jim

How about this one, is this one look allright?
http://docs-asia.electrocomponen...

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's also hall-effect devices like the ACS712-05 that can be got cheaply on a little circuit board from places like Seeedstudio.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks kartman

Zhuhua Wu - Electronic Engineering Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

give the AVR same GND as batt.
put a shunt resistor at the plus pole.
make a "matched" resistor drop from each side
of the shunt. put those to a differential ADC.
or just the analog comperator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A discharged 5Ahr SLA can easily sink several amps if your charging supply allows it.

A very rough and crude method could be to just monitor the voltage of the battery., eg for a 12Volt SLA anything below 12.6V (@25'C) means that the battery is discharging or faulty.
This method is not very accurate to indicate 'charging' because the voltage will be below 12.6V until the battery absorbs a significant charge if the charging current is less than about C/5.

You can use a uni-directional current-sensor if you also monitor the voltage of the charger.
ie. if charging voltage is zero, or less than the battery voltage, or the supply to the charger is low, then the battery is discharging.