Shop OBEX P1 Docs P2 Docs Learn Events
i want to read the current of a device and read the current to my computer — Parallax Forums

i want to read the current of a device and read the current to my computer

katekate Posts: 2
edited 2006-12-11 05:34 in Learn with BlocklyProp
does anyone here knows how could I read the current of a simple device into my pC? i have been reading some analog to digital converters lately, but the required input is only the voltage, therefore, it only converts the voltage analog input to voltage digital output, which i can see in my PC. but i also want the readings of the current. is this possible? tnx!

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2006-09-03 04:15
    The usual way to read a current is to pass it through a resistor, which converts it to voltage by V=IR. The conitions are, where to put the resistor, and how to get the voltage into the ADC, with or without amplification and offset. So, it would help for us to know what sort of device it is that needs to have current measured?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-09-03 21:07
    You can use a ferrite torroid with a slot cut through it and a hall-effect sensor inserted in the slot.

    You pass the wire through the center of the torroid.

    This eliminates the need to directly attach wire to the circuit in question and having to use an extremely low resistance, high wattage resistor to get a measurement. It works by induction.

    Having said that, it is quite a challenging DIY project. There are AC current devices that are sold that do this. I am not sure about DC.
    If there is a AC?DC applicance, it may have a digital interface.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • katekate Posts: 2
    edited 2006-09-04 06:35
    well actually, it should test the output of any device ranging from +-10 V only. that means any device like a battery, or a charger or so and so. i've searched about the ferrite... but i haven't found any circuit about it and i have no idea what it is since im a computer engineering student and haven't heard about it before. [noparse]:)[/noparse] somebody told me that measuring the output of a dc powered device is much easier than that of an AC since i still have to measure the frequency of the ac generated, and through my PC... but i have no proof of it yet, i just asked my friend just yesterday
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-09-04 18:07
    The Hall effect sensors sense the magnetic field of a nearby object.

    The ferrite toroid is just a dounut shaped piece of ferrite that is usually used as a transformer's core because it responses well to transfering magnetic force.

    The idea is to read the magnetic field associated with the current rather than read a voltage differential across a known resistor. You cut a slot to actually place the Hall effect sensor into a position where its ability is enhanced by the ferrite toroid and is able to provide stable readings.

    There are two types of Hall-effect sensors. One is a flip/flop logic and no good for this applcation. It turns on when one pole is near and turns off when the other pole is near.·

    The second type of Hall-effect measures intensity and you would used it somewhat similarly to a transistor. You would have to engineer it to operate in a linear region, you would have to calibrated to a known current to have useful information, and you may have to create several switched ranges [noparse][[/noparse]like a VOM] to get a full range of information.

    Since the output is purely analog, you would have to use an Analogue to Digitial Converter or a digital VOM with computer interface to have the information arrive at your PC.

    As I mentioned earlier, a bit challenging for a DIY project.

    AS far as design parameters, you give me 0 to +10v, but that isn't current. One would need to know what range of amps too in order to estimate the magnetic field created.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • edited 2006-09-05 16:27
    So, do you want to be able to configure your project to measure either AC or DC current with input voltage of up to +/- 10 V?

    What is your expected current range?
  • AlphawookieAlphawookie Posts: 14
    edited 2006-11-05 23:18
    Kate,

    I'm looking at the same thing. I want to measure DC current at 5V, and make some decisions when the current gets up to about 5.5A.

    I think the solution lies close to an Analog - Digital Converter and a shunt resistor, but I'm so new to this don't take my word for it. You measure the voltage drop across the shunt somehow, send it to the ADC and somehow get it to the input pins. I don't know yet.

    Have you figured it out? If so' I'd love a leg up.

    Tom

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Engineering is the art of doing·something well with one dollar, which any bungler can do with two after a fashion.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-11-07 16:59
    Hi Kate & Alphawookie, I found the following link on how to make your own shunt resistance, as the author says the acuracy is not as good as a commercially bought shunt but I liked the article because it teaches the basics very well. The meters used are measuring the voltage drop across the shunt (directly proportional to current), because the voltage drop is small you would probably need an amplifier in place of the meter to convert it to a useful quantity. I dont know enough about electronics to know if or how that could be done·I kind of visualise an op-amp, maybe that is something to look into.

    http://www.uoguelph.ca/~antoon/gadgets/shunts/shunts.html

    Jeff T.
  • T ChapT Chap Posts: 4,223
    edited 2006-11-17 02:41
    Kate do you already have the software to read it into the PC? The way I would do this is to put a power resistor from the low side of the device(motor etc) to GND. Use a value like .1 ohms, and a 1-3 watt resistor depending on the current rating, just don't use wirewound resistors. Then read your A to D from the side of the resistor that is not GND. There will appear a voltage there as the current rises. The voltage depends on the shunt resistor value, if I am not mistaken with a .1 ohm, the voltage should be 1 volt per amp. You read the value with the D to A off the micro, send a string to the PC through the serial port on the PC's RX pin. The applciation then reads it and you do what you need to do. If you don't have a software to read it, that is another story, easy to do though with some effort.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2006-12-11 05:34
    Kate & Alphawookie


    The link that gave you will work and the way that you do this as follows

    (1) Take a auto light bulb for a tail light and mesure the amp draw
    (2) You need to know what your mil volt scale will be
    (3) Take wire size that you are use and strip it··i would say about 4 inchs more or less·and put one lead of the meter·and then other lead and move it down the wire until you get the milvolts scale that you need for the amp scale that you want to use

    I would say that to make it easy 1 amp = 100 millvolts and the a/d converter
    this might not be right it was a while ago that i did this and this was for panel meter that i did it for

    If you tell me the· mil volts scale and what amp, from milamp·to amp ·that you will used
    and what wire size that you will use i will try it and let you what will work

    There is a project that i will be working on latter next year that i will need to know this info my self
    ·

    I have done this for home made power supplys that i wanted an amp meter and a voltage reading and the· acuracy· is perty good

    But BE VERY CAREFULL WHEN YOU DO THIS NOT TO SHORT ANY THING OUT WITH THE BARE WIRE THAT YOU ARE USING
    FOR YOUR TESTING

    The· acuracy is fairly good if you take different thing to mearsure take a lamp that draws let say 2 amps then take a lamp
    that draw 1 amp and one that draws 500 milamp and so on and adj your wire lenght for best· acuracy· in what range that
    you need you check with meter that you tested the lenght wire

    I hope this help you in what you want to

    Sam

    Post Edited (sam_sam_sam) : 12/11/2006 5:49:43 AM GMT
Sign In or Register to comment.