Git Product home page Git Product logo

batmon_reader's Introduction

Rotoye Batmon

The Dumb-Battery Era is Over

Getting Started

When you receive a battery with integrated BATMON, the OLED display (if applicable) and red/green LED's should be flashing periodically, displaying the battery state of charge, the min and max cell voltages, and current in Amps. The button is used to cycle through screens.

If you see the < ! > symbol on the OLED display, this means that one or more safety warning conditions have been met. Press the button to see the warning(s) present.

Buzzer/OLED board

The optional OLED display/buzzer attachment extends BATMON functionality by providing a user-friendly interface for displaying state of charge, voltages, warnings, and more. The small board is attached to the main BATMON board via a flex connector. This connector is rated for a limited number of plug-unplug cycles. It is recommended to attach/detach this accessory as little, and as carefully as possible.

Interfacing with an Autopilot

Wiring to autopilot

Wiring to cells

Ensure that you have received BATMON with the right cell count as your batteries. You may connect the JST balance leads of a battery to BATMON to power it up. Ensure that the negative of the battery is connected to the negative terminal on the power board(the top board with the Prolanv connector). You'd need this connection to power up BATMON even if you are just testing the board.

PX4

Stable

BATMON is supported on the stock firmware of PX4 since the v1.12.2 version.

Connect SMBUS/I2C of BATMON to the appropriate bus on the autopilot.

In ground control software of choice, set

  • BAT_SOURCE parameter to "External"
  • BATMON_DRIVER_EN to 1

Start BATMON on nsh using the script:

batmon start -X * Search all the external bus and connect to the first BATMON detected

batmon start -X -b 1 -a 11 * External bus 1, address 0x0b

batmon start -X -b 1 -a 12 * External bus 1, address 0x0c

batmon start

I2C devices connected on the different bus can be identified by running nsh script: i2cdetect -b <bus number>

i2cdetect

battery_status uorb messages may be inspected using the command listener battery_status 1 listening to batmon uorb

Ardupilot

Clone or download Ardupilot firmware

Check out the master branch, build from source, and flash the firmware. BATMON support is not yet in a stable release of Ardupilot.

In ground control software of choice, manually set the BATTx_MONITOR parameter to 19 (or select Rotoye by name, if enumerated), and select the appropriate BATTx_BUS (0-3), where x is the Batt number (multiple Smart Batteries can be used at once!)

See the full list of parameters for more detail

Ground Control:

You should now be able to verify through a tool such as MAVLink Inspector in QGroundControl that Batmon is sending data to the autopilot:

Arduino Library:

ReadBatmon: Arduino code to access the Batmon battery monitor.

Instruction to run ReadBatmon

  • Copy the ReadBatmon folder to local directory.
  • Open the sketch using Arduino IDE.
  • Open Sketch->Include Library-> Add .ZIP library
  • Give location of FastCRC.zip file. The FastCRC library would now be added.
  • Connect the Power, GND, SDA, SCL lines from Arduino to Batmon
  • Connect the cells to BATMON
  • Upload code to Arduino
  • Run serial monitor to see output batmon_reader output

batmon_reader's People

Contributors

echogee avatar nbelanger99 avatar kyle-pawlowski avatar zselgrath avatar kal-el131313131 avatar legionmammal978 avatar suphaskymul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.