Developing ‘EV-peripherals’

Three cooling circuits with pumps, valves, electrical high voltage heater with blower, airconditioning with blowers, dual CAN-BUS and much more. In the end the car will be packed with electronics. One of the first blogposts on this topic was controlling the Pierburg CWA pump with Arduino in February 2017.  After that in May 2018 controlling the heater ventilation, in August 2018 the OLED screens in the speedometer and in February 2019 controlling the cooling system valve.  I have not written much about this topic, but overall a lot of things have happend with special thanks to Erik Ciesluk for his help and support!

My wiring diagram emerged step by step.


As I went along new components and functions were added. Initially I had chosen an Arduino Mega as microcontroller because of the large number of inputs and outputs. I was advised to also look at the Teensy 3.6 since not only does it have a lot of I/O’s, it also has CAN-BUS onboard.

Switch to Teensy 3.6

It’s not a 100% Arduino board, but an Arduino compatible boord. The functionality I had developed so far could also be implemented in the Teensy so I switched.

Gate driver

That does have some implications since the Teensy has 3.3V logic whereas the Arduino Mega was 5V. So now I need gate drivers for all mosfets.

Gate driver

And so I started from scratch with a new diagram.

New Teensy schematic

At a certain point in time I decided to count the number of connections: 97!

97 connecties

That did trigger the question, how am I going to organise and connect all that. So I reviewed and compared various connectors.

  • TE Ampseal
  • TE Superseal
  • Molex CMC/CMX
  • TE Econoseal 070
  • Deutsch DT
  • Deutsch DTM
  • Molex MX150 34830 Series

To come to a decision I used the following criteria:

  1. Number of pin count variations
  2. Allowed amps
  3. Usable wire size
  4. Costs of the official crimp tools

In the end I have chosen the TE Ampseal connector.

TE Ampseal connector

It’s available with 8, 14, 23 and 35 pins with both horizontal and vertical mating chassis connectors for the PCB. Max current is 8 amps when using tin contacts and even 17 with gold. The crimp pins are available for wire size 0,5 to 1,25 mm2. For the CAN-BUS and wiring of the OLED screens the lower value of 0,5 mm2 is quite thick but not really a problem.

So then I started thinking about what connector combination to use and which function to output where.

Pinout keuzes

I ended up having a 35 pin twice, a 23 pin and a 14 pin connector.

Testing functionalities and currents

Next it was time for some more testing. For example to answer the question ‘What is the real current draw of the fans?’

Controller en battery fan 2.9A
Controller / battery fan uses 2,9A
Motor fan 2.7A
Motor fan uses 2,7A

Switching those fans, 12V leds and some more stuff is being handled via the microcontroller. Together with my son we made a “12V switch” on a breadboard.

Gate driver test met Sven

Unfortunately that did not work yet, the 12V battery symbol led did not switch off.

Later on I discovered I had forgotten to add the resistor in the pullup and used a piece of wire instead.

Pullup 0h fail

After rebuilding the circuit it worked!

The 12V blowers are slightly more difficult to control. I want independent variable speed control for the heater and airconditioning blowers. I am using a PWM control with modified frequency to prevent an audible noise. It already worked on the Arduino Mega and now also on the Teensy.

As I went along, the wiring diagram became more and more complex.

Schema aansturing randapparatuur

Unfortunately not everything was running as smooth as it should in particular the blower control so I went to Erik who helped me out.

Using his scope he found out that despite the flyback diode the circuit was still facing voltage peaks caused by PWM switching the blower. A Schottky diode instead of a regular diode probably would help.

Scope met Erik

Hardware design

While everything started to come together in terms of electronics I started working on a schetch of the PCB size and rough layout in Onshape. I’m going to outsource the layouting of the PCB and since the available space is limited a detailed briefing is required.

Printplaat schets in OnshapeFor most of the components datasheets and dimensions are available but not for all. One of them is the watchdog I am using. It monitors whether the microcontroller is still running and if not resets it. I’ll stack that upside down onto the PCB.

Watchdog footprint

The first couple of components have been positioned.

Globale print

Next step was checking whether the size and connector positioning would indeed fit in the car so I made a mockup out of cardboard.

Mockup behuizing

Further testing and developing functionalities

Earlier I got a small OLED screen to integrate into the speedometer up and running on the Arduino Mega. I had to redo this for the Teensy.

Praktijktest OLED helderheid

In the end I got that working too. I’m using the U8G2 or U8x8 library by Oliver Kraus.

Teensy OLED

That library included some functionality to adjust the brightness of the screen. Although the controller should support that I could not get it to work.

Instead I’ll be using some window tinting foil to reduce brightness.

PWM control pump and valve

Similar to variable speed control of the blowers I also want to dynamically control the motor and batteries cooling pumps. The Pierburg CWA50 pumps I’m using have a PWM signal input. Furthermore I want to control the valve using a microcontroller. So I wrote some code and started testing.

Arduino IDE Pump control

Unfortunately that did not work out as planned. The pump ran full flow and the valve position did not change.

Pomp testen met Sven en Jiri

So I started from scratch again with all components on a breadboard.

Breadbord leegmaken

In the meantime I did buy a LabNation PC scope so I was able to analyse the signals like I did together with Erik.

Labnation scope

Now I could also check the voltage spikes of the blower and confirm that using a Schottky diode indeed did help.

Labnation output

Ultimately I managed to get it to work. In the below video you can see the flow increasing and decreasing automatically and the valve position changes by pressing a button.

This was one of the last pieces of the puzzle and now the input and detailed briefing for the PCB designer was ready:

Then it was a matter of awaiting the result.

Leave a Comment


OldVolvo is a classic Volvo hobby blog by Lars Rengersen.

Also electric?

Do you also want to convert your car (Volvo or another brand) to full electric? As a spin-off of my own EV conversion project I started EVcreate for 'enabling EV conversions'

More info