diy solar

diy solar

I want to make my own BMS

True, but you are already starting with modest resolution for a coulomb counter. If you truncate the range, you are really just going to end up with a loose guess at coulomb count. Why bother?

I see coulomb counters as a critical element in a battery system. The shitty one on my Chargery BMS is so bad, I just ignore everything it says and added a Victron Smart Shunt which is functionally accurate.
Just taking a look to the datasheet I think it is not that modest. Of course there are better options. +-200mv over 16 bits is not that bad. You can always reduce the input range by 1/4 to get +-50mv as victron BMW700. Non-linearity is a bit high. But first I need to benchmark it versus the options in the market.
 
I do not know why I post things. I always that it can be a candidate and people take it as I am going to do it even if the world ends tomorrow.

I will repeat again, this is a DRAFT (and maybe not even that).

It can be done quick if time is dedicated, but now I am only dedicating 10 minutes per day.

The first step is to target the required features and that is why I created the post. I am still in that phase, not with the component selection phase.

I just posted a high level diagram as reference.
I am referencing the part that you proposed yourself - pointing out a potential for a significant problem in high-current systems.

Are you not interested in thoughts, opinions, or ideas? Why would you bother with 50 posts on a public discussion forum?

No one considers any post a binding contract - you can use whatever parts you want in whatever manner you want and change your mind at any moment with zero consequence.
 
I have not. Honestly, I am a bit nervous about bricking the unit before I have another one ready to go.
Sorry to side track the conversation .... I've updated mine as each update came out.... so about 3 times. It's pretty straight forward and easy ..... Well worth it for me. They other thing that gives improvement is to power it externally so the power for the unit isn't on the balance leads.
I was about to move on to something else, but am pretty happy with mine now. I have another monitor connected .... calibrated the Chargery to use the same shunt. The cell voltages and SOC tracking are pretty good now. The only deficiency now is that it stays in storage mode below .5A .... better than the 1A it used to be, but I'd like to see them do away with storage mode all together.

I won't post about the Chargery any more on this thread .... sorry for the side track. Shoot me a message if you have any questions about the updates.
 
Just taking a look to the datasheet I think it is not that modest. Of course there are better options. +-200mv over 16 bits is not that bad. You can always reduce the input range by 1/4 to get +-50mv as victron BMW700. Non-linearity is a bit high. But first I need to benchmark it versus the options in the market.
If you scale the input to 50mV, your ENOB will plummet to a rather course level. Perhaps an external differential LNA would be an option to allow full scale and have all the bits in play.
 
If you scale the input to 50mV, your ENOB will plummet to a rather course level. Perhaps an external differential LNA would be an option to allow full scale and have all the bits in play.
If i divide the input by 4 I will lose 2 bits. An adc of 14 bit over +-50mV is still not bad.
 
16 bit adc I think is an overkill.

16 bit adc isn't overkill for current measurements. Current accuracy is the driving force for my adc.

What current accuracy is acceptable to you? Generating a design spec should be the first step in the design. Choosing parts should be way down the road after a thorough analysis.
 
Generating a design spec should be the first step in the design. Choosing parts should be way down the road after a thorough analysis.
That is not exclusively the case.
Many of my designs started with a rough spec and the parts availability effectively fill in the details of the specification. That allows me to choose parts based on availability, ease of use, EOL, price, etc, etc.

Doing a hard spec right up front is a recipe for an overly complex project.

I think that @Pidjey approach is wholly appropriate. As he picks parts, he will begin to understand their strengths and weaknesses at which point he can decide if it is 'good enough' or not.
 
Last edited:
16 bit adc isn't overkill for current measurements. Current accuracy is the driving force for my adc.

What current accuracy is acceptable to you? Generating a design spec should be the first step in the design. Choosing parts should be way down the road after a thorough analysis.
You are right. That was the reason I created the post, not to discuss components that I may or may not use. I do not think I need more than 1/10000 of my highest current. In a 100A system I do not think having an accuracy of more than 10mA is going to make any difference.
 
Last edited:
You are right. That was the reason I created the post, not to discuss components that I may or may not use. I do not think I need more than 1/10000 of my highest current. In a 100A system I do not think having an accuracy of more than 10mA is going to make any difference.
An ENOB of 13.29 meets that requieriment.
 
If i divide the input by 4 I will lose 2 bits. An adc of 14 bit over +-50mV is still not bad.
It is not horrible, but not amazing in any way.

Still trying to understand what you are trying to accomplish here.

You have said that you are not doing it for learning purposes and it appears that you are not concerned with doing something better than what you can just buy. Seems hard to do something for fun that is the same as something I could just buy. That is just me though....I have a terrible tendancy to pursue improved designs.
 
It is not horrible, but not amazing in any way.

Still trying to understand what you are trying to accomplish here.

You have said that you are not doing it for learning purposes and it appears that you are not concerned with doing something better than what you can just buy. Seems hard to do something for fun that is the same as something I could just buy. That is just me though....I have a terrible tendancy to pursue improved designs.
I like to do things for fun.

Higher numbers do not mean better. You can use an adc with ENOB of 22bits that in a system of 100A can give you an accuracy of 24uA. Personally in such system I do not think a coulomb counter with 24uA resolution will perform much better than one with 10mA resolution. I think the gain would be marginal compared with the investment.

Numbers are not everything. What I am going to say do not take it as holy words because I have not read the datasheet, because this is only a candidate, not the component I am going to use. This component has integrated high impedance input analog front end and it says that it uses digital filters and hardware accumulator. Using an external ADC you need to make your own external front end and perform every task by firmware that can lead to degraded performance.

I already said it in the first post. I think BMSs in the market in terms of performance are good enough. I always see people strugling with the features, like lack of configuration, no temperature sensor, shitty connectivity and applications.... and there is where I want to make something that suits better for me. Other features are fuel gauge or integration with grafana or home asistant that can make my system for efficient.
 
Last edited:
In my opinion features is the secret, not superadvanced hardware with the highest perfomance in the market. The best example for me is Victron. I have an MPPT controller opened at home and there are few pages where they open them and analyze them. They use quite average quality components but the company shines due to the features. I created this post to discuss about the features for the specifications and then, only then, continue with the hardware design.
 
Sorry to side track the conversation .... I've updated mine as each update came out.... so about 3 times. It's pretty straight forward and easy ..... Well worth it for me. They other thing that gives improvement is to power it externally so the power for the unit isn't on the balance leads.
I was about to move on to something else, but am pretty happy with mine now. I have another monitor connected .... calibrated the Chargery to use the same shunt. The cell voltages and SOC tracking are pretty good now. The only deficiency now is that it stays in storage mode below .5A .... better than the 1A it used to be, but I'd like to see them do away with storage mode all together.

I won't post about the Chargery any more on this thread .... sorry for the side track. Shoot me a message if you have any questions about the updates.
Every one is welcome. This is a forum. You are completly free to post whatever you want. I also have to say sorry because I like discussing a lot ?

And please, do not take me too serious in the way I discuss.
 
I agree that numbers are not everything and certainly understand the concept of diminishing returns.

At the end of the day, the biggest flaw I see with the low-end products is not the resolution of the ADC's - but rather the lack of robust implementation.
When I take my mobile system out in the middle of nowhere, I want to ignore it completely with full confidence that it will work as designed no matter what. I want to absolutely count on it blocking charging in cold weather. I do NOT want it to false disconnect as I have experienced with my Chargery BMS.

That Batrium system does not appear to go overboard with ultra-accuracy, I they do seem to get the idea that reliable design is top of the list.

So much of the reliability comes from the physical implementation too. How it is connected, PCB shape, component location, PCB layout, thermal management where needed, etc.

Looking forward to see what you come up with here.
 
I agree that numbers are not everything and certainly understand the concept of diminishing returns.

At the end of the day, the biggest flaw I see with the low-end products is not the resolution of the ADC's - but rather the lack of robust implementation.
When I take my mobile system out in the middle of nowhere, I want to ignore it completely with full confidence that it will work as designed no matter what. I want to absolutely count on it blocking charging in cold weather. I do NOT want it to false disconnect as I have experienced with my Chargery BMS.

That Batrium system does not appear to go overboard with ultra-accuracy, I they do seem to get the idea that reliable design is top of the list.

So much of the reliability comes from the physical implementation too. How it is connected, PCB shape, component location, PCB layout, thermal management where needed, etc.

Looking forward to see what you come up with here.
That is what I want to accomplish and that is why I created the post. Having a 16 or 24 bits adc when the performance of 12 is more than enough, is irrelevant for me. Or even having a sightly lower performance but I meet my features/robustness requieriments.

I have to confess that I spend 90% of the time or even more discussing here. I will start working this weekend in identifying the specs and the electrical/mechanical requirements.
 
Last edited:
I also do not mind making a first prototype with lower performance specs but with the right features and then improve it. I do this for fun. For money/bussines is cheaper to buy one.
 
Agreed, DIY is for fun. I'm in the age group that puts 1000-piece picture puzzles together or watch the weather channel. I would rather see some sparks fly.
 
For the fets I am planning to have a daughter board only for the fets. I would like to try aluminum core PCB. I will use smd fets.

What did you plan for the current capability?


My favorite thing about the ESP32 is that it has good MicroPython support that allows you to get a fairly complex application up and running REALLY fast compared to C/C++ that still dominates in the embedded world.

I would never trust anything relying on an additional layer of abstraction for literally all your code (java anyone?...). C++ or even C+ is plenty fine, more efficient in memory and perfs, and a lot more reliable. These days it looks like the main problem is people wanting to use a language they know to do everything everywhere (even if it's not well suited to the task) instead of learning the proper language to do it... makes me cringe every time.


The BOM I am proposing will be lower than 100$.

Including the MOSFETs? if yes then be prepared to double that, at least. (or have a very high thermal load to take care of).


For me 1mV could be good but 10mV for this application I think it is enough.

That's fine ;)

NB: don't under-estimate tempco though, that will be you main enemy. Accuracy is easy with stable 20 °C ambient, but a lot harder with 0 to 50 °C for example.

Also, the shunt voltage will be in the µV region for low currents, not mV, so you need to check you still have decent accuracy here too.


16bits (even roughly implemented with weak ENOB) is fine for monitoring and balancing. The accuracy is needed on the coulomb counting side of the circuit - which requires rather high accuracy to be functionally useful in the real world.

Yes, that, exactly.


but you have already claimed this is simple stuff and the software will only take a day.

I agree, there's not even a remote chance to have bug-free software with all the basic features of a BMS in a day. But fortunately it's not a race, I recommend to take the time to make things correctly, that's actually one of the biggest problems you can see in cheap chinese BMS: rushed designs.


As I do not want to publicly show my work I can show you it in private. For example today I have done the schematic of a testboard more complicated than this. I have also met people who overstimate the work something takes just because they do not have the expertise. It happens to me a lot for example. Everytime I need to work with chemicals I take weeks for something my colleages do in one day because they do it in daily base.

I do software on a daily basis and have done for a long time now (both personal and for work, and in various domains: embedded, system, web, ...), I can tell you one day isn't realistic, at all.


The first step is to target the required features and that is why I created the post. I am still in that phase, not with the component selection phase.

I just posted a high level diagram as reference.

Can you post the current list of features you have so we can see what we would want to add to it?


Higher numbers do not mean better. You can use an adc with ENOB of 22bits that in a system of 100A can give you an accuracy of 24uA. Personally in such system I do not think a coulomb counter with 24uA resolution will perform much better than one with 10mA resolution. I think the gain would be marginal compared with the investment.

Of course, but usually when you design for +/- 10 mA you have high chances of ending up with +/- 20 mA or even +/- 50 mA, that's why you either design for better than what you want, or design using absolute worst cases everywhere, or both.


I already said it in the first post. I think BMSs in the market in terms of performance are good enough. I always see people strugling with the features, like lack of configuration, no temperature sensor, shitty connectivity and applications.... and there is where I want to make something that suits better for me. Other features are fuel gauge or integration with grafana or home asistant that can make my system for efficient.

Seems reasonable enough ;)
 
Of course, but usually when you design for +/- 10 mA you have high chances of ending up with +/- 20 mA or even +/- 50 mA, that's why you either design for better than what you want, or design using absolute worst cases everywhere, or both.
I just said that is my requieriment, not the target of my design.

I do software on a daily basis and have done for a long time now (both personal and for work, and in various domains: embedded, system, web, ...), I can tell you one day isn't realistic, at all.

I think I got misunderstood again. I said that basic code for protection can be done in one day. There are already libraries for the component. A code that writes a register calling an already implemented funcition to change one parameter or calling a function to read a parameter and cast it through UART, if you have the expertise, does not take a long time. I do embedded programing every day. The whole system, taking only part of my free time, will take few months at least.

As an example I already implemented the active balancer using a fuzzy logic controller and took long time. For the fuel gauge I will continue the implementation of the algorithm I started time ago. It is an ANFIS, adaptative neuro-fuzzy inference system, and that is going to take a very very long time. Also because both include long validation. That is why they are in phase 2 and 3.

Talking about hardware, software and validation, I do not expect to take less than one year because I am only going to use part of my free time.
 
Last edited:
I would never trust anything relying on an additional layer of abstraction for literally all your code (java anyone?...). C++ or even C+ is plenty fine, more efficient in memory and perfs, and a lot more reliable. These days it looks like the main problem is people wanting to use a language they know to do everything everywhere (even if it's not well suited to the task) instead of learning the proper language to do it... makes me cringe every time.
Very good point.

In this application, I don't see the embedded MCU's doing much more than coordination with no strenuous performance requirements. That is a good place to add abstraction in the name of getting it done in a reasonable amount of time.

Almost all of my embedded work has been in C. The end result is very performant and reliable, but at the cost of time. C takes far longer to code than MicroPython. If you get into a performance bind, you can utilize inline C for the areas that need something very specific. It does not really fit all applications, but I have had really good success in situations like this where the MCU is not safety critical. The important stuff is being done on dedicated analog silicon.
 
Back
Top