Weaving the loom

This week I have mostly been focused on getting the car wired up.

Inverter connection housings

With the battery box and inverter mounts in, the first issue I had to solve was the connections on the inverter, which were now fouled at the back by the firewall and at the side by the wheel well/strut housing. I tackled the low voltage connections first, looking at various ways to re-route the large 36-way AMPSeal connector that comes with the EVBMW kit. Initially I was thinking the connector would have to go underneath the inverter, which would have been a total ballache. Then one day I left the loom I was making up sat on top of the inverter and realised there was just about enough space there.

I took my original design for the AMPSeal housing and flipped it through 180 degrees so that the connector came out on top and pointed towards the front of the car rather than the back. Then I added a shell to the back to leave space for the IDC cable that comes from the inverter and the connectors. Amazingly I nailed most of this first time, after some major 3D printing issues. However I didn’t leave quite enough space for the solder tabs on the back, meaning I lad to print an extra shim to give enough space. I’ll revise the design down to two parts at some point but have posted my current version here.

This all fits beautifully, as you can see. Very happy with this layout as it gives nice easy access to the connector.

Modified ampseal shroud
Modified ampseal shroud 2

What I haven’t done yet is sort out the high voltage connections on the side. These already needed work as I now need three connections: one for ground, one for driving the motor, and one for charging/the DC-DC converter. I think I explained this in a previous post, but basically I have an extra contactor in my high voltage junction box that allows me to engage or disengage drive so that when the inverter is acting as a charger, juice can get to the batteries but not the motor.

In addition to adding the third terminal, I also need to shorten the whole assembly by a centimetre or two so that it doesn’t foul the side of the engine bay. Shouldn’t be too hard I don’t think, though worst case I may need to have the brass standoffs I got from EVBMW turned down slightly. I certainly need a third one making up.

Since I wrote the above I have now redesigned the high voltage connector, knocking about 20mm off the depth, which should be enough to clear the side of the engine bay. I’ve also added the third terminal for charging. I’ve ordered some shorter brass standoffs without the flange on that the EVBMW kit has. Beautiful as those are, and useful as the flange is in holding my 3D-printed shroud in place, space is really at a premium for me. The 16mm diameter standoffs I have ordered will still give 100% contact to the crimp terminals at the end of the high voltage cables. And I plan to silicone in the shroud so it doesn’t move.

Wiring Loom

I’ve never made a wiring loom before, but all the instructions I have seen (kudos to Jared at Wrench Every Day) say take it piece by piece, start at one end and slowly build it up. So this is what I did. I started with the battery box since this is where one end of the CANBus terminates, with the connection to the Battery Management System (BMS) I knocked up in a previous post.

One of the other things most guides to building a wiring loom tell you not to do is re-use cables. But I hate waste and all the wires in my BMW loom seemed to be in really good condition. Plus it wasn’t worth much to sell, so I decided to butcher it and re-use as much as I could. I’d already salvaged the exterior plug from the battery box so I started with this and added some nice long tails to the relevant connections, noting all the wire colours and pin assignments as I went along.

I then took this first piece to the car, put the connector in place and ran the wires to the high voltage junction box, or as close to the new auxiliary fusebox location if that was where they were due to go. I then trimmed the wires to the relevant lengths and started on the junction box connector

I didn’t have a any good salvage parts for this so a few weeks ago I ordered a nice waterproof 16-way connector from AliExpress. This was actually reasonably easy to wire up, and has enough pins to carry individual positive and negative feeds for each of the contactors and the pre-charge relay, as well as power and CANbus connections for the shunt. What it can’t carry is connections to sense the position of the three contactors. The Gigavac contactors I’m using all have a second set of tails to allow you to sense whether they are open or closed, which it would be nice to sense and send to my VCU for debugging. Or I could just stick three LEDs in the side of the HVJB. This could just be me gold plating things though.

Battery box connector
Battery box connector 2
High voltage junction box plug

From the HVJB the loom goes to the Inverter and its 36-way AMPseal connector. From here it splits off in multiple directions:

  • to the motor for temperature and position sensing
  • to the cabin for throttle position (one 7-core cable), fwd/reverse switch, ignition sensing, brake sensing and cruise control (second 7-core cable)
  • to the VCU (CANBus, plus third temperature sensor (oil temp) from the motor)
  • to the new auxiliary fusebox (for obvious things)

Inside the space where the ECU used to sit (nicely water-sealed with lots of re-usable rubber grommets) I’ve hacked out most of the old wiring. Five bundles still enter this space:

  • The X6004 bundle (for BMW nerds) gives me CANBus to the instrument panel and the ABS/DSC system, as well as various other outputs to control the instruments. I’ve not tapped into this yet but aside from the CANbus, these will mostly be linked into my VCU.
  • Three medium-sized wires (I’m no good on gauges) come up through a four-way ampseal connector (I’ve salvaged both sides). One provides me with a switched live signal from the ignition and based on the BMW colour coding (red and white) it looks like it takes a return switched live, though this is currently disconnected (I’m sure I’ll find out what it was meant to do when something doesn’t work). I have linked the switched live signal to a 12v relay and from there to the auxiliary fusebox, an 8-way affair I picked up on eBay. Most of the things I want to drive only need to be on when the car is on, running, or charging. I will configure something to trigger this relay when the car is charging as well.
  • Two fat red wires provide permanent live, splitting into two, two-way connectors which again I have salvaged.
  • Three brown wires head off to earth
  • Two more wires come up into a two-way connector and honestly I haven’t worked out what those are for yet

I have now added female spade connectors to most of the positive connections so that they can be attached to the auxiliary fusebox. And I just soldered the negatives to the chopped off earth wires, though I will need some more when I add the VCU and monitor

The two shielded 7-way cables my daughter and I chased through the firewall a few weeks ago have now been spliced into the relevant places in the cabin. An extra crimp connector salvaged from the four-way AMP connector above gave me a ‘push to make’ signal from the brake pedal to give the braking signal to the inverter. And I traced the ignition cable to the keyswitch and spliced a connection into this for the ‘start’ signal the inverter requires. This all leaves me with only one tell-tale sign that this is an EV in the cabin: a fwd and reverse switch in the centre console. When we’ve done the body conversion I might look for a more subtle alternative.

Butchered amp plug for extra connector
Recovered connector from butchered amp plug
Modified brake pedal connector

The throttle signal cable terminates in a four-way connector salvaged from the old loom, since two of the wires are just 5V and two are for GND, leaving the last two being actual signals from the throttle position.

The rest of the signals are currently terminating in a connecting block, but a six-way male/female AMP pair is on its way.

Once everything is tested and working, the loom will be wrapped in cloth tape and routed through grommets where possible.

Wiring loom in progress


I now have a rudimentary vehicle control unit knocked up. It’s a little bodged together with dupont pins and jumper cables at the moment but it works. It takes information from the inverter over CANBus and right now uses the inverter state to turn on or off some of the eight way relays. These allow me to turn some things on only when the inverter is in ‘run’ or ‘charge’ mode (like cooling), and do some thermostatic control. I can also pull temperatures from the inverter over CANbus (including the motor temperatures) and I plan to measure the motor temperature directly as well (there are three thermistors in there and the inverter only has connections for two).

I wrote a little test-script for the hardware for my vehicle monitor to make it cycle through the state codes the inverter sends as a test, and the VCU does exactly what it should for now. Simple but pleasing nonetheless.

The VCU will also be responsible for parsing data from the inverter and feeding it to the instrument panel – e.g. RPM, coolant temperature etc. All that work still to come. And it needs properly boxing in too.

I’ll post all the hardware details and pin connections for the VCU over on the components page when it’s done, along with designs for the final case.


I want to be able to keep an eye on the state of my car when it’s on the driveway and charging, as well as maybe having some remote control for warming it up etc. To this end there will be an extra device on the CANBus: an ESP8266 running esphome. ESP8266s are my favourite little chip. Cheap and plenty capable with integrated WiFi. With the addition of the MCP2515 CANbus interface, I should be able to feed all the data I want back to Home Assistant.

The hardware on this is all done now and since it’s not a critical part, I’ll probably leave it as is. I’ve designed and printed a simple case for it that with some silicone should keep everything nice and sealed and dry. Only question is how well the WiFi will penetrate with all the noise – especially when it’s charging.

Inverter as charger

Final part of this very long update. I’ve finally stripped the EVBMW board back out of the inverter and dropped it off with my local repair shop to have the microcontroller for the charger replaced with one that already has a bootloader on it. Not sure if I documented this but I and others have had no joy getting a bootloader onto these chips through the normal means, but it seems to work fine once you swap it out for one with a bootloader pre-loaded.

With this in place and a few more bits of hardware (a caravan-style mains connector), I should be ready for the extremely scary prospect of charging my batteries up if/when there is some software available for this function.

This isn’t plug and play. For example, you need to ensure that the inverter capacitors are pre-charged from the AC or from the batteries before you dump current into them. But 240V mains plus 300V DC. What could possibly go wrong?…

VCU and monitor

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.