Generic Battery + Arduino = Happy Solo

Joined
Jan 19, 2017
Messages
8
Reaction score
4
Age
44
Hi,

The resistors will limit the current draw to under 1mA per cell. This device will be left in the Solo and the battery will only be connected when you want to fly so won't drain the battery when not in use.

I am happy for someone to design an op amp circuit to add to the mix. When I looked into this it required more resistors, your example uses 14 compared to 8 for the voltage and would still require calibration. Also there is the op amp ICs to add to the circuit increasing the circuit complexity.

The chips I looked at could be used and I now have some to test. With the OLED using a software I2C these chips can be added to that. I paid NZ$7 for 3 of them so not too expensive.

I hope to get back into some circuit design work over the next few weeks and see how that goes.
Do you have the latest schematic and code you are using somewhere? I would like to try it and perhaps I can add something to the project. I have been for the last week trying to find out if something like this existed since 3dr batteries will die and dissapear from the market.
Also do you happen to know what controller 3dr used in their circuit? could give us some ideas.
About using resistors perhaps just using a mosfet to but them off from the pack when not used could reduce the drain to 0, without adding a ton of components.
May I suggest to put all code and schematics in github so people can collaborate on it?
I think what you have done is awesome.
 
Joined
May 9, 2017
Messages
132
Reaction score
48
Age
45
Hi Victor,

Thanks for that.
I think what you have done is awesome.
As this isn't designed to be left plugged into the battery there would be no drain. A mosfet would be an interesting idea and you could then have a switch to bypass the mosfet to supply power to turn on the circuit and then enable the mosfets (like the battery power button). You would need one for each cell and a large one for the supply to the solo (40+A). I am not sure what physical size these would be.

There are files throughout this thread (back a few pages). I haven't used github for storing files (only downloading) and unsure how the checking in and out process works. I know it is a great tool so if you know how this all works i am happy for you to grab the files and store them.

I don't know much about the BMS chip used in the solo batteries. There are threads on the BMS replacement but it looks like the price of them that can handle the current is very expensive and that is why i went down this path. This project i have looked at the solo code and worked out what questions are asked of the BMS and then tried to supply answers to those questions with data from the connected battery. This will allow any 4S battery and chemistry to be used.
 
Joined
Jan 19, 2017
Messages
8
Reaction score
4
Age
44
I have looked back in the thread and found an attachment with an arduino sketch a couple of pages back. I will open a github repo and add it. I'm not an expert on github but have used it enough for source code. Not so much for keeping up with hardware design files, but it works too.
Does this project has an 'official' name to use in the repo?
 
Joined
Jan 19, 2017
Messages
8
Reaction score
4
Age
44
Repo here with the code from Professorpip:
If you guys have github handles I can give you full permission to the repo. Otherwise I can take care of the maintenance.
Feel free to submit PRs if you know how, otherwise I will update the repo from files posted here.
 
Last edited:
Joined
Nov 17, 2018
Messages
24
Reaction score
15
Age
44
Repo here with the code from Professorpip:
If you guys have github handles I can give you full permission to the repo. Otherwise I can take care of the maintenance.
Feel free to submit PRs if you know how, otherwise I will update the repo from files posted here.
That’s great! I will send you my GitHub handle when I’m next at my desk!
 
Joined
Jan 19, 2017
Messages
8
Reaction score
4
Age
44
I saw a bunch of variables either repeated or not used, so I tried to clean up a bit and move constants out to a header file.
Regarding the capacity remaining, I see currently is using a linear equation.
I saw a table in a paper, page 3 to 5 here https://arxiv.org/ftp/arxiv/papers/1803/1803.10654.pdf that may provide a better approximation. Now that table is for Open Circuit Voltage, with no load, so would probably need to be scaled somewhat for measuring the charge with load. Otherwise seems like most BMS do coulomb counting, which we could do with the current measure, at least counting what goes out vs design capacity.
 
Joined
May 9, 2017
Messages
132
Reaction score
48
Age
45
I will have a look at that.

I also have an idea to put the voltage divider values along with some other settings into eeprom. I will then make another arduino with a screen that can be used to adjust the values.

I also have a link further back to a webpage you can use to generate an equation based on values. I will at some stage extract values of voltage and capacity from the solo log files to get the values.
 
Joined
Nov 17, 2018
Messages
24
Reaction score
15
Age
44
I saw a bunch of variables either repeated or not used, so I tried to clean up a bit and move constants out to a header file.
Regarding the capacity remaining, I see currently is using a linear equation.
I saw a table in a paper, page 3 to 5 here https://arxiv.org/ftp/arxiv/papers/1803/1803.10654.pdf that may provide a better approximation. Now that table is for Open Circuit Voltage, with no load, so would probably need to be scaled somewhat for measuring the charge with load. Otherwise seems like most BMS do coulomb counting, which we could do with the current measure, at least counting what goes out vs design capacity.
That’s great - thank you.

I’ve been pondering why the current readingon solex wasn’t working last time I did a test flight... I think it could be because the solo expects the current to be a negative number - and I think I may have removed the bit if code where the measured value is inverted.

i also have switched to use the Arduino’s internal voltage ref for the AnalogRead’s. I will see if this gives a better cell voltage reading.

UPDATE: Yes- this fixed it. The current does need to be negative. Now Solex picks up voltage and current correctly - and calculates power (Watts) in flight.
 
Last edited:
Joined
Nov 17, 2018
Messages
24
Reaction score
15
Age
44
Yes indeed. I've ordered one, and It's been shipped. Looking forward to trying it out. Functionality wise is very similar to what we've DIY'd here - but it does look more 'user friendly' in terms of how to update settings and calibrations. Also I think is reasonably priced given the time and effort it takes to make your own from scratch. Would be even better if the code was open sourced, as then we could collectively help to add new features - but obviously that is the choice of the creator... If it's based on, for example, and atmega microcontroller, then there might be an option to flash our own firmware onto it - to add a display, or a temp sensor, or some dip-switches to flip between different batt configs in the field with out need to hook up a PC. But overall looks very good
 
Joined
May 9, 2017
Messages
132
Reaction score
48
Age
45
It looks like a very similar design to what we have been working on. Current sensing resistors and a voltage divider for the cells. It would be great if it was open sourced. People after a plug and play version would still buy it and then others could tinker with the design as they liked.

With NZ in lock down for 4 weeks I was going to spend some time working on this project but with the release of this I think I will put it on hold unless there is still an interest in an open source version.
 
Joined
May 9, 2017
Messages
1,389
Reaction score
541
Age
40
Still VERY interested in an Open Source version. What do you need to keep going?
 
Joined
May 9, 2017
Messages
132
Reaction score
48
Age
45
Still VERY interested in an Open Source version. What do you need to keep going?
What direction would you like this project to head in?

Super simple setup to get flying or a feature rich option?

Thinking about a similar approach to BMSOne and soldering the XT60 to the motherboard via an apm voltage current sensor would make things simple. You then only need a simple voltage divider for the balance plug. The arduino board would then only need for a minimum setup
5V
GND
A0 Cell 1
A1 Cell 2
A2 Cell 3
A3 Cell 4
A4 SDA
A5 SCL
A6 Current

I purchased a set of 5 pin JST XH wired male plugs so this allow the arduino board to be inside and the XT60 and Balance plug to stick out
XH2.54 26AWG 2~6P Terminal Electronic Cord Cable Plug Length 20cm Female or Male | eBay

There is the GITUHB with the code (i have a version to give Victor_pv to upload where the settings are stored in EEPROM).

Currently there is no easy way to configure this BSM (other than through the Arduino IDE), i was looking at using a 2nd I2C setup and use a 2nd arduino with a screen and rotary switch to program the EEPROM.

If a more feature rich setup (screen, status lights etc) is wanted then a circuit board would need to be designed. I have been tinkering away on this but haven't spent too much time on it.
 
Joined
May 9, 2017
Messages
1,389
Reaction score
541
Age
40
Personally I'd like to see it configurable through a USB port. I don't need a screen, but status lights of one variety or another are a necessity.

So, simple setup through USB with open code base would be my wishlist.
 
Joined
May 9, 2017
Messages
132
Reaction score
48
Age
45
Personally I'd like to see it configurable through a USB port. I don't need a screen, but status lights of one variety or another are a necessity.

So, simple setup through USB with open code base would be my wishlist.
1585649979843.png

Here is a simple board using surface mount resistors and getting its +5V power and current value from the 3DR Voltage/Current Monitor board. It has JST XH plugs for balance lead, Neoixel, I2C for Solo and the 6 leads from the Voltage/Current Board.

Power to the Solo goes via the 3DR Voltage/Current Monitor board either directly to the main board or through a battery plug.

This board would be about 60mm x 30mm.

I could add jumpers for the setting of the serial number and other selections.

Using a Nano there is still the USB for ease of programming.
 
  • Like
Reactions: just_bruce

New Threads

Members online

Forum statistics

Threads
12,378
Messages
143,360
Members
14,415
Latest member
timotei512