PDA

View Full Version : Current sense to micro-controller: hall-effect or shunt/opto/amp?



W3DRK
11-01-2010, 01:17 PM
Subject says it all!

I'm trying to get somewhat accurate Grid and Plate current readings from one of my home-brew HF linear amplifiers into an Atmel MCU and it's becomming more of a struggle then I anticipated.

It seems my two options are to use a shunt resistor and somehow isolate and amplify the voltage across said shunt into a 0-5 V signal, or use a current sensing hall-effect IC that pretty much accomplishes the same thing but uses magnetics and all in one tiny IC package.

The current ranges I'm interested in are 0-500mA for the plate, and 0-125mA for the grid.

I've already tried the hall-effect approach without much success because it seems all of the sensor ICs are designed for higher currents, with the smallest I can find having a low-range in the 5 amp area. SparkFun makes a sensor breakout board (http://www.sparkfun.com/commerce/product_info.php?products_id=8883) with the Allegro ACS712 5amp IC with an opamp added to allow lower current sensing but I have to crank the gain up so high the noise makes the output utterly useless. Unless there is a low current hall-effect sensor out there I haven't found yet, I think I'm stuck with the shunt/amplifier approach.

Before I go trying to reinvent the wheel with getting readings from a shunt resistor isolated and into a digital device, has anyone been down this path before that can lend some advice and perhaps save me a lot of time and headaches? Pretty please! :)

Thanks!

WA4OTD
11-01-2010, 01:57 PM
I haven't been down this path exactly, but for work I just designed a current to voltage circuit with opamps that can detect the difference between 10mA and 40mA and switches. Changing the circuit to give 0-5 volt linear output would not be that difficult. It is pretty simple circuit, small series resistor driving an opamp and I have LT Spice circuit if you want a starting point.

You would need to do the necessary protection for the circuit from the amp (high voltage, RF bypassing, etc).

Thinking about it a little more a HV opto isolator might be the best.

KF5FEI
11-01-2010, 02:48 PM
Most of the current-sensor coils are designed for 60 hz, so they probably won't work for anything too high in frequency.

I *think* I remember seeing an opto that had a linear output based on the brightness of the LED. I'm thinking it was something intended for switching power supplies.

Not exactly modern technology, but a CdS cell and an LED might provide a semi-linear output you could amplify with an op-amp.

W3DRK
11-01-2010, 03:19 PM
KF5FEI: The current sense hall-effect IC I'm referring to does not use an external hall effect sensor, it actually has one built right into the IC. The problem is for such low currents I have to use so much gain at the output the resulting signal is so noisy it's useless.

A linear opto isolator might do the trick.

WA4OTD: The LT Spice circuit would be great!

I'm currently looking at the datasheet for a Linear 6105 extended range current sense amplifier that is supposed to be suitable for both high and low-side current sensing. Perhaps this device will suit my needs.

K7JEM
11-01-2010, 03:31 PM
I found these at Digi-Key, about $15 each:

http://media.digikey.com/PDF/Data%20Sheets/Honeywell%20Sensing%20&%20Control%20PDFs/CSLW%20Series.pdf

They don't specify isolation voltage though.

Could you just put a shunt resistor in the negative return and meter the voltage from there to ground? A 10 ohm shunt should give you 5 volts at 500 ma.

Joe

AF6LJ
11-01-2010, 03:37 PM
Just wondering out loud here......

Why not use the conventional means...
A low value resistor and an op amp to amplify the voltage up to a level your A/D can handle.

You can do all your metering from the negative end of the power supply, even grid current can be measured from the B- side of the power supply.

W3DRK
11-01-2010, 03:41 PM
Sue,

I think that's where I'm headed. The 6105 I mentioned is basically an op amp designed for current sensing.

http://cds.linear.com/docs/Datasheet/6105fa.pdf

Op amps are new territory for me, this should be fun!

W3DRK
11-01-2010, 03:50 PM
Hmm, it seems the LT6105 is pretty hard to source. The only place I can find it in the states is drop-shipped from the UK via Newark....with $20 handling fee!

Any recommendations for a more conventional op-amp that would suit? I would need a linear 0-5 volts for the AD from 0-500 mA current across the shunt resistor.

WA4OTD
11-01-2010, 03:53 PM
sent via your email address on QRZ, along with the schematic. Let me know if you have any questions.


KF5FEI: The current sense hall-effect IC I'm referring to does not use an external hall effect sensor, it actually has one built right into the IC. The problem is for such low currents I have to use so much gain at the output the resulting signal is so noisy it's useless.

A linear opto isolator might do the trick.

WA4OTD: The LT Spice circuit would be great!

I'm currently looking at the datasheet for a Linear 6105 extended range current sense amplifier that is supposed to be suitable for both high and low-side current sensing. Perhaps this device will suit my needs.

AF6LJ
11-01-2010, 03:55 PM
Looks like a good part, there is enough headroom to allow for protection of the part in the event of a failure in the amplifier.

Just wondering what type of amplifier, tube are you using?
GG or GD?

W3DRK
11-01-2010, 04:16 PM
The amp is a single GI-7B, grounded grid.

I've been dabbling with Atmel MCUs lately so I figured it would be fun to add an MCU to one of my amps. I whipped up a simple program based on the Atmega 328 and a 16x4 LCD display. So far I have properly sequenced T/R relays and bias, a configurable filament warm-up timer, GND and +5 to +24 PTT keying, grid and plate over current protection, plate voltage over/under protection, etc etc. Everything is configurable via menus on the LCD. So far everything works but I need a way to get the grid and plate current into the MCU. The plate voltage will be easy.

W8JI
11-01-2010, 04:35 PM
Hmm, it seems the LT6105 is pretty hard to source. The only place I can find it in the states is drop-shipped from the UK via Newark....with $20 handling fee!

Any recommendations for a more conventional op-amp that would suit? I would need a linear 0-5 volts for the AD from 0-500 mA current across the shunt resistor.

I've done this for high power medical and commercial amps.

First of all, you do not want to use a higher voltage shunt!!!!! That is a disastrous idea for many reasons. You really must keep the actual shunt in the millivolt range.

You will not have good stability and terrible linearity with an optical coupler.

Anytime I've done this I've used an op-amp with stable resistors in the feedback circuit. It has to be very well shielded, protected for fault voltages, and RF bypassed. This all requires you know how to handle RF and systems under severe fault. You especially do not want to bring any wires out of the amp that might fly up to a few hundred volts or higher if a tube arcs.

I'd bring the meter leads out of the amp through a decoupled system with diode fault clamps, filter it at the exit point from the cabinet (ground reference has to float also!) and use an external op-amp system out where things are tame. That means 50 mV to perhaps half a volt full scale depending on the present meters.

The op-amp system has to be very high input impedance so you don't load down the metering circuit.

Once you get outside the PA section with the voltages (even when they are low), things are really easy.

You could add additional shunts and multipliers for the external output, but as a general rule you never want to go over 1 volt FS on a shunt. You can really get into problems if you do not understand the impact on the extra voltage drop.

I've dealt with 50 mV FS and never had any major problems. There is no reason why a cheap op-amp won't work. Just get something with a low offset. Even an LM358 will work.

73 Tom

W3DRK
11-01-2010, 05:09 PM
First of all, you do not want to use a higher voltage shunt!!!!! That is a disastrous idea for many reasons


I think you misunderstood. I'm not looking for 0-5v from the shunt, I'm looking for 0-5v from the op amp. If I could get 0-5v from the shunt without the negative side effects, I wouldn't need the op amp. ;)



You will not have good stability and terrible linearity with an optical coupler.


Ok, noted!



Anytime I've done this I've used an op-amp with stable resistors in the feedback circuit. It has to be very well shielded, protected for fault voltages, and RF bypassed. This all requires you know how to handle RF and systems under severe fault. You especially do not want to bring any wires out of the amp that might fly up to a few hundred volts or higher if a tube arcs.

I'd bring the meter leads out of the amp through a decoupled system with diode fault clamps, filter it at the exit point from the cabinet (ground reference has to float also!) and use an external op-amp system out where things are tame. That means 50 mV to perhaps half a volt full scale depending on the present meters.
The original meter is being replaced with an LCD screen, so the shunt resistors can be whatever best suits the new circuit. While running the AD sample rate flat out (somewhere around 100KHz if I recall) and using 10-bit oversampling I've been getting some REALLY smooth and responsive bar graphs, the LCD just can't keep up. ;) I would like to eventually use either an OLED or VFD dot matrix display, both of which are plenty fast to replace the old analog meter.

My plan is to house everything in a sealed and grounded metal box inside the amp with everything choked and decoupled. I am planning to use back-to-back diodes across the shunt resistors to protect the electronics in the event of an arc, which also restricts the shunt voltage to under half a volt. Do you think it's really necessary move the electronics outside the amp? This is a small GLA-1000 amp I rebuilt and I'd like to keep the tiny footprint.


The op-amp system has to be very high input impedance so you don't load down the metering circuit.

Once you get outside the PA section with the voltages (even when they are low), things are really easy.

You could add additional shunts and multipliers for the external output, but as a general rule you never want to go over 1 volt FS on a shunt. You can really get into problems if you do not understand the impact on the extra voltage drop.

I've dealt with 50 mV FS and never had any major problems. There is no reason why a cheap op-amp won't work. Just get something with a low offset. Even an LM358 will work.

73 TomThanks Tom!

AF6LJ
11-01-2010, 05:20 PM
Sounds good, I prefer analogue meters myself ether way you can easily read and display peak currents.
When this gets old hat you can work on automatic band changing, after that auto-tune.

W3DRK
11-01-2010, 05:56 PM
If I could fit both the analog meter and the digital display I would. But this little guy is so small, it's one or the other.

A 70s linear amp refitted with a Russian military surplus tube and a USB port on the back is just cool.

By the way, all of this started because I forgot to turn the drive down to 40 watts before using the amp the other day. I accidentally drove 100 watts into the poor little GI-7B and after some nasty arcing the fuse blew before I had a chance to take my finger off the key. I thought for sure the GI-7B was a goner. Nope! It still works like new. What a tough little tube, and I suppose the glitch protection probably helped too.

Now in addition to grid and plate over current protection I'll have a slew of other nifty features not easily accomplished with discrete components. Maybe not practical but certainly educating.

By the way, here are some pictures of the converted amp. These are early on before I had the Is dotted and Ts crossed, but it's been a great little amp since the conversion with a solid 550 watts output 10-80 meters when operated SSB.

AF6LJ
11-01-2010, 05:59 PM
Nice work.

There are some space restriction issues there...
:)

W3DRK
11-01-2010, 06:10 PM
I should have plenty of space between the power supply and front of the unit once the analog meter is out of there. I wish I would have designed that voltage doubler PCB a little smaller but oh well. I could always hug the equalizing resistors closer to the board but I like to keep that heat away from the caps.

I should only need a few square inches to fit the logic PCB. I'll just have to size the metal RF shield enclosure to fit first. I have a bunch of sheet copper I'll be using for that. Once I know those dimensions, I can design the PCB to match.

The real challange will be fitting the Jennings vacuum relays back where the old open frame one is. ;)

KF5FEI
11-01-2010, 06:17 PM
Somewhere around here I have a box of voltage muliplier rejects from a theatrical lighting company -- they boosted 300+ volts way up to ignite some really big HID lights. Lots of good HV parts.

KE3WD
11-02-2010, 03:22 PM
Opamps configured as Gain and Offset, adjustable.

Use Integration (small cap across negative feedback resistor) techniques to filter out RF.

The ubiquitous 741 or any of its equivalents should work as well as anything else.

Place a 5.1V zener across the output as ultimate protection for the A-D or whatever.

73

W8JI
11-04-2010, 12:21 AM
I think you misunderstood. I'm not looking for 0-5v from the shunt, I'm looking for 0-5v from the op amp. If I could get 0-5v from the shunt without the negative side effects, I wouldn't need the op amp. ;)

Unless I misread, someone else suggested that. As you already know, 5V shunts are not workable.




Ok, noted!

The original meter is being replaced with an LCD screen, so the shunt resistors can be whatever best suits the new circuit. While running the AD sample rate flat out (somewhere around 100KHz if I recall) and using 10-bit oversampling I've been getting some REALLY smooth and responsive bar graphs, the LCD just can't keep up. ;) I would like to eventually use either an OLED or VFD dot matrix display, both of which are plenty fast to replace the old analog meter.

One of my best improvements to amps was to add permanent grid current meters, and switch the less important plate current and HV meter function on a multimeter.

If I were to ever do another tube type amp, which seems unlikely, I would make the plate current and grid current meters peak reading meters.

I personally don't like digital metering.



My plan is to house everything in a sealed and grounded metal box inside the amp with everything choked and decoupled. I am planning to use back-to-back diodes across the shunt resistors to protect the electronics in the event of an arc, which also restricts the shunt voltage to under half a volt. Do you think it's really necessary move the electronics outside the amp? This is a small GLA-1000 amp I rebuilt and I'd like to keep the tiny footprint.

If you understand how to bypass and shield... inside the amp is fine. Careful with chokes. Resistive mix beads are better with multiple turns, like 73 mix or similar.

73 Tom

ad: chuckmartin