Battery: Volvo XC40 Polestar 2 - dalathegreat/Battery-Emulator GitHub Wiki
[!CAUTION] Working with high voltage is dangerous. Always follow local laws and regulations regarding high voltage work. If you are unsure about the rules in your country, consult a licensed electrician for more information.
Volvo XC40, C40 / Polestar 2 (SPA platform) battery wiki
Buying tips
Make sure the contactor assembly (Left picture, silver box) is included with the battery. Some places remove it and sell it separately. Without this you wont get contactors,current sensor, precharge, fuses etc., rendering the battery unusable.
[!NOTE] It is OK to buy a battery from an airbag crashed vehicle. It is possible to clear that fault code via the "More Battery Info" page
[!CAUTION] If you want to use Battery-Emulator to read info, check cells, on a standalone battery before buying, comment out any sending of 0x140 messages in the VOLVO-SPA-BATTERY.cpp file. Otherwise it will try to close contactors, and without the DC/DC converter it will permanently lock the contactors as welded. See further down for more info on DC/DC requirement
Battery specifications / Serial numbers
The following SPA platform batteries are supported, checkbox on those confirmed by users to work
- Volvo XC40 2021-present
- 64 kWh (usable), 69 kWh (gross) ✅
- 75 kWh (usable), 78 kWh (gross) ✅
- 79 kWh (usable), 82 kWh (gross) Extended range
- Polestar 2 2020-present
- 64 kWh (usable), 69 kWh (gross) Standard range
- 75 kWh (usable), 78 kWh (gross) Long range ✅
- 79 kWh (usable), 82 kWh (gross) Long range
Wiring diagram, low voltage
Connect HVIL2_EXT_IN and HVIL2_EXT_OUT together with a cable. (this will close the HVIL loop in BECM)
The BECM has no built in 120ohm resistor. (BECM = Battery Energy Control Module) Make sure the terminating resistors are correct. CAN networks should have two 120 Ohm resistors in each end of the network. With everything OFF, you can measure resistance between CAN-H and CAN-L. The result should be 60 Ohm.
Attached below are pictures of the BMS pinout. Connect the pins to the LilyGo and 12V supply like this:
- Pin 42 to LilyGo CAN - H
- Pin 43 to LilyGo CAN - L
- Pin 24 & 33 to +12V
- Pin 47 This wire needs to be connected to the battery casing
- Pin 48 GND
To use the CAN contactors on Volvo XC40 and Polestar2, you need to connect the GND from the battery connector (PIN47) to the battery case. This GND is used for insulation monitoring. Without it, the battery will not be able to check the insulation integrity and will not engage contactors.
Wiring diagram, High voltage :zap:
Here are the ports that you can use on the battery to get voltage out:
Positive LH, Negative RH
Test wires attached:
[!CAUTION] Battery can lock itself if started without DC-DC converter on HV side!
In order to start the battery you need to have capacitance and current draw ready on HV lines. This can be achieved by connecting a DC-DC converter (which you can purchase from the link below) to the high-voltage output from the front motor. If you skip this step and try to start the battery directly, an irreversible fault code will trigger (Contactor welded). After this fault code is set, you won't be able to engage the contactors via the CAN bus anymore.
Connect the DC/DC converter to the high voltage output lines shown above. Pay attention to the polarity to avoid damaging the DC/DC converter
The DC/DC converter can also be used to charge a 12V lead acid battery, or left totally unused. The purpose of it is to mainly just enable contactors safely without triggering any fault codes.
DC/DC connected:
Part numbers
Incase your battery is missing some wires/disconnect switches, here are the OEM part numbers and purchase links. Do note that it might be cheaper to source from your local scrapyard!
Product | Purchase Link |
---|---|
Service disconnect switch 32324494 | Volvoshop |
Low voltage 48pin connector | Aliexpress |
Low voltage 48pin connector with cable (take black one) | Aliexpress |
DC-DC converter | Aliexpress |
How to compile the software for this battery type
Make sure that the settings in the USER_SETTINGS.h
file are correct. The line:
#define VOLVO_SPA_BATTERY
Needs to be uncommented for the software to interface correctly with the battery.
Next step is then to select the inverter protocol that you intend to use. After setting this up, press compile and upload to the board!
CAN controlled contactors
This feature was introduced in 8.1.0
Handy tips
opening the contactor assembly
Use a heat gun to warm up the glued seal between the cover and the bay. Use a lever to open the cover then.