Shop OBEX P1 Docs P2 Docs Learn Events
Measuring voltage and current — Parallax Forums

Measuring voltage and current

simonlsimonl Posts: 866
edited 2006-04-20 17:00 in Propeller 1
Anyone got any idea how I'd measure voltage and current using a Propeller?

I'd like to monitor a LiPo battery (on my R/C helicopter), logging data every 0.25s or so. The voltage would be up to 18.5V, and current could be 74Amp continuous (111Amp bursts).

All help would be greatly appreciated smile.gif

Cheers,
Simon

Comments

  • Tracy AllenTracy Allen Posts: 6,656
    edited 2006-04-19 15:35
    For the voltage, you could use use RCtime, or sigma-delta techniques, both of which have been discussed here. Or an external analog to digital converter. For 18.5 volts maximum, it would need a resistor/capacitor dividor to scale it appropriately and to protect the Prop inputs. For current, you need a shunt to convert current into a small voltage. A professional style 4-terminal shunt (such as those available surplus from allelectronics.com), will produce 50 milllivolts at 100 amps. The usual way to bring the voltage from the shunt into a system is via an amplifier (op-amp) that converts the small differential voltage into a ground referenced voltage or current. Or a high resolution ADC with differential inputs. It might be possible to do it without the amplifier or ADC by grounding the Propeller to one of the Kelvin terminals on the shunt, and convert the 0-50 mV directly, or by working out a differential sigma-delta scheme for Propeller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • simonlsimonl Posts: 866
    edited 2006-04-20 12:38
    Thanks for that Tracy, I'll do some hunting to see how to actually do it [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
  • JavalinJavalin Posts: 892
    edited 2006-04-20 14:06
    Another option is for the use a voltage ladder and ADC to read the voltage, for the current look at the max472

    (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1108)

    The max472 returns a voltage proporational to the current supply. It may not be big enough for your application though.

    James
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2006-04-20 16:33
    Here is a recent example of this topic on the Stamps forum:
    http://forums.parallax.com/showthread.php?p=578927

    That used an analog to digital converter. Is your goal to do this on the cheap? It is possible to do it without the ADC, using digtal/analog tricks that the propeller is capable of. But I don't think you can get away without having an op amp or similar device to boost the current sense signal. You could try to generate a larger current sense signal, but at 100 amps, even 0.1 volt is 10 watts of power.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • pjvpjv Posts: 1,903
    edited 2006-04-20 17:00
    Hi All;

    Just a word to the wise....

    The virtual A/D using a PWM approach works well in an SX.

    In the Propeller, there are some issues to be aware of due to the fact that the switching levels are NOT at Vdd/2 as they (nearly) are on and SX. This creates a biased averaging value on the charge balance capacitor, and must be accounted for otherwise severe non-linearity occurs in the reading. While I have not yet pursued this extensively, I have attempted to cancel that effect by having a proportionally longer "low" vs "high" charge duration. For the brief period I was working on that, (other more interesting things were a higher priority) the results were unsatisfactory, and I could not rationalize the error.

    I hope to be able to pursue this again later, and I'm confident the proper compensating solution can be found.

    Tracy...... that said, my experience is that with some trickery 50 mV on a current shunt resistor is quite readable on an SX virtual A/D without an amplifier. Given of course that the precision will suffer somewhat, but that is offset by the benefit of a minimal component count. The appropriateness all depends on the application requirements.

    Cheers,

    Peter (pjv)
Sign In or Register to comment.