Generic Battery + Arduino = Happy Solo

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.
 
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.
 
Here’s a rough picture of how I built mine without using a PCB - just with solder and superglue...then hooking up the connections with wires. Very, very ugly but allows for easy tinkering..
 

Attachments

  • 3dr solo bms emulator DIY diagram.pdf
    454.6 KB · Views: 68
  • Like
Reactions: RichWest
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?
 
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:
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!
 
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.
 
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.
 
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:
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
 
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.
 
Still VERY interested in an Open Source version. What do you need to keep going?
 
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.
 
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.
 
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.
 
View attachment 10969

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.
That looks really good. Not too complicated so would be easy to build, and easy to tinker with. I'm currently using my original DIY board(build around a arduino pro micro, and a cheap apm power module as well as thee Madhacker BMS one, and they both seem to work just fine...

Interestingly the BMSone uses an LM324 (a rail to rail op amp), to help measure the 4 cell voltages. With my own design (were I used just a simple potential divider into the arduino's ADC ports) I notice that I don't get very stable or precise readings - and didn't always get the best resolution or precision in the result. It worked, but it wasn't fantastic.

I did consider adding an op amp myself, to feed the ADC - give this results in a high impedance sensing input from the balance connector, plus also you can get individual differential cell readings into each ADC pin via the use of the op amp. Might be worth doing some more experiments to see if we can get good stable readings from the simpler 'straight into the ADC via a potential divider' approach.

Phil
 
I am currently finalising an updated version of the code with a serial interface to adjust the settings and then save them to EEPROM. This code is the minimum to go with the simple circuit above.

I did look at an op amp and purchased a few for testing. My only concern was they needed more resistors than a voltage divider (along with the chip) and would still need calibration. I did find the I2C units for measuring voltage (3 channels) but never got around to testing them.

Have you used the voltage filtering version of the code? This is included in the version i am working on and the value can be set and saved. The filtering takes out jumping values and does some smoothing. Also since you are using adjustable trim pots there could be movement (from vibration) and a slight change in resistance as the Solo flys thus changing the values.

I hope to get the code finished tomorrow and can post it. I will also forward it to Victor_pv to put in the GITHUB.
 
I have finally managed to get this code to compile.... It is using SerialUI. There is an APP DeviceDruid from the windows store that will interact with this (i have had limited success).

I use the Arduino IDE's serial monitor (57600 baud). In theory you could use a mobile with a serial monitor etc. The only this to consider is removing the +5V from the USB cable as this will change the power going to the Arduino and may alter the Vref if you are doing a calibration.

Type
?
will bring up the Main Menu

Enter the item you want to change
Neo_Bright (spelling and capitals matter, you can copy and paste)
Press Enter
Then type in the value to change to and press enter again. This updates the current value used in the arduino.

Type
Save
This will store any changed values to EEPROM so they will load next time the Arduino is restarted.

Type
Load
This will load the values stored in EEPROM

Type
?
This will then display the values loaded from EEPROM.

Menu.jpgMenu 1.jpgMenu 2.jpgMenu 3.jpg

This version of the code currently only supports Neopixels. The complied code is around 94% of memory, i will look to try and reduce the size of the project and add features back in like the OLED.

I am still to add in code for calculating the the voltage divider ratio based on entering in a value Cell1_M for the measured actual voltage and then adjusting the ratio to make the calculated value the same.

I haven't tested the code yet with a Solo but is based on my last working set.
 

Attachments

  • Solo_SMBus_Serial.zip
    16.7 KB · Views: 15
  • SerialUI.zip
    203.2 KB · Views: 12
  • Like
Reactions: just_bruce

Members online

No members online now.

Forum statistics

Threads
13,093
Messages
147,741
Members
16,047
Latest member
pvt solo