Shop OBEX P1 Docs P2 Docs Learn Events
measuring amps and volts with propeller — Parallax Forums

measuring amps and volts with propeller

msrobotsmsrobots Posts: 3,709
edited 2012-05-29 01:06 in Propeller 1
Hi all,

I do build some rover with 4 HB-25 and 4 Parallax-Wheelkit motors (12 volt 1.5 to ~10 amp)

I also have a car-battery for them and a different power-supply (~6v) for my propellers on board both with common ground.

what I am seeking now is some advice how to measure current voltage and amps for both supplys thru the propeller to decide when to "come home",

My "base"-propeller-board has still some pins left but I am running out of cogs - so I am looking for some solution where I can either run some spin to read those values or run a pasm-cog and kill it after reading.

I already use I2C for eeprom in spin so a I2C device might be handy but I also could devote some pins for rctime/dac usage.

alas, I am lacking the wisdom on how to do this.

for the voltages I was thinking of a voltage-divider to reduce them from ~13,5 to below 3.3 and the same for the other battery - but how to measure amps ? I feel helpless there.

I just recently started soldering (smart move, losing my eyesight faster then my hair...) and am new to electronics.

So my digital-io-board was a challenge, but I am getting there.

Any advice welcome

enjoy!

Mike

Comments

  • SRLMSRLM Posts: 5,045
    edited 2012-05-28 21:38
    These would allow you to measure the current of each motor: http://www.sparkfun.com/products/10643

    They also have a 90A and 180A versions that you could use for all four motors together.
  • msrobotsmsrobots Posts: 3,709
    edited 2012-05-28 22:12
    Thank you SLRM.

    After looking thru the datasheet this looks nice to me.

    even if five of them is a bit on the expensive side - having the current current for each motor-driver (HB-25) might be useful for detecting slipping of one wheel ?

    somewhere I have a 8?channel ADC from parallax sitting around - I need to look for it.

    enjoy!

    Mike
  • msrobotsmsrobots Posts: 3,709
    edited 2012-05-28 22:26
    hmm.

    going thru the datasheet again hitting this:
    [FONT=Arial,Bold]The I [/FONT][FONT=Arial,Bold][/FONT]analog output contains a 0.1uF bypass capacitor, but no series resistor. To complete an RC
    filter into the ADC inputs, you may place a low value resistor between the ADC inputs and
    [FONT=Arial,Bold]I [/FONT][FONT=Arial,Bold][/FONT]output.

    [FONT=Arial,Bold]The V [/FONT][FONT=Arial,Bold][/FONT]output has a resistance of 14.7k between the sensed drain and analog output with 0.1 uF
    bypass capacitor for an approximate bandwidth of 108 Hz, via the equation 1/(2
    πRC

    what does low value resistor should say to me ? 300 Ohm ? 1K ?

    enjoy!

    Mike
  • RinksCustomsRinksCustoms Posts: 531
    edited 2012-05-28 23:13
    Using values similar to the ones shown in the picture(12.9k & 2.2k), a voltage divider should work for a low voltage trigger of your batteries. If you use a potentiometer, you can fine tune the trigger point. It's a simple and easy to implement solution for your robot to decide when to return home. You only need to have the prop monitor one pin per voltage source,( the prop looking to see if that pin went low yet). When the 12V battery drops low enough, the voltage at the mid point of the voltage divider will drop below the minimum High threshold voltage of the propeller (1.65V). You can use a voltage divider with different values on the 6V pack on your propeller to monitor it's voltage.

    R1/R2 ratio = 5.05 (R1 being the one attached to 12V)

    If you feel that is not enough, i just came across this chip in another post http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=SENSOR+CURRENT+200A+5V+BI+5-CB+

    untitled.jpeg
    468 x 960 - 51K
  • jmgjmg Posts: 15,191
    edited 2012-05-29 00:14
    msrobots wrote: »
    I already use I2C for eeprom in spin so a I2C device might be handy but I also could devote some pins for rctime/dac usage.

    Texas Instruments have a rather nice part, the INA226, somewhat hidden in their "Current Shunt Monitor" subsection.

    http://www.ti.com/product/ina226

    This is a i2c ADC, but with a twist : it has
    82mV full scale (LSB 2.5μV) on Current Pins, and
    36V full-scale (LSB is 1.25 mV) on Voltage.

    At $1.30/1K that's quite good value for a 16b ADC - comes in a small MSOP10, and allows 16 Addresses.

    If you want your 10A to be appx 50% fullscale , that's 4milli Ohms of shunt you need to find.

    * Edited to fix typo : 10A * 4m Ohms = 40mV ~ 50% of full scale. (40mohms * 10A = 400mV )
  • msrobotsmsrobots Posts: 3,709
    edited 2012-05-29 00:42
    @RinksCustom ...+1 ... this might be the simplest solution... i love it.

    @jmg this is a very nice find. I have to study the datasheet. I am fine with programming but at the basics with soldering and wireing stuff. So how did you calculated those 40mill Ohms shunt ? I need more reading...

    enjoy!

    Mike
  • msrobotsmsrobots Posts: 3,709
    edited 2012-05-29 01:06
    @jmg ... aah ... page 15 of the datasheet seems to clarify things for me ... very interesting...


    enoy!

    Mike
Sign In or Register to comment.