Very cool project!
I have a question regarding how you are going to measure the voltages on the PIC. I have been working abit on similar problem but I've not come up with a good solution. For my project i would want the Hub to be able to work with batteries from 3 to 12 cells. And preferably autodetect the cell count. (i fly a TREX450 on 3 cell, and is currently building a TREX600 that will go on 6 cells in the start, but might get upped to 12 fairly soon).
I am planning on basing my Hub on a AVR rather than PIC though.
For voltage measurements, as I've understood it, one could either:
- Use the balancing plug, and measure each cell on separate AD ports, however this would have some issues on large crafts like the TREX 600-700's running 10-12 cells, as very few micro controllers have that many AD's
- Use the balancing plug as above, but somehow mux the lines to use only one AD port. (shift register controlled by a DO to swap cells maybe?)
- Use a voltage divider on the full battery voltage, set up to your max cell count, i.e. 50V in gives the max on the AD port, would work, but require more logic in software, and would give low resolution for low cell count batteries, would also require soldering to the main power lines. (i really don't like doing that..)
- Using a comparator or similar to put in a "battery ok" or "battery too low" into a Digital pin for each cell
- Use the full battery voltage, but somehow create a circuit that would output only an average cell voltage, that could be measured on one pin
- Use balancing plug, have a circuit that would somehow convert cell voltage to a "pulse train" where i could measure the period, or time between transitions on one DI for each cell
There are probably many more methods to do this, but i'm on deep water now..
I "think" there is probably a "best" way to do this (guessing nr 2...), and i am hoping that someone can point me in the right direction
i've had several electronic courses, but all of them where 15 years ago, and I have had very little practical application in this field...
Well i look forward to seeing your project progressing!