Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to reduce the current of a signal by an exact amount?

  1. Aug 6, 2015 #1
    Hello all,

    The root problem is that I can't put all my analogue inputs onto one input card (each card has 4 inputs) on the project I'm working on.

    We have four sensors, they should all output 4-20mA.
    Two are source type outputs, supply voltage goes in, sensor current comes out, current is measured between sensor output and ground.
    The other two are sink type outputs. I believe they're outputting 4-20mA, but with reference to the power supply rather than with reference to ground. They appear to work when you put the supply power into the input and use the sensor output as the ground.

    On to the next problem.

    These cards have four inputs, but use a common ground. This means that I can have the two source type sensors on one card, but I'll need a separate card for each of the two sink type sensors.
    We only have 2 cards, and the client doesn't want to buy more. They're also not keen on hiring an Electrical Engineer to do it properly. Things are quiet in the office at the moment so I'm spending my spare time hypothesising.

    Possible solutions:
    The cards only sense current flowing one way. If I could reverse the current, I could put the supply on the ground terminal and the sensor output into the card input. I think this will be difficult/impossible/potentially damaging to equipment.

    I believe the sink type sensor is outputting the supply current - (4-20mA). For example, if the supply current is 600mA, then the sensor is outputting 580-596mA (20-4mA). If I could take off 576mA from the sensor current I would be left with 4-20mA with respect to ground. 20mA would be detected as 4mA and vice versa, but I can deal with that in the programming.

    I thought about putting a resistor in parallel, but found that I would need different resistances depending on the output of the sensor to take off 576mA each time. And a controllable variable resistor would just add more complexity.

    I should mention that, while I did Robotics Engineering at Uni, my strong suit is in software. So if it sounds like you're reading a bunch of nonsense, you probably are.

    The input card is a "Crevis ST-3234", here's a link to the pdf:


    The sensor output looks like this:

    The power supply is 24v, I don't know the current or the internal resistance of the supply.
    As you can see from the picture, the +24v is going to the input of the card and the output of the sensor (4: Black) is going to the ground of the card.

    Thanks for any light you can shed on the subject.

  2. jcsd
  3. Aug 6, 2015 #2


    User Avatar

    Staff: Mentor

    Use two current mirrors? (two transistors each)
  4. Aug 7, 2015 #3
    Ah okay, I haven't done much work with transistors. I've just looked it up and it seems like it could work.

    Would I be able to reverse the current with a current mirror? I assume I would just take the output of the current mirror and switch the wires the other way round. But I'll investigate. (Or wait until someone tells me that's completely wrong!)

    If I can't reverse the current, I'll need to find a way to turn 596mA into 20mA and 580mA into 4mA with the same circuit. It's unfortunate that gain is multiplicative.

    Unless I have a current source of 576mA and use that as the ground for the input to the card. Then 580mA would be 4mA and 596mA would be 20mA.

    I fear I've raised more questions than answered. Oh well, progress is progress!
  5. Aug 7, 2015 #4


    User Avatar

    Staff: Mentor

    With the example circuit below, you drive your reference current into the left transistor, and the right transistor sinks the same amount of current...

  6. Aug 7, 2015 #5
    It is not clear to me what the voltage and current levels are.
    Do you have a link to your sensors?
  7. Aug 10, 2015 #6
    Okay, so here's the sensors they usually use:

    But they were trying to be clever and got these air regulator valves with sensors inside them:

    Now, the one's they usually use seem to do this (example, 100mA supply 24v DC):

    But the ones in the valves seem to use the supply current as the reference, rather than ground.
    We're using a 24v power supply. Don't know what the current is though.
  8. Aug 10, 2015 #7
    So I went and bought a multimeter because the fuse has gone on the one in the office.

    I did some measuring and found something quite curious. The current I measured between the +ve and the return signal was indeed 4mA (as I had expected).
    But the current between the return signal and ground was actually less than I had anticipated, it was about 1.5mA.
    So I'm fairly certain I can't just use this current and adjust it by a factor (I'd need to take some measurements from site to find out for sure).
    However I may still be able to reverse the current to fit both valves on one input card.

    So my problem here is that it's actually the ground reference that is changing to alter the current. The input to both PLC inputs is a constant (+24v), but the ground is not identical between the sensors.
    How would I take the current between the +24v and the sensor output, and reverse it so that the ground input to the PLC is the constant (doesn't have to be 0v, just has to be constant and output the correct mA value) and it is the input that is changing (as it should always be, forevermore, amen)?

    I do believe that current mirrors will prove to be one of the key elements of the solution I am looking for, so don't feel I'm ignoring your input. You've been very helpful, thank you.
  9. Aug 10, 2015 #8
    I'm still unclear what's going on. Sometimes I think this is an analog output. Other times it seems to be a I2C bus. I can't tell what you are measuring, or what your test set up is for current or why this is a current device not a voltage one. The manual is clearly intended for installation and basic operation, not modifications. Finally there is a hint that dangerous pressures are involved.

    Your boss needs to pay the money to hire a knowledgeable engineer who doesn't risk killing people rather than rely on some random guy on the internet.
  10. Aug 11, 2015 #9
    I completely agree!

    I haven't been asked to do this by anyone, I'm just incredibly bored of twiddling my thumbs so I thought I'd try to get a better understanding of things, so no pressure (on yourselves) and no death!

    Unfortunately it's not up to me, it's up to the client. And as the fuel prices dropped not so long ago, the oil and gas industry decided to cut lots of budgets. Meaning my client doesn't have as much to spend.

    I'm a PLC programmer, my company does HMI/SCADA stuff and as such, the electrics and plumbing should be done before I arrive. This was not the case and I wasted a week in Aberdeen. So I'm trying to figure out what's wrong with the electrical connections in case they waste my time again.
    We're still in the proof of concept phase at the moment, and anything I suggest will either be ignored or tested rigorously before being deployed.

    Now, regarding the problem I may have bombarded you with information. The operation manual for the valve that I sent includes a plethora of different valves. The valve that we have is 4-20mA input and output.
    I'm just focussing on the output of the valve here (there are also problems with the input, but I'm still waiting on some test data to analyse).
    It's 4-20mA because that is industry standard and is less noisy and doesn't suffer from communication distance as voltage does.
    The way the current is read by the PLC is actually by putting it across a known resistance and measuring the voltage, but this is peripheral knowledge.
    It is not I2C, SPI, USB, Profibus, DeviceNet, NPN, PNP or voltage type, just a simple 4-20mA output.

    So with all that in mind, do you have any ideas?

    Again, the main problem is this, and I'll try to be as clear as possible:
    The input card has a common ground, just the 1 ground.
    The valve is changing the current with respect to the +ve input supply of the valve (not with respect to ground, which I'd have expected).
    That means I have to put the output of the valve (black wire) in the ground of the input card, and +24v in the input terminal of the card (to get the correct magnitude of current flowing the correct way round).

    I have two of these valves, working independently, putting them in the same input card results in them both reading the same value (this was alarm #1 in my head).
    If I'm changing the ground, and there's only one ground, I can only use one card per valve (3 inputs wasted).
    These cards are expensive. I don't care, the customer does.
    How would I flip the current so that it's the same magnitude, but the constant is the ground and the variable is the input (thus giving me the same ground between the valves)?
    It's not a simple thing to describe to someone with no prior knowledge of the system. I've been working on this system for over a year now and I fear I'm too far gone!

    Thanks for any assistance you can provide, sorry for my obscurity,
  11. Aug 11, 2015 #10
    Current is not measured "with respect to" anything. Current is measured passing a point (usually on a wire). My question is, what is that wire attached to?

    Voltage is between two points (i.e. with respect to); current is passing through a point (wire, or possibly a closed ring).

    My guess at a solution is to run the current across a voltage divider. Then use a comparator (op-amp) to give a yes/no signal with a 4 or 20 mA output. (A diode and some resistors might be needed here.) The comparator should have something called a schmitt trigger. Given that you already have DC power, that and a linear regulator should set up a good solution. Boards are about $50 mail order. (Someone needs to do the layout; plenty of software for it.)

    But as I pointed out, I can't be certain. It seems to be a digital output, but ...

    And this should not be done by the software guy. Professionals get paid the big bucks for their knowledge. I wouldn't attempt to code something where lives were at stake even though I've written code in my time.
  12. Aug 12, 2015 #11


    User Avatar
    Gold Member

    You are talking 4-20ma current loop, which I get and understand, but I'm totally missing your particular problem. Maybe a diagram will help.

    Is the current loop sending "uart" style data?

    you can feed the current loop into an optical isolator to totally eliminate any ground issues.

    Read this and ask away!
  13. Aug 12, 2015 #12
    You definitely can have different amounts of current flowing through different parts of a circuit. I've managed to find the right point at which to measure the circuit, but my input device isn't ideal. I can't change the input device, so I was wondering if I could change the signal. I'll draw a diagram.

    Prepare yourselves, this might be painful:

    So this is how it's working so far.

    And the measurements are 4-20mA, but the valve is changing that black output wire. There are 4 inputs on that card, 3 of them can't be used because the common ground input to the card is being changed by the valve.

    This is how I'd like it to work, but it doesn't work this way.

    Bear in mind that the black wire from the valve is the signal wire, not ground (I don't know why they chose black).

    I suppose I could use the current between the + and the valve output, and put it into some sort of device that would read the current and output a corresponding 4-20mA signal. I could technically do that now, but I would still need 1 card per valve for the input, and I'd be using another analogue output card, so there's no point.

    I hope this clears something up, but in my experience, fag packet drawings such as these only increase confusion.

    Oh and don't worry, anything mentioned here is mainly for my own sanity and education. If I do come across anything, I'll mention it to the customer, but I'm not about to tell them how to wire anything up! And I'm certainly not about to wire anything up myself! We're not legally allowed to and I'm a 7 hour drive away from Aberdeen.

    I'll ponder on your idea now...

  14. Aug 12, 2015 #13
    So if there's a magical machine that can do this for less than £250, then I think we're good.

  15. Aug 12, 2015 #14
    You still don't get measuring current. You need to disconnect the wire and attach it to the meter. You should not be measuring it between two points.

    If you are sitting around not doing anything, you could probably wire a circuit to fix your problem for under £250. (If you have a problem. I don't trust your current measurements.) But if your time is valuable, I doubt it. It will take many hours of work.

    I will say that anything labeled "ground" should be connected to ground. To do otherwise is dangerous.
  16. Aug 12, 2015 #15
    Give me some credit! I know I'm only doing software now, but my degree is in Robotics Engineering!

    If you take a look at this
    On page 6, you'll find a diagram, top right. The positive of the "monitor output current" is attached to the positive of the power supply, that's where I put my red multimeter stick. The negative of the "monitor output current" is the black wire from the valve. This is where I put my black multimeter stick. The valve is disconnected from the I/O card at this point, else I'd be trying to measure current in parallel!
  17. Aug 12, 2015 #16
    I apologize for underestimating your electronics skills.

    I've never done this before, so maybe someone else can comment here.

    I think you can use a 1:1 transformer. It should match the current nicely.
  18. Aug 12, 2015 #17


    User Avatar
    Gold Member

    Did you even read the link (#11) I posted regarding the vishay opto? Do you see how that concept will solve your issue (like fig 2)? You use the sensor to power the transmission opto, and build your own 4-20ma loop using the receive opto as a switch (with,say, a 1.2K resistor to 24V)
    There are commercial devices that will do that.
    For example
  19. Aug 12, 2015 #18


    User Avatar
    Gold Member

    I think you will find that the burden resistor in the multimeter is very small. If you do this again I would suggest adding a resistor in series with the meter.

  20. Aug 12, 2015 #19
    There are lots of circuit configurations that will work here. The current mirror will work. An OTA will work. Your opto-isolator will work.

    I was hoping for 1) Buy transformer. 2) Install.

    I don't think it needs other parts. I don't think it needs a board or power. Just solder some wires and maybe some sort of plugs.

    It does have some down sides. I doubt the current will match exactly. I would expect ≈ 3% losses for example. But I haven't done much work with transformers and could be mistaken about -- well lots of things.
  21. Aug 12, 2015 #20


    User Avatar
    Gold Member

    Could you supply links to your sensors and input card? Sometimes there are configuration options to determine whether you want to source or sink current. Your input card and sensor seem to both be set up to sink current.

    For those that don't understand current loops:

    How can a transformer possibly work? The 4-20ma current loops have long periods of steady current. Or, some indicate something like pressure with a dc current. As a similar problem, how would you (in a simple way) send sporadic UART data through a transformer?

    Your current mirror would work, but not in the configuration you drew (just need to turn it over). Sinking 4-20ma on one leg needs to be translated into sourcing 4-20ma on the other. Like the left hand side of this image


    Remember, we are talking an industrial environment. Sensors don't resort to 4-20ma current loops for no reason. A surge protected, transient protected, ground fault protected industrial module (such as the acromag) is probably the best answer. People never get fired for solutions that just work. Acromag will either have a good solution, or point you in the right direction.

    (the acromag pictures show a transformer, but if they use one it a transition based implementation, not a simple transformer)
    Last edited: Aug 12, 2015
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook