![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hello everyone, I am faced with a fairly unusual problem... I want to read some current flow, and for this, I use a 0.1Ohms resistor and read the voltage drop across it. I use an Atmega16 and it's integrated ADC to read the voltage drop. The Problem is: Current across the resistor can flow in both directions... I have a couple of relays that can change the polarity of the voltage (12V) being applied to the external load (12V Motors, to be precise) and subsequent current-sensing resistor... I have attached a rough schematic to illustrate. I'm afraid that the wiring of the motors is already fixed, I cannot change it. When current is flowing in one direction, the voltage drop across the resistor is well within the sensing range of the ADC (<5V). But when it is flowing in the other direction, I of course read 12V minus the minor voltage drop across the resistor, that is, slightly less than 12V... But that's way to much to sense for the ADC... Is there any way I can overcome this problem?
__________________ Seize the time, and seize it now! | |
| |
| | #2 |
|
is it important that you know the direction of current flow? ![]() http://www.edn.com/archives/1996/031496/06di1.htm You could use a full wave precision rectifier but you'll need a dual power supply which can be made using a 555 timer or is even simpler if you're running this from a transformer.
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #3 |
|
You can use an IC amplifier in differential mode to sense the current in both direction. Looks at the following link and a snapshot from the same webpage in the link. bidirectional high-side current monitor
__________________ L.Chung | |
| |
| | #4 |
|
I already know the polarity by which relays I activate, so that's no problem. Thanks for those two tips already, I'll have a thorough look at either one, and post here again
__________________ Seize the time, and seize it now! | |
| |
| | #5 |
|
Why can't you just put the current sense before the change over relay?
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #6 |
|
hi, Edited your drawing, attached, to clarify the problem. One solution would a instrumentation amplifiers, with its inputs across the sensing resistors. You would require a inst amp that could tolerate a CM voltage of 12V, powered by say +/-15V
__________________ Eric " Good enough is Perfect " I will NOT answer PM's requesting technical help, please use the Forum PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/ Last edited by ericgibbs; 7th July 2008 at 12:22 PM. | |
| |
| | #7 |
|
@ericgibbs: Yes, that's the problem, however, the four motors (which are for the electric windows in a car, btw.) have four wires to them, and one common wire to return to the control unit. That of course means that all motors can only run in one direction at a time, but that is a restriction I can live with. In fact, I think what I need is an amplifier with a gain < 1, so that the input voltage is actually reduced, so that +12 - Vs will give me approx. 5V (or let's say, +14.4 Volts, since this is the highest voltage I can get in a car.) I have tried a simple voltage divider for this purpose, but that just doesn't seem to work... I always read +12V - Vs at the mid tap, where I should actually read much less than that. @Hero: I need to know each individual current drain from every motor. If I would put the sensing resistor before the relays, I could only know how much all motors drain together, but not for every single one.
__________________ Seize the time, and seize it now! | |
| |
| | #8 | |
| Quote:
Get the datasheet for the AD623 instrumentation amp. www.datasheetarchive.com This type of amplifier will only amplify the voltage across the sense resistor and cancel the common mode voltage. I am not sure if the AD623 can tolerate a common mode input voltage of +12V, but it will give you an idea for a solution. EDIT: the maximum supply voltage for the AD623 type is only +/-6V, but its easy to build a inst amp using standard op amps.
__________________ Eric " Good enough is Perfect " I will NOT answer PM's requesting technical help, please use the Forum PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/ Last edited by ericgibbs; 14th October 2007 at 06:22 PM. | ||
| |
| | #9 | |
| Quote:
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | ||
| |
| | #10 |
|
@Hero: Where? Could you please illustrate that in the schematic, I can't quite seem to get what you mean... ![]() @eric: Am I right in thinking that if I would connect the inputs of the AD623 to right before and right after my sensing resistor, it would amplify the voltage drop there, no matter in which direction the current is flowing? If so, I don't think I'll get a single polarity output signal, right?
__________________ Seize the time, and seize it now! Last edited by Odysseas; 14th October 2007 at 07:18 PM. | |
| |
| | #11 |
|
I'd do it like this, if you want to sense on the negative side then it's possible but you need to rearrange the whole circuit,
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #12 |
|
But that way I would read 12V - Vr across a motor, and that's too much for the ADC of the Atmega.
__________________ Seize the time, and seize it now! | |
| |
| | #13 |
|
Then swap the + and 0V terminals so the sense resistor is on the low side.
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #14 |
|
What? I just don't get it. Swapping + and GND wouldn't make a difference... The current can flow through the resistor in both directions, that's what the relays are for. If I would put the resistor right before GND, I could only sense the current when it flows through there, but it doesn't, when the relays change the polarity on the motors... Then the current would flow from +12V to every individual motor towards common GND (the left relay provides that).
__________________ Seize the time, and seize it now! | |
| |
| | #15 |
|
I don't think you understand me. Look at my modified version of your schematic: ![]() Now swap the +V and 0V connections to it. +V becomes 0V and 0V becomes +V, the voltage on the resistors will be directionally proportional to the current flowing through them.
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
|
| Tags |
| current, directions, drop, read, resistor, voltage |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Expert Stabilised Power Supply with Current Limiting | mechie | Electronic Projects | 41 | 11th May 2009 11:20 PM |
| Battery Charger with auto shut-off feature | hardcore misery | Electronic Projects Design/Ideas/Reviews | 134 | 12th February 2008 09:20 PM |
| Voltage | ElectroMaster | Electronic Theory | 44 | 8th August 2007 06:35 PM |
| Need some help with a code provided by ATMEL | ikalogic | Micro Controllers | 1 | 23rd January 2007 03:46 PM |
| imulate a small Voltage Drop Out with MOSFET vs. parasitic capacitances | dirkdiggler2oo2 | Electronic Projects Design/Ideas/Reviews | 6 | 22nd December 2006 03:30 PM |