Shop OBEX P1 Docs P2 Docs Learn Events
measure volts — Parallax Forums

measure volts

johnprokojohnproko Posts: 121
edited 2014-07-28 14:14 in Propeller 1
hello all.

i have a propeller education kit (http://www.parallax.com/product/32305).

i want to measure how much battery i have left. if someone could post a photo or a data sheet for the kit, because its not the same as in the C page, that i have and the code in C although i guess it is the same as in the learn C webpage. also is there a way to measure amps as well?

thank you in advance!

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-07-19 14:58
    The INA 219 kit will provide a voltage and current measurement.
  • johnprokojohnproko Posts: 121
    edited 2014-07-21 11:28
    i have seen at the teaching (http://learn.parallax.com/propeller-c-simple-circuits/measure-volts) the wiring and c code for measuring volts.
    the education kit comes with the [FONT=Verdana, Geneva, Arial, Helvetica, sans-serif]10 k-ohm single-turn potentiometer (#152-01031), probably because it is design to measure volts.
    does anyone know how to wire it though? because it doesn't have A/D ports, at least i don't know where they are.

    as for the ina 219, same question, how can i wire it, once i have bought it. and the second problem to that is the code.

    thank you!
    [/FONT]
  • StefanL38StefanL38 Posts: 2,292
    edited 2014-07-21 13:06
    Hi John,

    measuring electric energy-consumption means measuring volts and ampere over time.

    Power = Voltage x Current example 5V x 2A = 10W
    Energy = Power x Time 10W x 4 hours = 40Wh

    Now maybe you can do it simpler:
    if your project consumes the same current all the time = current is a constant factor you just have to measure the current once with a DMM.

    What kind of battery are you using? @the Lipo experts here: can the capacity of a lipo-accumulator be measured with only measuring volts?

    The propeller-chip has no ADC "onboard". SO I would recomend an external ADC-Chip like the MCP3208 (there is code for this ADC in the OBEX)

    Anyway: if you don't know how to measure voltage and current (yet) I recommend to learn the basic things about electronics.

    Current-measuring turns out to be a voltage-(drop) measuring "across" a resistor with a low value 1,0Ohm down to 0,001 Ohm.

    I do NOT recommend using the delta-sigma ADC-circuit. delta-sigma-ADCs are sensitive to EMV expecially at higher measuring-frequencies

    Here you should write details about your project. Does the current go up and down quickly? This would mean to measure voltage and current very often.
    How much current is flowing? some mA or thousands of mA?

    Are you just starting playing with the propeller-chip and want to know how long the battery will last or are you working on a mobile battery-powered project?
    For playing around with the propeller-chip go get a 7.5V DC-plug for some dollars and never mind again about how long the battery will last.

    I'm a big friend of trying it on your own. I mean it this way: You should post a picture how you THINK things should be wired. Then the forum will answer to it
    "correct" or no it's the following way.... By making a try on your own we (the forum) will see WHERE to explain things.

    This way implies to do things right on your own. Or if not to correct wrong ideas about electronics.

    In this forum ALL members are patient and like to help. I have NEVER read laughter on asking basic things.
    So give yourself a chance and post a first own try. As long as we (the forum) can see you are working forward by asking concrete questions
    you can ask 20 times every day and will get a lot of answers. Only if you would ask for "can somebody serve me my completed project with all details
    the forum will stay silent.

    OK you have asked some concrete questions: In the short way I can only give a small starting answer:
    How to wire the INA219:
    Adafruit has a download-link for the datasheet of the INA219-chip http://www.adafruit.com/datasheets/ina219.pdf
    Inside a dataheet search for keywords like "application circuit".

    After doing a quickl reading of the INA219-datasheet I would not recommend using this circuit. As programming I2C and the registers of the INA219 is a medium-difficult-user task and not a beginners task.

    As you seem to know not too much about electronics I would recommend using a more basic way of measuring voltage and current with a ADC-Chip like 3208.
    This way your knowledge about electronics will grow in parallel with learning how to code for the propeller-chip.
    I recommend http://www.ibiblio.org/kuphaldt/electricCircuits/DC/DC_8.html for learning about metering circuits.

    best regards
    Stefan
  • johnprokojohnproko Posts: 121
    edited 2014-07-28 11:47
    hello mr stefan.

    i just saw this http://learn.parallax.com/propeller-c-simple-circuits/measure-volts and wanted to learn how it works, the code, in order to map my battery remaining for future projects like a quad fpv I'm working on.
    since i don't have this board probably its more difficult than i thought.

    if anyone has though this board http://www.parallax.com/product/32305 and has performed this experiment, even in spin language, please post a schematic how to wire and other information. thank you!
  • StefanL38StefanL38 Posts: 2,292
    edited 2014-07-28 14:14
    Hi John,

    I don't know what a "quad fpv" is.
    I know the term "quad" as a "motorcycle with four wheels" and "fpv" as first person view
    a camera mounted on a quad-ro-copter or a wing-airplane transmitting the videosignal down to videoglasses
    of the RC-pilot.

    So if you use lipos measuring voltage gives you a rough estimation how much power is left in the battery.
    For a more exact value of how much energy is left in your battery you have to measure the current
    100 times per second. Adding up all these measured values to get the actual sum of how much Ah you
    have used from the battery calculating how much is left.

    This is not a beginners-task. You seem to be a newbee about electronics. I would recommend to buy a
    off the shelf Ah-meter for RC-telemetry. If my guessing is right about what your "quad fpv" is.
    i just saw this http://learn.parallax.com/propeller-.../measure-volts and wanted to learn how it works, the code, in order to map my battery remaining for future projects like a quad fpv I'm working on.
    since i don't have this board probably its more difficult than i thought.

    if anyone has though this board http://www.parallax.com/product/32305 and has performed this experiment, even in spin language, please post a schematic how to wire and other information. thank you!

    John. The Propeller Activity board has an ADDITIONAL Chip performing the voltage measurement.
    So this means this voltage measurement is done by ADDITIONAL HARDWARE not only software.

    So please try to find the Chip type "ADC124S021" in the list of contents in your propeller-chip education-kit.
    It's simply not there.

    This Chip called "AD-converter" analog-to-digital-converter. short TLA ADC.

    There are thousands of different ADC-Chips. With different interfaces (I2C, SPI), voltage-ranges, resolutions
    internal AD-converting techniques etc. etc. etc)

    So a small capacitor and a resistor for measuring volts through charge-discharge the capacitor is only suitable
    for low resolution and slow changing voltages.

    So first of all explain with a lot more than two acronyms ("quad fpv") what you are planning to do.

    The chosen solution highly depends on that

    For first experiments I recommend using this ADC-Chip called MCP3208.

    http://www.parallax.com/product/604-00062

    best regards
    Stefan
    1000 x 1000 - 918K
Sign In or Register to comment.