diy solar

diy solar

DIY BMS design and reflection

Yeah that's part of why I used an arduino instead of RPi. Now if you use it only to log data you can disable a lot of stuff (starting with the GPU) you don't need and you can put it to sleep to wake up every minute for example (NB: not sure it works on the latest one, an older RPi might be better for that, and less expensive as a bonus) which should get you at super low power (less than 10 mA).

And 700 mA really depends on what you do, usually it's less than that and you can downclock it to reduce power consumption further.

I can't add serial com to the 16S (and 8S too probably) as all I/Os are used but I was thinking: if you don't use the heater/cooler and aux outputs (J9 and J10 on the BMSB) you can use the built-in serial port (the one shared with the USB chip) ;) but again, simplest and cleanest is just to not use the ethernet shield and use your favorite com instead.

Edit: I've added the power and HWP reset buttons on the last horizontal layout: https://pastebin.com/YRH5Mdkt of course you can still connect external buttons to the HMIB and/or the BMSB if you want ;)
 
Last edited:
The ethernet shield draws a ridiculous 150 mA. That's not an option.

How does the BMS communicate with, for example, an iPad? Bluetooth? Is that installed in the BMS?
 
That's at 5 V so stil less than a W.

No, no BT, you need to add a wifi AP if you want wireless com.
 
Sorry, but I know next to nothing about ethernet or wifi AP. The most important parameter I want to know is SOC. That's like the gas gauge on a vehicle. Is it possible to get SOC from your unit? Would one require an Arduino with ethernet shield and then a wifi addition? That appears to be fairly high power. What about a led bar gauge on the display?
 
I can do that, it could be a nice compromise between the current version and the numeric display I wanted to add (but it had too much power consumption and was too expensive for the advantages it would bring).

And to save power I can light it for a few seconds with a quick push of the power button (the other tasks of the power button require pushes of at least a few seconds for safety reasons, so a quick push is available for that or something else).

I'm thinking about using the annunciators themselves as a bargraph actually. With the current layout I have 4 columns; two with 8 bars and two with 6. I could do something like SoC, current, battery voltage and something else (temp? but which one?). The big question is the bargraph resolution needed; 8 bars means 9 states so I can do 10 % increments on the SoC.

What do you think?
 
I like that better than all the fault or status led's. It just takes 4 led's to code 15 faults.

A 8 bar column would work to display SOC.

But I don't see how current or voltage would work. Perhaps 4 columns of 9 bars each to get a 4 digit readout?

I agree, the led's shouldn't be active all the time.

No softwareSerial on a spare port?
 
Not sure it was clear. I keep the annunciators as they are but they double as giant bargraphs.

For example the first left column would be:
Code:
                - 100
RCVY CKT FAULT
                - 80
PRECHG CKT FAULT
                - 70
BATT OVR VOLTAGE
                - 60
BATT LOW VOLTAGE
                - 50
CELL OVR VOLTAGE
                - 40
CELL LOW VOLTAGE
                - 30
OVR CHG AMP ST
                - 20
OVR DISCH AMP ST
                - 10

So for example if OVR DISCH AMP ST, OVR CHG AMP ST and CELL LOW VOLTAGE are lit then it means the SoC is between 30 and 40 %.

Current would be the same but probably with semi logarithmic intervals to be more useful; something like 2, 5, 10, 20, 50, 100, 150, 200 and 300 A.

No softwareSerial on a spare port?

As I said before I don't have a single I/O left. The two options are to use the built-in port if you don't use the heater/cooler and aux outputs, or to use the SPI port (but you can bit-bang any protocol of your choice if you don't like SPI) instead of the ethernet shield.


NB: I need to change some resistors values on the HWPB for the NMC chemistry because I forgot it was for 14s instead of 16s packs.
 
Last edited:
  • Like
Reactions: Cal
For me or for @Cal ?

For me I want the ethernet, I'll have too many nodes, too far appart for others protocols to be ok. And there's the others advantages like built-in error correction, super standard and widespread protocol, very easy adressing and grouping even with thousands of nodes, ...

For Cal it'll not help as it's just a single ended to differential signaling translator. What could solve the problem would be something translating the protocols themselves but then software to handle ethernet packets over RS232 would be quite complex on Cal's MCU side.

Best and simplest solution is just to not use the ethernet shield and use the now free'd I/Os on the SPI port for RS232 or any other protocol he wants ;)
 
I'm not sure how the ports are utilized. Is the heater signal assigned to one dedicated port? Just wondering, can you combine all the faults, status indicators and individual commands into one digital word, and then just use one port? 8 bits = 255 specific faults, indicators or on/off commands. Don't have to combine all of them, but some?
 
I put the BMSB schematic in attachment of this post ;)

One I/O is in charge of the heater/cooler output (J9) and another one for the auxiliary output (J10) so if you don't use those outputs then the I/Os on the arduino (D0 and D1) are free for some serial com. But that's only 2 of them so the best solution is to use the SPI port (D10 to D13) with the SPI protocol or you can use those I/Os for your own protocol (RS232, I2C, custom, ...) ;)

The balancing (16 bits for a resistive one, 32 bits for a capacitive/inductive one) and annunciators (23 bits) are already combined and use only 3 I/Os (D3 to D5).

Then one I/O of the arduino is used for the power button, another one is used for the watchdog, 6 I/Os are used to control the MUXs, one I/O is used to select the ADC and for the data it shares the SPI port with the ethernet shied (or your com instead), 3 I/Os are used to control the DPB, and the last 3 I/Os are used for the fire, heater/cooler and auxiliary outputs.

Edit: now that I'm thinking about it on the future 8s version I can free 3 I/Os by adding a shift register to control the MUXs, but I can't on the 16s version as I don't have any room left on the PCB.
 

Attachments

  • BO_BMSB_1630.pdf
    279 KB · Views: 9
Last edited:
  • Like
Reactions: Cal
One I/O is in charge of the heater/cooler output (J9) and another one for the auxiliary output (J10) so if you don't use those outputs then the I/Os on the arduino (D0 and D1) are free for some serial com. But that's only 2 of them so the best solution is to use the SPI port (D10 to D13) with the SPI protocol or you can use those I/Os for your own protocol (RS232, I2C, custom, ...) ;)

The SD card reader uses SPI. They are dedicated data pins 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK) on the Nano. Not sure, can I connect SD card reader directly to those pins? Data logging becomes very simple as there's no need for communication to another Arduino. There is issues as D12 & D13 are used by the ADC and D10 & D11 are dedicated for ethernet shield.
 
Yes you can do that no problem. The way SPI works is that MOSI, MISO and SCK are shared with all the devices and each slave device has a dedicated SS (slave select) line on the master device. The ADC SS is D9 and the slave select for the ethernet shield is the standard D10, then D11 to D13 are shared between the two. You can replace the ethernet shield by something else like your SD logger for example. All you need to do then is change the software to write data to the SD card instead of doing the com via the ethernet ;)

D10 & D11 are dedicated for ethernet shield.

That's just a note I made for myself when I started to remember to not use those pins for something else. You can use them for something else than the ethernet shield if you don't use it.

Actually you can even keep the ethernet shield and use D0 as a SS for your SD card logger if you want ;)
 
Sounds like an excellent plan. Connect SD card logger directly to your board using SPI and D0 for SS.

Perhaps you as well have use for a logger? Think of it as a cheap oscilloscope.
 
Perfect ;)

I'll log data too but it'll be centralised on the same server as a lot of other things (heat pump, hydronic floors, CMV, ...) and I'll have a central interface to check everything.
 
Current would be the same but probably with semi logarithmic intervals to be more useful; something like 2, 5, 10, 20, 50, 100, 150, 200 and 300 A.

The derated current of a 300A shunt is around 200A. That should be the last indicator. A semi logarithmic scale is a good solution.
 
o_O Hard to fathom 300A continuous at 48V. To put that into perspective, that's a load of 120A at 120Vac.

It doesn't hurt to have some derating.
 
Well it was not simple to design the DPB but it should be okay thermally, the only thing where I'm somewhat worried is if it'll handle the inductive spike during a short-circuit interruption properly; it should but the margin isn't as high as I'd like (still around 200 % IIRC but, yeah, I like big safe margins when talking kA...).

I designed everything with some margins on top of the worst cases so it should be okay, there's plenty of derating built-in, but I still need to test in real life to be sure of course ;)

NB: I learned a word, never saw fathom before :)
 
So on the list of small things to do better I have "replace U150 on the BMSB by a faster op-amp with a better Vos and dVos/dT".

I'd like an op-amp capable to achieve those specs:
Code:
Vos:            < 500 µV
dVos/dT:        < 1 µV/°C
Ib:             < 10 nA (100 µV @ 10 k)
CMRR:           > 100 dB
BW:             > 3.5 MHz
Slew rate:      > 20 V/µs
Settling Time:  < 1 µs (to 0.1%, G = 1, Vo = 10 V step)

Currently I use this op-amp (values are worst case ones, the ones inside the brackets are the typical ones):
Code:
OPA4990IDR - 4 chan - 1.56 € /10
https://www.mouser.fr/ProductDetail/Texas-Instruments/OPA4990IDR?qs=P1JMDcb91o5ndpCpWVI9pQ==
Vos:            +/- 1.75 [0.3] mV
dVos/dT:        +/- ? [0.6] µV/°C
Ib:             10 [?] pA
CMRR:           100 [115] dB
BW:             1.1 MHz
Slew rate:      4.5 V/µs (G = 1)
Settling Time:  4 µs (to 0.1%, G = 1, Vo = 10 V step)
Iq:             0.16 mA/chan

As you can see it's barely meeting the new specs and badly failing at the speed one. So I looked for a better one and found two (plenty more were excluded because not meeting all the specs or being too expensive for barely better specs than the OPA4990).

This one (which is actually the big brother of the one I already use):
Code:
OPA4991IDR - 4 chan - 1.83 € /10
https://www.mouser.fr/ProductDetail/Texas-Instruments/OPA4991IDR?qs=%2Fha2pyFaduibGrCNoVC70EahNo7VIIr1qcTfJFa84Fg1z6E0PXPOLg%3D%3D
Vos:            +/- 780 [125] µV
dVos/dT:        +/- ? [0.3] µV/°C
Ib:             10 [?] pA
CMRR:           109 [130] dB
BW:             4.5 MHz
Slew rate:      21 V/µs (G = 1)
Settling Time:  2 µs (to 0.1%, G = 1, Vo = 10 V step)
Iq:             0.75 mA/chan

It's basically twice better as the 4990 one while being just a bit more expensive. But still a bit slow to my taste.

So I found this one, and hold on to your hats...

Code:
OPA2189IDR - 2 chan - 3.11 € /10
https://www.mouser.fr/ProductDetail/Texas-Instruments/OPA2189IDR?qs=BZBei1rCqCA%252BTyrvqQM%2Fcw%3D%3D
Vos:            +/- 8 [1.5] µV
dVos/dT:        +/- 0.05 [0.01] µV/°C
Ib:             10 [0.07] nA
CMRR:           146 [168] dB
BW:             8 MHz
Slew rate:      20 V/µs (G = 1)
Settling Time:  0.8 µs (to 0.1%, G = 1, Vo = 10 V step)
Iq:             1.8 mA/chan

It's 4 times the cost of the 4990 (I need two of them as it doesn't exists in a 4 channels package) but boy, those specs are incredible :love:

I basically almost don't need to care about the offset voltage and temp drift anymore, and it meets the speed specs. The max Ib is right at the limit I set but the typical value is so much lower than the max value that it'll be ok (it only get that high because I used the -40 - +125 °C Ib. The 0 - 85 °C Ib value is already plenty fine, and the absolute max temp for the BMS will be 60 °C so Ib will be at least an order of magnitude lower).
 
Last edited:
  • Like
Reactions: Cal
Back
Top