Hello and welcome to our community! Is this your first visit?
Register
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    New Recruit
    Join Date
    Jan 2012
    Posts
    7
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0

    v2.1.2 kit & battery monitor

    Can anyone explain how to connect and use battery monitor in case i'm using separate power source for arduino?
    I'm using 3s lipo for motors and 4AA NiMh to power Arduino over USB.

  2. #2
    Moderator AeroQuad Core Software Developer kha's Avatar
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    2,033
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    12
    With the new batterymonitor in v3 code you can monitor multiple batteries. One just needs to add resistor divider to a free analog input (A1-A8) and make up a suitable config line.

    I will update the wiki page for BatteryMonitor with full instructions when we have v3 released.

    However the combination you stated is not good.

    Yes you can use 3S lipo to power the motors but using 4AA NiMH:s to power arduino won't work too good. For the analog inputs to function correctly the Arduino must get solid 5V and 4AA NiMH:s will provide nominally only 4.8V.

    Either power arduino from the 3S lipo or at least 5cells of NiMH via 'VIN' so that the regulator on Arduino board is used.

  3. #3
    New Recruit
    Join Date
    Jan 2012
    Posts
    7
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Quote Originally Posted by kha View Post
    With the new batterymonitor in v3 code you can monitor multiple batteries. One just needs to add resistor divider to a free analog input (A1-A8) and make up a suitable config line.

    I will update the wiki page for BatteryMonitor with full instructions when we have v3 released.

    However the combination you stated is not good.

    Yes you can use 3S lipo to power the motors but using 4AA NiMH:s to power arduino won't work too good. For the analog inputs to function correctly the Arduino must get solid 5V and 4AA NiMH:s will provide nominally only 4.8V.

    Either power arduino from the 3S lipo or at least 5cells of NiMH via 'VIN' so that the regulator on Arduino board is used.
    I made mistake In this project currently i'm using 4AA Alkiline Duracell to power Arduino, so it must be about 5,8V over USB. But it doesn't matter now.
    The question is how to connect 3S LiPo, which is used to power motors, to Arduino?
    I think LiPo must have common ground(-) with arduino power source and it's "+" wire must be connected to A0 analog input, as defined in BatteryMonitor.h . Is it right?

  4. #4
    Flight Cadet
    Join Date
    Dec 2011
    Location
    UK - Manchester
    Posts
    63
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Quote Originally Posted by MichaelSaygak View Post
    I made mistake In this project currently i'm using 4AA Alkiline Duracell to power Arduino, so it must be about 5,8V over USB. But it doesn't matter now.
    The question is how to connect 3S LiPo, which is used to power motors, to Arduino?
    I think LiPo must have common ground(-) with arduino power source and it's "+" wire must be connected to A0 analog input, as defined in BatteryMonitor.h . Is it right?
    LiPo connects to Arduino through the DC connector supplied with the 2.1.2 kit. The arduino is center plug positive, so when wiring the DC connector you must connect the positive wire to the center plug, and the negative wire to the outside. This should then connect to your power harness and the power regulator on the arduino should take care of the LiPo's voltage...

  5. #5
    Moderator AeroQuad Core Software Developer kha's Avatar
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    2,033
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    12
    Note that the shield has internal voltage divider on A0 (VIN-[15k]-A0-[7.5k]-GND). If you want you can put similar divider on A1 and modify batteryMonitor config to use A1 for input. (and yes the '-' == GND should go together).

    Do not connect LiPo '+' to the the A* directly as that will burn the Arduino but use a resistor divider to adjust the voltage.

  6. #6
    New Recruit
    Join Date
    Jan 2012
    Posts
    7
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Hello. I have painted picture of my power distribution. See on picasa: https://picasaweb.google.com/lh/phot...eat=directlink
    How to monitor 3S LiPo in this configuration? I should solder one more voltage divider for A1 ? I do not want monitor arduino power source. Only battery used for motors.

  7. #7
    Moderator AeroQuad Core Software Developer kha's Avatar
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    2,033
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    12
    As the shield has a divider between VIN and A0 you cannot really use that.

    What you can do is:
    - make up a 3:1 resistor divider e.g
    Code:
    MOTORB+
       |
      15kOhm
       |
       o---- A1
       |
      7.5kOhm 
       |
      GND
    In UserConfiguration.h define (remove comments)

    #define POWERED_BY_VIN

    Then in Aeroquad.ino inside the "#ifdef AeroQuadMega_v21" part change

    BM_DEFINE_BATTERY_V(BattCellCount, 0, ((5.0 / 1024.0) * (15.0 + 7.5) / 7.5), 0.0)};// v2 shield powered via VIN (no diode

    to

    BM_DEFINE_BATTERY_V(BattCellCount, 1, ((5.0 / 1024.0) * (15.0 + 7.5) / 7.5), 0.0)};// v2 shield powered via VIN (no diode

  8. #8
    Moderator AeroQuad Core Software Developer kha's Avatar
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    2,033
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    12
    Actually the easiest way is to cut the pin that connects to VIN (on Arduino) from the shield so that it does not connect.

    Then connect the 3S battery + on the VIN on the shield.

    Configuration wise the only thing needed is to set
    #define POWERED_BY_VIN (and enable battery monitor of course)

  9. #9
    Flight Cadet
    Join Date
    Aug 2012
    Posts
    44
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Hi guys,
    I want to do the same thing so Kha, you're information was very helpful to me. However I am using 4s batteries. When charged at the maximum they output 16,8 V, when using the 3:1 voltage divider this means A0 will receiver 5,3V which might be too much but for it will later on drop below 5V. Will this damage it?
    In other words should I go for a 4:1 voltage divider? For example a 20K and 5K (instead of 15k & 7,5K) ?

    Quote Originally Posted by kha View Post
    Actually the easiest way is to cut the pin that connects to VIN (on Arduino) from the shield so that it does not connect.

    Then connect the 3S battery + on the VIN on the shield.

    Configuration wise the only thing needed is to set
    #define POWERED_BY_VIN (and enable battery monitor of course)

  10. #10
    Senior Pilot jsmcms's Avatar
    Join Date
    Mar 2010
    Location
    Detroit, Michigan USA
    Posts
    339
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    3
    Hey kha,

    Sorry to hijack this thread but I've got a quick related question: Where do you set the threshold for batteryWarning and batteryAlarm? I can't find it.

    Thanks, Scott
    Work hard, but play harder!


 
Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •