DIYBMS v4

Just starting to build diyBMS after monitoring the project for a year or so! I have one question and one bit of help for others trying to compile.

Question: @Stuart - great job on the diyBMS. I’ve seen mention of a 4.3 version and I’m contemplating getting 4.21 boards made and populated. Should I hold off until a 4.3 arrives and can you give any clue as to what changes?

Help for others: I wanted to try building the controller and boards with Vscode and PlatformIO (I know there’s a binary image which I tested first and worked fine but I wanted to try and at least get a dev env setup as I’ve never used vscode/pio and now seems a good time to try). Installed git client 2.26.1, then vscode then platformio extension. Restarted etc. Downloaded the diyBMSv4 code project and extracted, imported into PIO and tried to build. I kept getting the following:

Processing nodemcuv2 (platform: espressif8266; board: d1_mini_pro; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 2.4.0 > WeMos D1 mini Pro       
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20603.200130 (2.6.3) 
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.20800.0 (2.8.0)
 - toolchain-xtensa 2.40802.191122 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
LibraryManager: Installing Queue
git version 2.26.1.windows.1
Cloning into 'C:\Users\James\Documents\diyBMS\diyBMSv4Code-master\ESPController\.pio\libdeps\nodemcuv2\_tmp_installing-_80009e7-package'...
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\James\\Documents\\diyBMS\\diyBMSv4Code-master\\ESPController\\.pio\\libdeps\\nodemcuv2\\_tmp_installing-_80009e7-package\\.git\\objects\\pack\\pack-623d5a9a5a5175f4be991ef6b53f75fb319f537a.idx'

No amount of searching on here or googling led me to resolve the problem. After a few hours of trying to figure it out I noticed it seemed to be creating directories for each library it was trying to get but failing to rename the tmp… folder to it’s actual name (feels like trying to rename too fast). Yet when I re-ran the build it would complete the rename and move to the next library and then fail again in the same way. By simply clicking build about 10 times (once for each library) it would eventually get through all the libraries and complete those without the Winerror 5. Before figuring this out I had deleted and re-extracted the project code a number of times before I ever tried building it enough times to complete all the library downloads.

Then the next issue causing build to fail:

In file included from .pio\libdeps\nodemcuv2\AsyncMqttClient\src\AsyncMqttClient.cpp:1:0:
.pio\libdeps\nodemcuv2\AsyncMqttClient\src\AsyncMqttClient.hpp:12:25: fatal error: ESPAsyncTCP.h: No such file or directory

I didn’t actually see the message below that about “Looking for the ESPAsyncTCP.h dependency?”. However, I found that adding the following line in the lib_deps of the project platformio.ini file just before ESPAsyncWebServer.git fixed it completely (after having another winerror5 on renaming the folder and just clicking build again):

> https://github.com/me-no-dev/ESPAsyncTCP.git

Saved the file. Now it builds perfectly. I just wanted to put this information here in case anyone else is starting from scratch and gets into the same situation I did and doesn’t know why their build fails or what to do.

They are the same circuit. 4.21 is optimised for building at jlcpcb, it’s also cheaper.

4.21 works well files for this are here, note this design is NOT suitable for handsoldering:
[Release 4.21 · stuartpittaway/diyBMSv4 · GitHub]
[https://github.com/stuartpittaway/diyBMSv4/tree/jlcpcbassembly]

v4.0 is basically the same design, but is suitable for hand soldering.
[GitHub - stuartpittaway/diyBMSv4: Version 4 of the diyBMS]

Version 4.3 won’t make it out into the world as it currently stands (there are faults in the design) and its not fundamentally different from the above, it uses the same code.

1 Like

Thanks @jamesb

PIO is designed to resolve all the dependency files automatically, thats one of its big selling points, strange that you had so many issues compiling.

Agreed
[Release 4.21 · stuartpittaway/diyBMSv4 · GitHub]

1 Like

@gazzaman2k as @GeorgeBoudreau mentioned he is using the AZ432 chip which is the same design as the v4.21 boards on the LEAF version.

AZ432ANTR-E1 = VOLTAGE REFERENCES 1.25V 18V ±0.5% 20PPM/°C SOT-23(SOT-23-3) ROHS

This part is currently out of stock on JLCPCB, a similar part is this.

TL432G-A-AE3-R = VOLTAGE REFERENCES 1.25V 15V 50PPM/°C SOT-23(SOT-23-3) ROHS

It should be a drop in replacement. There are other components that would work, but these are much more expensive.

Thanks for confirming the status of 4.3.

Have just ordered 4.21 with assembly from JLC (and controller board) - swapped in part LCSC part number C171461 for the voltage reference as mentioned earlier. Hopefully will work fine - not sure if anyone has feedback on that yet. If not, simple enough to hot air the part off and put on the original part ordered form somewhere else.

Now I just need to find the best place to order the Attiny841 from.

In the UK, I ordered mine from https://uk.farnell.com/

thanks but not avaliable from any uk supplier…i guess ill have to wait a month for the china boat to come in

@gazzaman2k have you tried mouser for the original part?

https://www.mouser.co.uk/ProductDetail/Diodes-Incorporated/AZ432ANTR-E1?qs=sGAEpiMZZMtz8P%2FeuiupSSAVPHlDJwLn0ACymH4zrGY=

Voltage References 1.25V Prec Shunt Reg 1.25 to 18V 0.05Ohm

Mouser No:621-AZ432ANTR-E1
Mfr. No: AZ432ANTR-E1
Mfr.:Diodes Incorporated

I don’t think this has been tested yet, but I suspect it should be okay

i dont want to pay £12 postage for somthing i only need that costs like £5 :confused: that £12 has got me 70 of them from ali express

ah screw it ive now got 200 of them comming for free postage… anyone need any in the uk let me know :slight_smile:

I ordered them from https://www.microchipdirect.com/product/ATTINY841-SSU directly following @BuffaloPowerWall who did the same

I ordered the D1 voltage reference from AliExpress: 3.78£ 12% OFF|100% New Original Sot23-3 Lm4040aim3-2.0/nopb Patch 2.048v Voltage Reference Source Free Shipping Best Match - Accessories - AliExpress shipping was decent to NL (10 days or so)

Hi there
Is there any chance to order pre assembled battery module boards by JLCPCB?
I was trying to do it but there are two components that not being selected and they are
ATTINY841-SSU
AZ432ANTR-E1
Thanks

At the moment you can’t get them fully populated by JLCPCB as they don’t have the ATTINY (and possible one other now) component. You will have to order them mostly populated and solder on the ATTINY yourself.

Hi again George, i have again been having a play around with the boards today, so i removed the attiny, the opto coupler, R9/R31, R27/R5, R28/R6 & the voltage reference.

i put the IRLML6244TRPBF from v4 as the octocoupler, replaced the 2.2k from R9/R31 with 1.8k as per v4, replaced the 68k from R27/R5 to 475k as per v4 and also the 27k from R28/R6 to 402k as per V4 and put 2 brand new ATTiny841 and two new voltage references ADR5040 again all from V4

so now basically the board is a V4 x 2 using all the same parts as a V4

i hooked it upto my bench voltage power supply put 3v output to get the device to communticate to the controller, measured the voltage and corrected it in the module page…

turned the voltage upto 3.8… no movement, 4.2 no movement either

ive tested the cableing with v4 board again on the bench power supply and that increases/decreases with what the display shows fine.

i think there is an issue with the traces, its amlost like its not receiving the voltage from the battery, the devices power up fine but the attiny isnt reading any voltage changes what so ever?

thanks

Gareth

Can you measure the voltage at the attiny ADC pin, check the resistor divider circuit is working and not shared to ground or positive

on the voltage ref both the bottom pins are commoned together, then they go to the c2/c5 (c2) and then to r4/r26 (r2) then to aref pin13 and the top pin is grounded…

on the v4 the bottom left goes to the cap c2 then onto r2 then to aref the bottom right is gnd and the top is nothing…

thats the problem, too late to go into the garage to sort it ill look into it tomorrow and report back

seems so the AZ432ANTR-E1 uses 3 pins soldered and the ADR5040 only uses 2 pins… if i solder it on a angle it should sort my problem, once the AZ432ANTR-E1 arrive in the post ill build it how it is supposed to be