Shop OBEX P1 Docs P2 Docs Learn Events
Using the Allegro Part # ACS755 Current Sensor..UpDate I am using a LM385---- 2 — Parallax Forums

Using the Allegro Part # ACS755 Current Sensor..UpDate I am using a LM385---- 2

sam_sam_samsam_sam_sam Posts: 2,286
edited 2008-03-04 02:09 in BASIC Stamp
Hi, Every One

Here is the Link to what·I want to use in a up coming up project for the New Year

http://www.allegromicro.com/en/Products/Part_Numbers/0755/index.asp

What·I like know·which ADC should·I use for this project

I want to have is high resolution· so which Basic Stamp··should·I use and which ADC

I have the following ·BS2, BS2pe, [url=mailto:BS@sx]BS2sx[/url]

Now i look at the data sheet and it talk·about chip temperature error how do·I compensate for this in a code routine



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 3/4/2008 2:16:34 AM GMT

Comments

  • phil kennyphil kenny Posts: 233
    edited 2007-12-22 06:47
    In order to select an appropriate ADC, we need some idea of
    the accuracy, resolution and samples per second that you are
    expecting in the data.

    Did you notice that the data sheet only specifies a 'Typical' error
    of 1 percent at 25 deg. C? The limits on maximum and minimum
    error aren't given. Then there is the linearity spec of +/- 2.8
    percent.

    My impression of this device is that you _might_ be able to calibrate
    the output to obtain 1 percent accuracy at room temperature. That
    means that an 8-bit ADC would be a good match and will give you
    a resolution of 0.5 percent in the output data. A ADC with more bits
    won't give you more accurate data. Just more digits that are in error.

    Compensating for temperature effects in code is a major problem.
    You'll have to characterize how each part behaves at different current
    levels over the temperature range of interest.

    ADCs with serial inputs (SPI) are easiest to interface to the Basic
    Stamp. all three of the Stamp models you listed have this ability.

    Which Stamp to use will depend on how fast you want to capture
    readings, code space used, etc.

    phil kenny

    Post Edited (phil kenny) : 12/22/2007 6:49:30 PM GMT
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-12-22 20:05
    phil kenny

    Thank You for your reply

    We need some idea of the accuracy,············· ·+ or - 5%

    ·resolution·············································· · 00.0 Or what would· nice·is 00.00

    ·and samples per second···························· ·1 to 4 Or what i can get

    that you are expecting in the data.

    Do you think that what i have above will work with an 8 bit ADC ...>>>>>

    >>>....That means that an 8-bit ADC would be a good match and will give you
    ········· a resolution of 0.5 percent in the output data.


    >>>>>......Then what i think i want to do is on the LCD display a TEMP
    ··············· is over may not be right message this would let me know that reading may be of a litte.....>>>>

    Compensating for temperature effects in code is a major problem.
    You'll have to characterize how each part behaves at different current
    levels over the temperature range of interest.


    ·

    ·
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 12/22/2007 8:13:53 PM GMT
  • phil kennyphil kenny Posts: 233
    edited 2007-12-22 21:53
    Sam,

    From what you described regarding your requirements, the 8-bit
    ADC0831 should work just fine along with the BS2 stamp. Monitoring
    the ambient temperature and displaying it will help guide you in
    determining how much to trust the ADC readings.

    You didn't mention what your maximum current level will be.

    The lowest rating Allegro part is 50 amps full scale. If that is
    the maximum current you'll be measuring, then achieving +/- 5
    percent is certainly reasonable at room temperature.

    However, if your maximum current is 5 amps, then you are only
    using 1/10 of the full scale output and getting the 5 percent
    accuracy won't be possible.

    The sensitivity of the 50 amp Allegro part is only 60 mv/amp.
    If the maximum current you expect is 5 amps, this will only
    produce 300 mv at the current sensor output. The ADC 0831
    has a 5 volt reference and 256 counts full scale. Therefore,
    each count represents about 20 mv. That will only generate 15
    counts for a 5 amp current.

    Information on your expected full scale current is needed to
    go further.

    Note that for zero amps in, the output voltage from the Allegro
    part is 0.6 volts TYPICAL. They don't guarantee any set
    value for this offset. Applying several calibrated currents from
    zero amps to the maximum you are expecting and noting
    the ADC readings will give you further confidence in the results.

    It might also be worth while putting a low pass filter between the
    Allegro current sensor output and the ADC 0831 input. This will filter
    out any high frequency noise in the current. A simple R-C network
    will work fine and give more stable ADC readings.

    phil

    Post Edited (phil kenny) : 12/22/2007 10:43:53 PM GMT
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-12-23 04:10
    phil

    I want to Thank You·for·bring up the Points that you did
    I did not think about all of what you have point out

    ·A simple R-C network will work fine and give more stable ADC readings.

    Is this with a ADC 0831 chip or is this by it self

    Thank You For ALL of Your Help



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • phil kennyphil kenny Posts: 233
    edited 2007-12-23 05:42
    Sam,

    The filter is located between the Allegro output pin and the ADC input pin.

    If you use an Op Amp to condition the signal before feeding it to the ADC 0831,
    then put it at the Op Amp input.

    See the attached sketch.

    phil
    706 x 447 - 185K
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-12-23 06:08
    I used an ADC 0809 with the same current sensor you describe. Attached is a schematic of the circuit I used, and here is the link:

    system.windows.codeslinger.googlepages.com/motorcontroller2

    I also used a 74151 two reduce the number of I/O lines I had to use to read the data.

    Phil I believe you are mistaken about the Allegro current sensor outputting .6 volts when there is no current. Not so! It outputs 2.5 volts at no current. This is because the sensor can detect forward or reverse current, so a forward current makes the output more then 2.5 volts, while a reverse current makes the output less than 2.5 volts. If it used close to zero volts to represent no current, then it would have to go below ground to represent reverse current, and clearly that wouldn't be practical. So Allegro set it at 2.5 volts which is exactly between 5 volts and ground.

    As Phil mentioned the sensitivity of the device is based on 50 amps, so smaller currents even of 5 amps will not get a great precision in the ADC. However, there is a way to get the full 8 bit resolution with a smaller range of the current. The ADC 0809 provides a Vref+ and Vref-. If you set the Vref- to just under 2.5 volts, the Vref+ to just a little over it (such as 3.0 volts) then you can effectively "squeeze" the entire 256 steps of resolution into a smaller range of voltages, thus getting a magnified view of a smaller window of voltage. The drawback is that you will also go out of range of the ADC if you measure more than 10 amps (with settings of 2.5 and 3.0). But you will not damage the ADC if you do.

    I didn't manipulate Vref+ and Vref- to my advantage in my circuit because I am also measuring other things which don't require the same ranges, but I could get more precise readings if I did.

    Note that even if you are able to read the current sensor with more precision, it may not be more accurate. But just calibrate it with known currents and you can compensate for most of the accuracy errors.

    Also note that you must provide a clock for the ADC. In my circuit I was able to provide the clock using the Spin Stamp, but the Propeller has multiple processors and can do a lot at once. If you are using a Basic Stamp you wouldn't be able to both provide a clock signal and read the data at the same time, because the Stamp can only do one thing at a time. You also can't do it by signaling the clock and very quickly switching in PBASIC to the data read and then switching back to the clock, because the ADC won't work reliably at low clock speeds, as I found out by trial and error. But if you simply add a 1 MHz oscillator, you can generate the clock.

    Or, use a newer I2C A/D converter chip, but just make sure it has the Vref+ and Vref- pins on it, and you can use them the same way as the ones on the ADC0809.
  • phil kennyphil kenny Posts: 233
    edited 2007-12-23 07:42
    Hi Dennis,

    Your description of the Allegro chip behavior for zero input current
    makes sense. Since you have direct experience with the device,
    I must have misinterpreted the data sheet.

    Also, the suggestion about modifying the reference voltage inputs is
    a good one and it is an easy way to change the effective sensitivity.

    phil
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-12-23 16:09
    Thanks phil. You made some good points in your post, and I wouldn't have even remembered that you could do that with the Vref otherwise.
  • metron9metron9 Posts: 1,100
    edited 2008-01-08 04:24
    Somebody said...
    Phil I believe you are mistaken about the Allegro current sensor outputting .6 volts when there is no current.
    I just received samples of the Allegro part ACS755SCB-050

    The data sheet does say "Zero Current Output Voltage 0.6V"

    Using 5V supply I measure .600V. With 500mA (applied with a seperate battery supply) load I measure .632 "Sensitivity 53mV to 65mV per AMP" is shown on the data sheet so that is right on the money.

    Perhaps you are talkiong about a different part?





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-01-09 18:18
    Hi Every One

    The data sheet talk about temperature error say something 11%· maximum
    but is @ 25c or it that at the· maximum··temperature· or what

    I would like to know that· %· maximum temperature error

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • phil kennyphil kenny Posts: 233
    edited 2008-01-09 19:29
    sam_sam_sam said...
    Hi Every One

    The data sheet talk about temperature error say something 11% maximum
    but is @ 25c or it that at the maximum temperature or what

    I would like to know that % maximum temperature error

    Hello Sam^3,

    The note at the top of the data sheet states:

    "ELECTRICAL CHARACTERISTICS, over operating ambient temperature range unless otherwise stated"

    The 11 percent maximum error is for -40 C to + 150 C.

    For -20 C to + 85 C, they will guarantee that the error is 10 percent or less.

    The best way for you to determine what the actual error is for the part they
    ship to you is to put a stable, known current into the device and monitor the
    output vs temperature as the ambient temperature changes over the
    temperature range you expect to be using the device.

    phil
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-01-09 21:03
    phil

    The 11 percent maximum error is for -40 C to + 150 C.

    For -20 C to + 85 C, they will guarantee that the error is 10 percent or less.

    Thank You for your reply that what i got out what i read i just want to make sure

    that i was reading it right

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-02-23 19:53
    Hi Every One

    Here is a up date to this project

    Here is the code that i am using

    Please take a look and tell me what you Think

    I tested to 2 amp so far

    I have to finsh the board before i can test it to 50 Amps

    When i hook up the Current Sensor to the ADC Chip

    It turn out that each amp on the Current Sensor·is .019 Volts

    So i just need to use the steps of the ADC for each amp

    These seem work ok


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 2/24/2008 1:54:40 AM GMT
  • phil kennyphil kenny Posts: 233
    edited 2008-02-23 22:23
    Do you want the code to display the measured value in
    amps or millivolts?

    The comment in your program says "Convert to millivolts"

    If it is supposed to be amps, we need to know the reference
    voltage being applied to the ADC0831 before the correct
    scale factor can be determined

    phil
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-02-24 01:37
    phil

    Thank You for your reply

    If it is supposed to be amps, we need to know the reference
    voltage being applied to the ADC0831 before the correct
    scale factor can be determined


    I Used the demo code that is Stamp Works manual Chapter 28 used the second example
    It has an .600 volts off set value each amp = .019 volts so just used the ADC Count that all that need

    So·Pin3 on the ADC 0831 Chip has .600· volts· This is done with a 5 volt regulator·with a 10 k ohm pot adj to .600 volt
    Because Pin 2 has .600 volt from the Current Sensor

    With this set up the amps =·0 with no amp on the Current Sensor
    Each amp on·the current sensor = 0.019·volts so i do not any conversion i can just use the ADC count is same as the
    amps

    The comment in your program says "Convert to millivolts
    No convertion is need

    Do you want the code to display the measured value in
    amps or millivolts


    Amps·

    I up date the code

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 2/24/2008 1:57:12 AM GMT
  • phil kennyphil kenny Posts: 233
    edited 2008-02-24 04:18
    If you change your circuit to match the one shown in the attached schematic,
    adding a 1.25 v reference diode, the full scale for your ADC 831 will be a
    little over 50 amps. It can be a Linear Tech LT1004 or National LM385 or
    equivalent.

    Otherwise, the full scale output will be over 250 amps if you leave the
    reference voltage connected to + 5v.

    You may have to use a bypass cap on the ADC reference pin.

    If you do make this change, the code will have to be modified slightly
    to reflect the new scale factor. The ADC output will no longer directly
    be 1 amp/count. More like 200 ma/count, approximately.

    phil

    Post Edited (phil kenny) : 2/24/2008 4:31:05 AM GMT
    803 x 456 - 131K
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-02-24 06:29
    phil

    Thank You for your reply

    I will give this a try

    I order some sample so when they come in

    I will install the· National LM385 and see what happen


    If you change your circuit to match the one shown in the attached schematic,
    adding a 1.25 v reference diode, the full scale for your ADC 831 will be a
    little over 50 amps. It can be a Linear Tech LT1004 or National LM385 or

    equivalent.


    I also got some samples of these a well· LM385Z-2.5G 2.5 volt reference diode

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 2/24/2008 8:50:56 AM GMT
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-03-04 02:09
    phil

    UpDate i put the LM385Z-2.5G 2.5 volt reference diode and was able to get the scale that i am looking for it turn out that current sensor that was
    using is 200 amp one

    When i order the samples i had order some 50, 100, 150, and some 200 amp ones and did not know at first that i had installed a 200 amp one test board with the Basic Stamp but that OK i will test it on my truck and see how it works·



    ·I though that I·had a 50 amp one installed instead



    I used the

    ··················· counts ·CON· 255

    ·············· Amps = results */ counts


    Which seem to work better than····· " ** "· ·counts CON 65535

    I also had to put a cap of 10uf on the out pin of the Current Sensor because·the reading where jumping around that seem to help
    BTW the 470 ohm resistor was not enough i used a 2.2 k ohm instead that is to a five volt regulator

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
Sign In or Register to comment.