Author Topic: hall effect revisited again  (Read 3495 times)

0 Members and 2 Guests are viewing this topic.

Rover

  • Hero Member
  • *****
  • Posts: 788
hall effect revisited again
« on: May 04, 2009, 09:50:15 PM »
Now that I've seen what the shunts do... I'm happier with the amploc hall effect sensors I was using.


I plan.. and this could be totaly wrong .. remember I'm a programmer first.


1. Use 100 amp amploc amp 100 sensors, they output with a Vs/2 zero, so as I plan to use a 5 volt supply, anything above 2.5 V is forward, no problem


But I'd rather have it hit the ADC at 0 to 4.096V (ADC limits) or even 0 to 5V. I just don't know how to do it. I think it will involve an op amp and a differential circuit (subtractor).. but I'm clueless.


Anyone feels like drawing up a schematic with named op Amp and resitor values.. I'd be appreciative.


Other details:

- The sensor is a closed Hall effect sensor that I plan to loop once over bringing the sensitivity up at the cost of top end. I'm not looking at more than 50 amps.

-The Sensor has a 2 mA max out (single out, no ref)


Any Help Appreciated.

« Last Edit: May 04, 2009, 09:50:15 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

willib

  • SuperHero Member
  • ******
  • Posts: 2414
  • Country: us
Re: hall effect revisited again
« Reply #1 on: May 04, 2009, 04:12:54 PM »
what 12 bit ADC are you going to use?

The Vs/2 => zero , is so that you can detect the current going in both directions as you probably know , ya dont want to use that feature?

Might come in handy !

Bill

.
« Last Edit: May 04, 2009, 04:12:54 PM by (unknown) »
Carpe Ventum (Seize the Wind)

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #2 on: May 04, 2009, 04:17:55 PM »
I'm using a Dallas/Maxim max186  8 channel 12 bit... already in place doing other stuff. I'm really not interested in reverse current (Yes i know might be usefull), but I have 4 circuits I want to monitor ( and actaully am at this point, just with changes in sensors) http://www.rovr1.com/wind/windsolardata.html.


Rathr have the best fidelity in one direction and use the entire voltage range of the ADC.


My choice of the amploc 100's is based on my prior use of them.


Thanks for the input

« Last Edit: May 04, 2009, 04:17:55 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

commanda

  • Hero Member
  • *****
  • Posts: 731
Re: hall effect revisited again
« Reply #3 on: May 04, 2009, 04:25:25 PM »
Looking at the datasheet, it is 19mV/A, so 100 amps is 1.9 volts.  So zero amps at 2.5 volts, plus/minus 1.9 volts gives an output range of 0.6  to   4.4 volts.  I would have thought that with a 10 bit or better ADC working from 0 - 5 volts that that would have been sufficient.


Of course, if the ADC has external VrefLo & VrefHi, setting these to 0.6 & 4.4 volts respectively would give back your full count range.


A 10 bit ADC, with a 200 Amp (+- 100) input range, would give 1023/200 = 0.1955 amps per count.


Limiting the input range to +
- 1.9 volts (= 3.8 volts) on a 5 volt scale 10 bit ADC, would give 3.8/5  * 1023  = 777 counts (rounded down slightly).  This would give 777/200 = 0.2574 amps per count. A resistive divider to drop the ratio slightly, and give a count of (say) 0.26 amps per count would make the programming easier.


If you really must get the full 0 - 5 volts range, you will need to use rail to rail opamps, and a circuit similar to this one:


http://www.fieldlines.com/story/2009/4/12/224245/465


Amanda

« Last Edit: May 04, 2009, 04:25:25 PM by (unknown) »

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #4 on: May 04, 2009, 04:34:57 PM »
Thanks Amanda, I had dug up your circuit earlier.


Outside of the full tange of the ADC which is 0 t 4.096  (I can live with 0 to 5 programmatically). I gues the other thing was to be able to trim to 0 electro/mechanically possibly with a pot or 2.  If I use a divider it has an effect full range.


Basically.. I want to be able to 0 the hall effect, scaling to the width of the ADC input ia (as you posted) artificial since I'm looking at 1.9v .


I might just be better off taking it in full range of the full 1.9 (wich will be 0 to 50 amps ) since I'm looping


thoughts? and I can be wrong... blast as needed

« Last Edit: May 04, 2009, 04:34:57 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #5 on: May 04, 2009, 04:46:15 PM »
As an added note, you had posted earlier (on one of my previous posts on my unhappyness with halls) , that I may be getting RF interference from my 912 mhs transmitter, or other filtering needs


- The transmitter is seperated by about 10 ft of rj11 , and connected directly to the micro ... it is not co-localized.. but that could be meaningless.


-I also plan to use an isolated 5 volt switching supply (not linear) to power the amplocs...(The ADC and the micro have a common supply)

« Last Edit: May 04, 2009, 04:46:15 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

willib

  • SuperHero Member
  • ******
  • Posts: 2414
  • Country: us
Re: hall effect revisited again
« Reply #6 on: May 04, 2009, 05:11:42 PM »
« Last Edit: May 04, 2009, 05:11:42 PM by (unknown) »
Carpe Ventum (Seize the Wind)

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #7 on: May 04, 2009, 05:22:34 PM »
Thanks Will I should have posted those earlier
« Last Edit: May 04, 2009, 05:22:34 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

willib

  • SuperHero Member
  • ******
  • Posts: 2414
  • Country: us
Re: hall effect revisited again
« Reply #8 on: May 04, 2009, 05:43:59 PM »
Since the range of your ADC is larger than the expected output from your sensor , why not deal with it in software?

example..a reading of half scale on the ADC is 2048 , which corrosponds to 2.5Vdc on the input..

a 2.5V dc output from your sensor is equal to zero current.

so anything above 2048 and less than 4096 will be 0 to 100 Amps , which is 20.48 = ~ 20 full steps per Amp. I think.

Thats not bad!

could be a lot worse..

Bill

« Last Edit: May 04, 2009, 05:43:59 PM by (unknown) »
Carpe Ventum (Seize the Wind)

boB

  • Sr. Member
  • ****
  • Posts: 389
  • Country: us
    • boB
Re: hall effect revisited again
« Reply #9 on: May 04, 2009, 06:53:38 PM »


Measuring DC current can be a real bitch !   It's not easy.


Shunts have their problems and are not isolated and Hall effect sensors and the like

are sensitive to external magnetic fields as well as other problems with the toroid

you need to use to concentrate the flux.


Looks like that circuit in the old thread is just about as complicated as a shunt

amp circuit and you still need the offset and gain adjustments.


And, after you're done building the circuit etc, use a hair dryer (or similar) to

make sure it doesn't change much with temperature.


boB

« Last Edit: May 04, 2009, 06:53:38 PM by (unknown) »

commanda

  • Hero Member
  • *****
  • Posts: 731
Re: hall effect revisited again
« Reply #10 on: May 05, 2009, 01:09:42 AM »
I've got 2 current sensors. Both use a UGN3503 hall effect sensor mounted inside a slit in a toroid, with several turns of wire around the toroid. They both use the amplifier circuit I posted a link to earlier in this thread. The output is unipolar (goes from zero to 5 volts, and measures current in one direction only). The micro is a Picaxe 28X1, with 10 bit ADC's.


Overall, I am not happy with the current sensors. Especially zero. It drifts with stray magnetic fields; even putting a small screwdriver near it to adjust the pots is enough to change the reading. I suspect it also drifts with temperature, although I haven't done the hair dryer test yet. I'm considering mounting the toroids inside some steel RHS as a Faraday cage to try and mitigate the stray magnetic fields problem. I also suspect that the unipolar nature of the current flow is actually magnetising the toroid.


But I did pick up a pair of 50 amp current shunts, and will do away with the hall effect sensors in due course.


I think if you're aiming for 12 bit resolution, you may be sorely disappointed.

Just the view from here.


Amanda

« Last Edit: May 05, 2009, 01:09:42 AM by (unknown) »

scottsAI

  • Hero Member
  • *****
  • Posts: 884
Re: hall effect revisited again
« Reply #11 on: May 05, 2009, 02:22:59 AM »
Rover, Circuit you requested is simple:


Its late so will try this quickly. (never is)


ONE opamp. Verify opamp output can drive to GND.

Input not going near ground so RR (rail to rail) type is not necessary except for output.


Hall output to R1 to neg input of opamp.

Opamp output to Rf to neg input of opamp.

Gain = 1 + Rf/R1 (actually negative gain, feed current in opposite direction).

Rf can be a POT to adjust the gain. Your gain is below 4, right?

Select the resistors large enough not to excessively load the sensor, yet not too large to be influenced by stray currents, in other words below 100k, 10k looks good for input resistor.


Opamp pos input connect two resistors, Vdd to input and Gnd to input.

Resistors are a Voltage divider (sets zero point), can be a 200K ohm 10 turn POT, zero adjustment. (single turn with two fixed resisters works)


Remember the ADC has its own reference, the Hall sensors output is ratiometric to ITS supply.

To accurately measure current, you must measure Hall's Vdd and adjust by any changes.

Better to drive ADC reference and Halls from the same single supply. Any changes thus cancel. DO NOT use an isolated supply to drive the Halls.


That's it. Going to bed, if you have questions...


Have fun,

Scott.

« Last Edit: May 05, 2009, 02:22:59 AM by (unknown) »

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #12 on: May 05, 2009, 04:22:26 AM »
Grin, think we have done the same thing. I started out with 4 hall effects, then 4 shunts, now I'm going back to the halls.


My initial work with hall sensosrs (zap25s from Amploc) was a little sloppy, lack of filters etc. I zeroed in software.


Why going back to halls, yea I saw drift at 0 with them, maybe a 100 mA or so, looked like it was temperature related.  The shunts in my configuration with the ADC seem to fare worse as far a zero.


With amplocs zap25s I saw very little effect, if any, from  magnetic field interfernce, the units seem to be well shielded.


I'm also thinking my ADC might have played a small role in variance, since I saw most of the drift below 0c/32F , and after re-reading the specs on the ADC, the operatng temperature is 0 - 70c. I have 2 new ones on the way that operating range starting at -44c. (The ADCs are free)  

« Last Edit: May 05, 2009, 04:22:26 AM by (unknown) »
Rover
<Where did I bury that microcontroller?>

GWatPE

  • Newbie
  • *
  • Posts: 48
Re: hall effect revisited again
« Reply #13 on: May 05, 2009, 08:10:14 AM »
The use of Hall effect devices for current measurement and the interfacing to microprocessors can be easily performed with a cheap micro and no op amps and no trimmer pots.  The PC programmer is used to set up the program calibration in cct, from readings measured.


I have used an Allegro hall effect current sensing device.  -50A to +50A 5V supply with 2.5V, 1/2 rail output for zero amps.  I use 1 ADC input, 10bit resolution of a PICaxe08M micro.  This micro has a PWM totem pole output that can be filtered to give 10bit resolution analogue output from 0 to 5V.  The code in the micro zeros the half rail output and span adjusts.  The micro can digitally average as well, prior to PWM conversion and output filtering.  The 0-5V output can be directly interfaced to the micro.  Useful for logging applications, but probably not for real time controls.


In ccts with current shunts the PWM signal can also be passed through opto couplers, giving galvanic signal isolation in noisy environments, and allowing multiple current measurements from high sides of a cct to be measured by a common micro, without problems with ground loop errors.


10bit resolution is OK for most logging applications.


Gordon.

« Last Edit: May 05, 2009, 08:10:14 AM by (unknown) »

BigBreaker

  • Sr. Member
  • ****
  • Posts: 302
Re: hall effect revisited again
« Reply #14 on: May 05, 2009, 10:28:47 AM »
The Faraday cage is a good idea and simple but it doesn't stop a constant magnetic field, only a changing one.


You could also use two sensors side by side but reverse the sensor connections and the direction the wire is wrapped around the core.  Stray fields would have the opposite effect on the pair and so the average of the two sensors would be free of any stray field even if the field was constant.

« Last Edit: May 05, 2009, 10:28:47 AM by (unknown) »

scottsAI

  • Hero Member
  • *****
  • Posts: 884
Re: hall effect revisited again
« Reply #15 on: May 05, 2009, 11:35:10 AM »
Rover,


The wider temp parts will not work any different.

Semiconductors are cheaper with less testing.

So, the cheap parts are not tested below 0C.

Same die inside.

Yes, there can be some spec not met since it was not tested.

Unless the devices yield is very low ($) or the package is different in some way. Not likely you will see any difference.


I believe in your situation you saw a lower temperature drifting because ADC ref is different from Halls Vdd, accuracy will suffer greatly if goal is 12 bits. Covered this in my post #11.


Halls Vdd is most likely a 2 to 4% voltage regulator? As temperature changes its output will change. The mid point voltage will change (zero point changes). The ADC has a good reference, better than the regulators. With temperature changes the two will NOT drift together resulting in changes in readings.


Have fun,

Scott.

« Last Edit: May 05, 2009, 11:35:10 AM by (unknown) »

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #16 on: May 05, 2009, 02:58:07 PM »
I'm thinking you have a good case concerning the power supply, although I'm using a switching supply http://www.dimensionengineering.com/DE-SW050.htm, it is powering the stamp, the transceiver, LCD display, separate RTC, the hall effect sensors and the ADC. I have about a 4ft wire run between the power supply and the halls/ADC using rj45 to carry the voltage and signal lines.


So it comes down to how stable I can make the Halls power supply. I wonder If I shoud use a separate power supply for the Halls and ADC . I know I will still have variance due to the internal ref of the ADC.

« Last Edit: May 05, 2009, 02:58:07 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #17 on: May 05, 2009, 03:01:58 PM »
FYI the link has a comma at the http://www.dimensionengineering.com/DE-SW050.htm on my prev post use this one.


Also I meant one supply for the halls/ADC combined .. different from the stamp etc.

« Last Edit: May 05, 2009, 03:01:58 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

Ungrounded Lightning Rod

  • SuperHero Member
  • ******
  • Posts: 2866
Re: hall effect revisited again
« Reply #18 on: May 05, 2009, 04:41:35 PM »
In a toroid with a few turns of the current you're sampling, eh?


How about getting the gain and offset of the sensor out of it by using a feedback loop as follows:


 - Put a WHOLE BUNCH of turns of fine wire on the toroid in addition to the signal you're sampling.  (Like 1000x times the number of turns of the sensed wire, for 1 ma per amp.)

 - Drive a current through that from a D->A output of the chip.

 - Have the program adjust this feedback to bring the output of the sensor back to the value you get if you disconnect the input circuit.


Think of it as an op-amp circuit with the summing junction being the mag field in the toroid rather than the voltage on an op-amp's inputs (or currents into a current-mode op-amp's inputs.)


This will "tune out" all the screweyness of the sensor - gain, linearity, offset, ...  (You'll still have sensitivity to background fields, like the Earth's.  But you can include those in the calibration of what constitutes zero, too.)

« Last Edit: May 05, 2009, 04:41:35 PM by (unknown) »

Ungrounded Lightning Rod

  • SuperHero Member
  • ******
  • Posts: 2866
Re: hall effect revisited again
« Reply #19 on: May 05, 2009, 04:53:35 PM »
Thought about trying to chopper-stabilize that (since you're measuring DC) and realized that you might be able to do it by saturating the toroid, in a manner similar to a flux-gate electronic compass/magnetometer.


You'd probably want to use two toroids with separate excitation to cancel out most of the coupling of the high-frequency excitation current into the signal you're trying to measure, but it would still be doable.  You'd want to use thin toroids so you don't end up burning a bunch of power driving them in and out of saturation.


Who needs the hall effect?  B-)

« Last Edit: May 05, 2009, 04:53:35 PM by (unknown) »

scottsAI

  • Hero Member
  • *****
  • Posts: 884
Re: hall effect revisited again
« Reply #20 on: May 05, 2009, 05:59:39 PM »
Rover,


Things are not as bad as they may seem. Bit of tweaking it can work.


Use spare ADC channel to measure Vdd, if it changes then you have verified issue.

Measuring differential signals can help.


The MAX186 supports external Vref up to Vdd. So use it.

If other measurements require absolute precision, make ADC Vref switchable. Common thing to do.

Actually most micro's have 10bit ADC on them, by over sampling ENOB (search on it) can be increased.


Nothing wrong with switching supply if filtered correctly.

Use the twisted pairs in RJ45, Power / Gnd one pair, signals with ground other pairs if possible. If not keep digital together.


OK to use all on same supply if done right. 12 bits is difficult, not impossible. I have gotten 12 bits to work in a production vehicle environment. Sold 2 million 12 bit ADC!


Have fun,

Scott.

« Last Edit: May 05, 2009, 05:59:39 PM by (unknown) »

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #21 on: May 05, 2009, 06:54:34 PM »
Analog and Dig split out on the cat5 , so you see no problems with me running a separate supply for the ADC/halls.. nice part is it would mean removing the analog portion from the cat5
« Last Edit: May 05, 2009, 06:54:34 PM by (unknown) »
Rover
<Where did I bury that microcontroller?>

scottsAI

  • Hero Member
  • *****
  • Posts: 884
Re: hall effect revisited again
« Reply #22 on: May 05, 2009, 09:04:41 PM »
Rover,


I do not understand your system architecture.

Why the 4 ft of cable ect.

I recommend using ONE power supply for everything.

Many problems with using multiple supplies, simple things like which gets turned on first. Or how closely they must ramp up etc.

Isolated systems are needed when a large voltage difference exists etc.

Hall sensors give you isolation, more is not needed.

Many reasons to do a thing, lets make sure its for the right ones.


Not sure what I said to drive you post??


Have fun,

Scott.

« Last Edit: May 05, 2009, 09:04:41 PM by (unknown) »

Rover

  • Hero Member
  • *****
  • Posts: 788
Re: hall effect revisited again
« Reply #23 on: May 06, 2009, 04:17:22 AM »
My fault on not being clearer, Single 12 volt supply going to 5 volt reg. What I meant was a another 5 volt reg for the sensors/ADC. The 4 ft cat5 is used to connect the microprossor(in its own box) to the sensors(in their own box with the ADC). The reason for the separation is to be able remove the micro easily to bring it inside for programming changes.
« Last Edit: May 06, 2009, 04:17:22 AM by (unknown) »
Rover
<Where did I bury that microcontroller?>

scottsAI

  • Hero Member
  • *****
  • Posts: 884
Re: hall effect revisited again
« Reply #24 on: May 06, 2009, 04:36:14 PM »
Rover,


PIC can be programmed in circuit, serial... no need to bring in?

USB programming or Serial link, many ways to remotely program.

30 to 50' range, add RJ45 interfacing 100's of feet capable.

USB is rated for 15', add two hubs 45'. Not gone past 30' myself.


Hall Sensor

The remote part? With twisted pair should good for 10's of feet.

Add a differential amplifier (at sensor) should drive signal many 10's of feet cabling.

(Power/gnd pair, diff sig second pair)


Have fun,

Scott.

« Last Edit: May 06, 2009, 04:36:14 PM by (unknown) »