Hello, I just moved this from the software forum - sorry about the post there:
I wish to measure current draw on a 35 amp power supply at 15 vdc. I think I could take the voltage thru a voltage divider into two analog pins, then take the difference to determine the voltage drop across the sensing resistor and this would work.... I think.
Would it be a LOT better to use the LT1494 current sensor chip and use only one analog pin? I do have plenty of spare analog pins, so using the extra analog pin is not an issue. The LT1494 chip is less than $4 each from DigiKey so the expense is not really terrible, but if not needed I'd rather use just the arduino.
Are there any big advantages to using the LT1494 chip over bringing voltage direct into the Arduino?
You are measuring current so it has do be converted to a voltage for the Atmega
A/D converter. You will need to use an analog pin or attach an external A/D
converter.
Rather than a LT1494 you may be better off with a current sense amplifier which
is optimized for measuring current. IIRC Linear Tech, ADI, Maxim all make current
sense amplifier ICs.
Thank you for the response jcl - just today I found the ACS758 current sensor and ordered one. These are 50 amp min so it's just right for my power supply now. At $5.88 cost wasn't too bad.
Perhaps I wasn't real clear on my question, but when I mentioned bringing "voltage into Arduino analog pin" - I was referring to the voltage drop across a current sensing resistor. This normally provides from 50mV up to a few hundred mV depending on resistance used and amp load.
In an effort to keep cost down I was hoping for that approach, but those current sensors sure are neat! 4,000 mV at 50 amps will give good resolution.
Typical current shunts are 50mV at the rated current so you need some sort
of amplification. You could also use an instrumentation amplifier. The AD623
is a great part -- single supply, DIP package.
I am not sure that you could get an accurate amplification (for a current shunt)
for less than $5.
I just looked at the AD623 part, that does look like a nice chip - AND it's available in SOIC package - since I've been working with SMD parts I like those better than thru-hole.... most of the time anyway. Some chips are better in DIP form when a socket is needed.
Take a look at the following link for the ACS758LCB-050B-PFF-T - Hall Effect IC and see what you think of it.
I agree with you on the SMD parts. With the proper tools assembly goes a lot quicker.
The ACS758LCS-050B-PFF-T looks like an easy way to measure current.
Everything integrated in a single package.
I am not sure of your accuracy requirements and I didn't look into the details
of the accuracy of the sensor. At 40mV per Amp and 35Amps you are 1.4Volts.
If you can get the fullscale of the sensor to match the fullscale of the ADC you
will get more accurate readings.
Darn!! That just clicked after reading your comment about 1.4 volts at 35 amps - that is correct. I was thinking 4,000mV at 50 amps, but that is NOT true. The range ±50 amps that is -50-0-+50 amps with only 2,000 mV from 0 to 50 amps.
I wonder about using a divider to make the 1.4 vdc into 1vdc for the arduino? That would allow using the INTERNAL analogReference of 1.1 volts - would that be better than bringing the 1.4 volts into a 5 vdc reference? Also less parts and expense of adding another chip for amplifying.
I will be bringing the voltage from one side of the chip to the arduino thru a voltage divider to drop from 15vdc to 5 vdc. That was the reason for my question on the software forum about using difference values for the analogReference - INTERNAL for current voltage, and DEFAULT for +5vdc voltage?
Thanks for your following the thread and guidance.
I forgot that this devices senses bipolar currents. For +-50A you would have +-2V or
a span of 4V.
I am not sure about the bipolar offset. Would the signal be 0V for -50A, 2V for 0A
and 4V for 50A? Or would the signal be centered based on the Vcc of the sensor.
If you aren't sure you may want to check an application note.
With a 4V span (or a 2.8V span) you could just use the Vcc as the A/D reference.
You need to be careful of resistor dividers on the input to the Atmega uC A/D
converter. The ADC input is optimized for a analog signals with an output
of 10KOhms or less. If you increase the impedance you will need to adjust
your sampling times.
I have read thru the datasheet a couple of times and it still is not clear how they are handling the mV signal. Does it start at zero mV for -50 amps with 2,000mV at zero amps? I'm just not sure on that one. I expect it will be easy to figure out once the chip gets here
Good point on the voltage divider - I am using a 10K total which puts about 7K in series, then 3K to ground.... or is it other way around?
Where I do need to increase sampling times - how is this done?
The analogRead I'm using is something on the order of:
for (int i = 0; i < spantemp; i++) // spantemp = 20 for an average of 20 reads per calculation.
Thank you again for all your input and assistance to this old man.
I am not sure about the Arduino instructions for changing the ADC registers.
I usually just set the registers directly. If there are no Arduino instructions
check the uC datasheet for the register assignments.
If you end up with the divider you have now your impedance is 7K || 3K so
you are fine.