# Nissan Leaf BMS & Charger with P&S conversion



## dbargaehr (Nov 4, 2018)

Probably a silly question, but I can't seem to find the answer anywhere:

I just bought a 2011 Leaf with only 25k miles on it (which is pretty cool).

My plan is to buy a P&S leaf controller replacement board and completely heist the inverter/controller, motor, and batteries.

I'm curious what other parts of the Leaf can be pilfered to avoid expensive buys. 


Particularly interested in the BMS and Charger units specifically.

will they still function within that type of conversion? as I prefer not to use the Leaf in "hat car" mode (i.e. not be beholden to a plethora of now-useless sensors I have to try to squeeze into a '71 Super Beetle).


----------



## Tremelune (Dec 8, 2009)

Ditto.

It seems that most of the Leaf CAN messages have been decoded, though the info seems to be pretty scattered.

I'm very surprised nobody has come out with many products that can interface with the components yet. A used Leaf BMS is $100 (compared to an Orion, which is over $1000), though it's possible it's missing important features or something.

Charger cost is comparable with something like the Lear charger found in a Chevy Volt (which Thunderstruck offers a controller for), though a Leaf fast charger will be quite a bit...faster...and still cheaper if purchased as part of a full car.


----------



## dbargaehr (Nov 4, 2018)

Tremelune said:


> Ditto.
> 
> It seems that most of the Leaf CAN messages have been decoded, though the info seems to be pretty scattered.
> 
> I'm very surprised nobody has come out with many products that can interface with the components yet. A used Leaf BMS is $100 (compared to an Orion, which is over $1000), though it's possible it's missing important features or something.


I've seen so many useful on Endless Sphere, MyNissanLeaf, and this forum (among others) in various states of (in)completion. My bookmarks folder for this project is so scattered! 

Before I ditch the idea of the "hat-car" by tearing the leaf apart and investing in the P&S board I just want to make sure its the right path to head down.


----------



## Tremelune (Dec 8, 2009)

For sure.

Why the P&S board over the Thunderstruck VCU?

Here are my scattered notes:

https://docs.google.com/document/d/1E0och_HU1yV6I-8e5539t6atiZt4ecJHG2AYeIw0CXc/edit?usp=sharing


----------



## jkelly (Sep 18, 2017)

My son (Isaac97 on this forum) was able to use the Leaf BMS, controlling it with an Arduino, and he posted the info (including a link to his Arduino code) here. https://www.electricboxster.com/components If you want to discuss with him, reply here and I'll tell him about the thread and he will join the conversation.


----------



## Tremelune (Dec 8, 2009)

jkelly said:


> My son (Isaac97 on this forum) was able to use the Leaf BMS, controlling it with an Arduino, and he posted the info (including a link to his Arduino code) here. https://www.electricboxster.com/components If you want to discuss with him, reply here and I'll tell him about the thread and he will join the conversation.


This is _massive_. Getting the Leaf BMS and charger working would save me $2k (as well as anyone else working with a "complete" Leaf donor). No amount of searching turned this page up (seems to be a common theme with various one-off EV conversion blogs).

I'm gonna take a stab at this, and I'm sure I'll be in touch.


----------



## MattsAwesomeStuff (Aug 10, 2017)

I'm not sure exactly what the range of this hack is.

I would like a cheap BMS. I am not using any other Leaf parts.

Can I just grab a Leaf BMS, slap some code into a Teensy/Arduino/whatever, and use it? Or do I need other Leaf guts and brains? How modular is this hack?


----------



## Tremelune (Dec 8, 2009)

The code linked above is very specific to the Leaf BMS, and very specific to the "Teensy" Arduino board. If you don't use the full Leaf battery pack, you might have to do a bit of soldering to the BMS board (I'm not too sure about that, but if you follow those links, it's discussed, and some have done it with success).

If you buy the same Arduino board, the same CAN adapter board, and grab the code from Github, I believe you would then just "deploy" the code to the Arduino, connect the wires as specified in them links, and it'll start clicking and feeding data to Leaf Spy (assuming you have Leaf Spy, a Bluetooth OBD2 adapter, and the wires correct).

After that you would need to interface with a charger. The one Thunderstruck sells has an accompanying CAN controller that you would need to interface with. I dunno how to interface with the Leaf charger, but it's a $1000+ prize if you can...particularly with the 6.6kW charger.

I've chased links all over the Internet, and I'm still unable to find a page that documents the "decoded" Nissan Leaf CAN bus protocol that I've read so much about.


----------



## Isaac97 (Jun 3, 2019)

Hi - I'm the one who wrote the code for the Leaf BMS.
I have decoded the Leaf BMS CAN protocol in sufficient detail to be able to use the BMS in my own EV. 
The specs for the various CAN frames were both deduced from observation and taken from this thread. The packets are identified by the 4th byte in the first packet of the response.

Packet - a single CAN frame. Index and 7 bytes of data
Group - a group of data containing specific information; there are 6 groups.

To request a group of data you need to send a request packet and then ask for all the packets.
Each group's length is different. 'Group 2' (ID 0x02) contains 29 packets; thus its index rolls over once. 

In the first packet, there is the index, 3 ID bytes, and 4 data bytes. Remaining packets have the index and 7 data bytes.
You can tell a SOC group from a cell group by the first packet. The 4th byte in the first packet is the group number.

Group 2 is the most important.

To read a group, send a request (ID 0x79b):

0x02 0x21 (group) 0x00 0x00 0x00 0x00 0x00

The group is the only byte which needs to be changed.

First response (with ID 0x7bb):

0x10 (group size?) 0x61 (group) (data) (data) (data) (data)

First byte is an index; upper nibble is 1 in the first response, 2 in the rest. Lower nibble increments and wraps back around.

The remaining lines must be requested separately within about a second of the first request. Either use 0x30 0x01 0x00 0xff 0xff 0xff 0xff 0xff (requests lines one at a time) or 

0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (requests all lines remaining in the group).


Responses are (index) (data) (data) (data) (data) (data) (data) (data)


Cell voltages in group 2 are 2 bytes each, so there are 2 in the first frame and 3.5 in subsequent frames.

In group 1, the SOC is the last 3 bytes on the 5th line. AH capacity is bytes 3,4,5 of 6th line.

In group 3, Vmin (lowest cell) is the 13th and 14th data bytes; Vmax is 11 and 12.

Let me know if you need anything else.


----------



## Immo1282 (Jul 12, 2019)

Isaac97 said:


> Hi - I'm the one who wrote the code for the Leaf BMS.
> I have decoded the Leaf BMS CAN protocol in sufficient detail to be able to use the BMS in my own EV.


Do you know if it'll balance an incomplete number of cells? I'm looking to put 42-44 (depending how many I can squeeze in once the donor car's on the driveway in bits) of the modules from a Leaf pack in... It'd be great to knock £1000 off the project budget if I can 

Something like the Orion BMS2 is always an option (and perhaps a better one if I just wanted to get things working faster), but I'm keen to keep costs low if possible.

Fantastic work though - This is a fairly big deal for anyone wanting to use Leaf parts in their conversions.


----------



## Tremelune (Dec 8, 2009)

From this thread:

https://www.mynissanleaf.com/viewtopic.php?f=8&t=17470&start=20



> Anything less than the original 96 cells will require rewiring of the BMS board and some care to not burn out the ICs.


nikmaster then posts how he got half the Leaf pack working by rewiring some diodes.


----------



## Tremelune (Dec 8, 2009)

More info on the CAN protocol that Isaac97 is talking about:

https://www.mynissanleaf.com/viewtopic.php?f=44&t=11676

The spreadsheet with lots of stuff that I don't fully understand (I think this is the "Leaf CAN bus decoded" doc that has alluded me):

https://docs.google.com/spreadsheets/d/1EHa4R85BttuY4JZ-EnssH4YZddpsDVu6rUFm0P7ouwg/

It's worth noting that there are _tabs_ along the bottom...It's several sheets! I missed that the first time around. I feel like I still need a Rosetta Stone to figure out what these spreadsheets mean...I believe the "79b-7bb" tab is the BMS stuff mentioned above.

WolfTronix thread on decoding this stuff:

https://www.diyelectriccar.com/foru...nginnering-nissan-leaf-bms-serial-169225.html

WolfTronix video describing how the the "black and gray connector" BMS protocol differs from the "all white connector" BMS protocol:

https://www.youtube.com/watch?v=pyUQn75jWd0


----------



## Isaac97 (Jun 3, 2019)

Immo1282 said:


> Do you know if it'll balance an incomplete number of cells? I'm looking to put 42-44 (depending how many I can squeeze in once the donor car's on the driveway in bits) of the modules from a Leaf pack in... It'd be great to knock £1000 off the project budget if I can
> 
> Something like the Orion BMS2 is always an option (and perhaps a better one if I just wanted to get things working faster), but I'm keen to keep costs low if possible.
> 
> Fantastic work though - This is a fairly big deal for anyone wanting to use Leaf parts in their conversions.


The Leaf BMS will not balance less than 48 modules (96 cells) without serious modification; you would have to replace the main microcontroller on the board as seen here

The Leaf BMS has a very low balancing current; about 10mA. Therefore it is really only useful as a monitoring system, which is fine if your cells are already balanced. 
The Orion BMS2 is capable of CHAdeMO which is very useful. On the other hand DIY CHAdeMO is not too hard to do.


----------



## CanadaLT28 (Oct 15, 2011)

Isaac97 said:


> DIY CHAdeMO is not too hard to do.



Do tell.... I will need a fast DC charge system for my 2 - 4 Volt packs and don't know how to do it


----------



## Tremelune (Dec 8, 2009)

DIY CHAdeMO:

https://www.electricboxster.com/page-3

Specs/code:

https://github.com/collin80/JLD505

https://github.com/Isaac96/EV-Code/tree/master/IJLD505


----------



## Sentinel Rock (Mar 15, 2021)

Tremelune said:


> From this thread:
> 
> BMS Details - Page 3 - My Nissan Leaf Forum
> 
> ...


Could you please tell me if this worked to balance the batteries?


----------

