I’m a little stuck when it comes to measuring the current draw of a system...
The problem is that the µC ground and the OP-AMP ground aren’t the same witch prevents me from measuring the output of the OP-AMP with the µC.
The µC has to be in series with the load!
MarkT:
Could you draw an accurate diagram, simplification seems to have turned a microcontroller into an ammeter
or fuse as its inline with the 24V supply...
Please give an accurate diagram of the circuit, in particular the opamp circuit, and the power supply of the
microcontroller
The simplification is quite accurate.
The micro controller is in series since this is a 4-20mA control loop.
There is no complete schematic of this since these are modules that are hooked up with wires. (It’s a one off school project)
The power supply is just an of the shelf LTC3255.
My school was given a lot of eval boards from Analog, hence the use of only LT components
Ah, the LT6106 is a special purpose opamp for current sensing. The circuit values you have
show an output of 165mV/mA, and the output voltage could rise to nearly 24V if the current is
high enough, so you need to protect the microcontroller input somehow.
It seems from the LTC3255 circuit the microcontroller has a low current 3.3V supply. Just
using a schottky diode to the 3.3V rail is dangerous as the current sense chip could easily
pull the rail too high in a fault condition.
I'd either make the load resistor of the LT6106 into a voltage divider chain (increasing the
gain to match), or use a blue LED like a zener on the output (gives visible over-current
indication too...).
MarkT:
Ah, the LT6106 is a special purpose opamp for current sensing. The circuit values you have
show an output of 165mV/mA, and the output voltage could rise to nearly 24V if the current is
high enough, so you need to protect the microcontroller input somehow.
It seems from the LTC3255 circuit the microcontroller has a low current 3.3V supply. Just
using a schottky diode to the 3.3V rail is dangerous as the current sense chip could easily
pull the rail too high in a fault condition.
I'd either make the load resistor of the LT6106 into a voltage divider chain (increasing the
gain to match), or use a blue LED like a zener on the output (gives visible over-current
indication too...).
I’m a bit confused of your answer.
The voltage of the LTC3255 output is 3.3V which is fine for the ATMega328P.
The LT6106's gain is set to 100x (the resistor values are incorrect in the schematic) so the highest possible voltage on the output is (20mA x 100 = 2000mV = 2V). I also have a version with a gain of 165x so 20mA would be 3.3V.
The thing is that the grounds don’t match up, µC GND is floating and equal to the OP-AMP input voltage so I can’t measure the output since it’s referenced to a much lower voltage...
How would I hook these up to get a readable signal for the µC?
UNI-T:
I’m a bit confused of your answer.
The voltage of the LTC3255 output is 3.3V which is fine for the ATMega328P.
The LT6106's gain is set to 100x (the resistor values are incorrect in the schematic) so the highest possible voltage on the output is (20mA x 100 = 2000mV = 2V). I also have a version with a gain of 165x so 20mA would be 3.3V.
The highest possible value on the output is nearly 24V, you assume no inrush current in the load for instance. If you put 24V onto the uC pin it will be toast, even with a 1k series resistor, hence you
need a protection circuit.
The thing is that the grounds don’t match up, µC GND is floating and equal to the OP-AMP input voltage so I can’t measure the output since it’s referenced to a much lower voltage...
How would I hook these up to get a readable signal for the µC?
So show how the power supply for the uC is connected in full please - you just gave a ground-referenced
LTC3255 circuit which is definitely not floating so I assumed that was how you had it connected.
MarkT:
The highest possible value on the output is nearly 24V, you assume no inrush current in the load for instance. If you put 24V onto the uC pin it will be toast, even with a 1k series resistor, hence you
need a protection circuit.So show how the power supply for the uC is connected in full please - you just gave a ground-referenced
LTC3255 circuit which is definitely not floating so I assumed that was how you had it connected.
So adding a 3.6V schottky diode in the line should work?
UNI-T:
So adding a 3.6V schottky diode in the line should work?
If you mean zener, then no, use a blue LED, sharper knee, much harder voltage limiting,
and you get indication. Schottky diodes are completely different beasts from zeners.
Here is a version with the power supply on it.
Sorry for the horrible drawing
Well that cannot work. Connect ground to ground, don't break into the +24V line in series like that.
MarkT:
If you mean zener, then no, use a blue LED, sharper knee, much harder voltage limiting,
and you get indication. Schottky diodes are completely different beasts from zeners.Well that cannot work. Connect ground to ground, don't break into the +24V line in series like that.
Sorry I meant a Zener.
The way current loops work is that the PSU measures the current draw 4-20mA, the current draw is proportional to the sensors measurement (in this case the "Load" box).
The only way to not disrupt the signal/current draw is to be in series with the load/sensor, this drops the voltage a bit.
This works and the micro controller turns on and works fine and the sensor/load works just fine but I’m having a hard time measuring the current draw since there are two different ground potentials...
The LTC3255 requires a voltage source, not a current source, but I guess the input capacitor will stiffen it
up and make it stable?
Looks like overthink.
If you want 3.3V from a constant current string, just use a 3.3V zener shunt regulator to generate it.
The shunt will produce a voltage outside the floating supply range, so an inverting opamp stage
can convert that and protect the MCU at the same time.
So a 3.3V capable rail-to-rail opamp, 10k between output and inverting input, 10k between inverting input
and negative shunt terminal, non-inverting input to floating ground.
BTW is the load resistance low enough that there will be enough voltage overhead for the shunt
plus 3.3V supply?
MarkT:
The LTC3255 requires a voltage source, not a current source, but I guess the input capacitor will stiffen it
up and make it stable?
Looks like overthink.
If you want 3.3V from a constant current string, just use a 3.3V zener shunt regulator to generate it.
The shunt will produce a voltage outside the floating supply range, so an inverting opamp stage
can convert that and protect the MCU at the same time.
So a 3.3V capable rail-to-rail opamp, 10k between output and inverting input, 10k between inverting input
and negative shunt terminal, non-inverting input to floating ground.
BTW is the load resistance low enough that there will be enough voltage overhead for the shunt
plus 3.3V supply?
Thank for the suggestion and the schematic!
The course that made me ask this question in the first place is "industrial control systems" and it says to avoid using Zener as regulators. This is also what I’ve heard from others.
However a Zener would work just fine in a low current application but not sure how well it would work in a current loop and to keep it in the spirit of the course I’d prefer to use a purpose built regulator.
This is probably just propaganda from the teacher to get us to use more LT components...
The LTC3255 outputs a nice clean signal and has been working great with my tests. I started of using the LTC3632 but it gave me a lot of problems and didn’t work properly in the "loop"
So I changed to the LTC3255. The ltc3632 did however work very well separately!
Is there a way to do this with the LTC3255 regulator and the LT6106?
The LT6106 can be swapped but it’s what I have laying around at the moment.
EDIT
If I’m not mistaken, the ATMega328P's ADC can be configured for differential use. Could I use that to measure the signal?
Shunt regulation is a natural fit for such a current source configuration - there are very few chips that
do shunt regulation as most are for voltage sources. Low voltage zeners are poor regulators, so you'd
probably need a voltage reference thinking about it.
There are ways to bolster a zener or reference and make a stiffer shunt regulator.
If I'm not mistaken, the ATMega328P's ADC can be configured for differential use. Could I use that to measure the signal?
Not in the way you think. Any voltage outside the supply range onto any pin will burn out the device...
MarkT:
Shunt regulation is a natural fit for such a current source configuration - there are very few chips that
do shunt regulation as most are for voltage sources. Low voltage zeners are poor regulators, so you'd
probably need a voltage reference thinking about it.
There are ways to bolster a zener or reference and make a stiffer shunt regulator.
Not in the way you think. Any voltage outside the supply range onto any pin will burn out the device...
IL definitively look into using a Zener as a shunt regulator! As of now I don’t have any Zener diodes usable values, so I’ll have to order some. IL steal your previous example for this
Meanwhile id like to try to get my current setup to work...
Can I use an opto-isolator in linear mode to accomplish this, or would it draw to much current?
I don’t have a lot of power to work with.
This is a messy thread; the OPost could have included more, and more accurate, information to speed things up a little.
Anyway, what is the sensor/load?
arduarn:
This is a messy thread; the OPost could have included more, and more accurate, information to speed things up a little.
Anyway, what is the sensor/load?
The sensor is some old timey industrial temperature sensor; it’s from the 90's and uses a 4-20mA current loop for power and signal. It’s a 2-wire type of current loop. It also has Modbus capabilities but it’s not going to be used.
I don’t really have much more information regarding it; it’s what was available to me. It doesn’t really matter what type of sensor it is since it just acts like variable resistor that changes the resistance proportional to the temperature.
UNI-T:
The sensor is some old timey industrial temperature sensor; it’s from the 90's and uses a 4-20mA current loop for power and signal. It’s a 2-wire type of current loop. It also has Modbus capabilities but it’s not going to be used.
OK. So, if you already have a 4-20mA capable sensor, then what is your intention with the MCU, op-amp, etc.? Why can't you just use the sensor directly?
arduarn:
OK. So, if you already have a 4-20mA capable sensor, then what is your intention with the MCU, op-amp, etc.? Why can't you just use the sensor directly?
They way that ive interpreted is that you have a SCADA system that measures/handles data and produces the 24V. The sensor is connected to the 24V line and acts as a variable load.
Non of the above are things i can control/measure. But if i want to measure the data and parse it without removing a sensor or SCADA system il have to make a loop powered thing so that i dont disrupt the Eco system.
I found some products on the market that do similar things but i want to make my own to learn more about electronics.
The intentions is to use the op-amp to change the current (signal) to a voltage that the micro controller can read and then use the micro controller to handle the data that is independent from the sensor and SCADA system.
MarkT:
Assuming the grounds aren't connected by chassis, etc.
The grounds are completely separate
EDIT
I tried hooking it up the following way and it seems to work.
However since it’s grounded through the power supply it’s a lot of noise. Making it almost impossible seeing the signal.
Is there a way around this or a better solution?