Driver Control Unit (DCU)

The Driver Control Unit (DCU) is the hardware and software providing the best possible driver experience for the OSSEV®. It implements the Intelligent Security & Personalisation (ISP) feature and manages both the and driving profile. It is also responsible for all feedback to the driver via the instruments and controls and Head Up Display (HUD).

The DCU is responsible for enabling the Vehicle Control Unit (VCU), which enables the OSSEV® to be driven.

This diagram shows the main components and the power sources (yellow = 3.3V, orange = 5V, red = 12V). Serial communications are shown in cyan. Digital IO is shown in blue and analogue/PWM in pink. The CAN Bus is shown in green.

Features

Our DCU uses two processors:

  1. DCU1 is used to minimise battery drain and to periodically monitor and report system status over Wi-Fi and future wireless communications channels. It will start up DCU2 when the ignition is on or the car is being charged. In our prototyping we are using an ESP32 processor.
  2. DCU2 is a more powerful processor with more IO capability and is used to manage the main car functions, the OLED display and cooling when the car is in use or being charged. DCU2 can signal to DCU1 that it is still busy (e.g. cooling the batteries) and DCU1 will wait until it has finished before switching it off.

The DCU supports the following features:

User Experience

Before going into the design detail, it is worth describing the user experience we are aiming for. This is based on the user experience we think is possible in our MX-5e and it uses the existing ignition/steering lock and key.

Power Off

  1. With the key removed and the ignition off, DCU1 remains connected to the 12V battery and is powered via a 3.3V dc-dc converter and is in 'deep sleep' mode.
  2. In this state the drain on the is <2mA. The only other permanent drain on the 12V battery is the central/remote locking (<7mA).
  3. At regular intervals (typically every 6 hours), DCU1 wakes from its deep sleep and performs some checks, including checking the 12V battery voltage. If in range, it connects to a trusted Wi-Fi network and reports the results. It is typically awake for less than 5 seconds.
Note: The plan is to add 3G/4G data connectivity as well in the future, to enable smartphone app connectivity.

Accessories On

The key switch in the MX-5e has an 'ACC' position and this supplies power to the entertainments system. It does not enable the DCU in this position.

Ignition Key On

  1. The ignition key unlocks the steering column.
  2. With the key inserted and the ignition switched on, DCU1 wakes. It will remain awake until the ignition key is turned off and all the other conditions are met to enable it to go through the shutdown process and re-enter a deep sleep.
  3. The ignition key enables power the dc-dc converter and the iBooster.
  4. DCU1 automatically selects the driver profile and enables a personalised cabin experience, including the ambient lighting. The driver is also shown on the OLED display. The 'driver change' button is active.
  5. DCU1 enables and disables power to the Vehicle Control Unit (VCU).
Note: None of the high voltage systems are active in this mode, other than the dc-dc converter, which enables the 12V systems to run and the 12V battery to be charged from the main battery. This is deliberate and means you can sit in the car and listen to music, whilst also running the Heating, Ventilation and Air Conditioning (HVAC).

Ignition Key Start

  1. The ignition key start is a momentary twist of the key and is sensed by DCU1.
  2. DCU1 enables power to DCU2 and 12V power to the Thunderstruck VCU.
  3. DCU2 monitors the VCU startup and reports a successful start to DCU1.
  4. DCU1 sends driver profile and driving profile to DCU2 and this configures the VCU.
  5. The EV is ready to drive.

Ignition Key Off

Note: Switching the ignition key off will not immediately shutdown DCU1, DCU2 or the VCU.
  1. Switching the ignition key off will initiate a number of checks by the DCU1. DCU2 will signal when it can be shutdown.
  2. These include the vehicle mode being Neutral (N) and the vehicle being stationary.
  3. DCU1 then will power off the Vehicle Control Unit (VCU) and DCU2.
  4. Depending on the sensed temperatures, DCU2 will ask DCU1 to wait until it can shutdown the pumps.
  5. DCU1 will then turn off the dash status light and enter a deep sleep.

Charging Started

  1. Plugging in the charging lead, powers up the charger and this is sensed by DCU1 which then wakes up from a deep sleep.
  2. DCU1 enables power to DCU2 which powers the pumps and it controls the speed of them based on sensed temperatures.
  3. The dc-dc converter is also enabled, to protect the 12V battery during the charging process.

Charging Completed

  1. When the charging process is complete or the charging lead is removed, DCU1 senses this.
  2. The dc-dc converter is disabled.
  3. DCU1 removes power to the pumps.

Arduino Mega 2560 Pro

We were originally testing using the Arduino processor Mega 2560 Pro because it has an amazing amount of processing power, analogue and digital IO capability is a tiny package. It doesn't support Wi-Fi or BLE though. We are currently using this for DCU2.

NodeMCU ESP32

We are using an ESP32 processor it is permanently connected to the 12V battery and therefore needs to use minimal power. It does this by using a very low power dc-dc converter to deliver the required 3.3V dc from the 12V battery. In deep sleep the total DCU load on the 12V battery is <2mA. Another advantage of these processors is that the start up time is less than one second.

The ESP32 has the Bluetooth Low Energy (BLE) capability required to detect key tags and these are used to help select the driver profile and help deliver a personalised driving experience. The ESP32 has Wi-Fi connectivity and connects to the home network to report data back to our smart home.

When the ignition is on, the ESP32 is 'awake' and performing a number of functions. It monitors the ignition key and enables and disables sensors and other hardware as required.

When the ignition is off, the ESP32 processor spends most of its time in 'deep sleep' mode and uses virtually no power. At regular intervals (typically every 6 hours), the ESP32 awakes from its deep sleep and performs a number of checks by enabling sensors and other bits of hardware. It is wake for less than 30 seconds.

We use dc-dc converters to accurately generate both 3.3V and 5.0V dc as these are both the power supply and the voltage references for analogue to digital conversions. These things are cheap and readily available on sites like eBay. Having used them in our smart home for 20+ years, we know they are incredibly reliable.

DCU #2

We are using a second processor that is powered via DCU1 to:

DCU1 and DCU2 communicate with each other via serial port and send comma separated name/value pairs over the serial link.

For the initial development, we are using an Arduino Mega 2560. These processors are bullet proof, have loads of IO capability and lots on memory. Rob has used them in his smart home and other connected vehicles for 10+ years.

Data Logging

DCU2 performs data logging for diagnostics and the same data storage technology is also used to store driver profile data.

We are using this Adafruit data logging shield to store data on an SD card.

For initial testing we are using this 8GB SDHC card.

Real-Time Clock (RTC)

The data logging shield features a Real-Time Clock (RTC) with battery backup. This is really useful as it allows all data logging to be accurately time-stamped before the GPS module acquires a signal and is able to re-synchronise the time held by the RTC.

Analogue Inputs

Ambient Light Level
LDR based light level sensor, with software algorithm.
12V battery Voltage
Uses a voltage divider.
Inverter Outlet Temperature
Standard automotive temperature sensor.
Motor Outlet Temperature
Standard automotive temperature sensor.
Radiator Outlet Temperature
Standard automotive temperature sensor.

Ambient Light Level

We are not going to go into the detail of this here. Rob has documented this in great detail on his smart home website.

12V Battery Voltage

The 12V battery voltage will vary from around 12.0V to as much as 15.0V. You can't simply connect the battery to an analogue input, so we use a voltage divider. Putting 12V across a resistance such as our voltage divider will add a 'phantom load' and start to drain the battery, so we have to ensure the voltage divider has a very high resistance, to make this additional load negligible.

We have a 3.3V maximum input on our analogue pin, then we need to divide the 16.0V (worst case) by about 4.85, to ensure we stay within the 3.3V limit. If we use a 100KΩ resistor in series with a 20KΩ potentiometer, then we are adding a negligible load to the 12V battery (about 0.1mA).

The analogue input is 12-bit and reads 4096 at 3.3V. By adjusting the potentiometer, we calibrate it to read 3072 with a 12.00V input (i.e. 4096 at 16.0V), meaning each bit read represents 0.004V. This is way more resolution and implied accuracy than we actually need.

We use an algorithm to measure an the 12V battery voltage. We take 20 samples, sort them by value and then use the average of the middle 10 readings. This gives us an accurate and consistent battery voltage to 2 decimal places.

Temperature Sensors

We are installing these inline temperature sensor housings to measure the inverter outlet temperature, the motor outlet temperature and the radiator outlet temperature.

We are using these Lucas SNB1441 sensors with 1/8" × 27 NPTF thread. These are NTC (negative temperature coefficient) temperature-dependent resistors and are interfaced to the analogue pins on an Arduino processor. One side of the sensor is connected to ground and the other to the Arduino analogue input. A 1KΩ resistor from the analogue input pin to 3.3V is required.

Digital Inputs/Outputs

Cooling Pump 1

Two digital outputs are used to select the speed and a single digital input is used to detect an error signal with our Tesla pump speed controller.

Mode

The DCU enables selection of the vehicle mode via three buttons, with audible acknowledgement.

Driver Profile

The automatic driver profile selection mechanism is designed to simplify the user experience and minimise the driver interaction required before setting off. It also enables a personalised driving experience.

The DCU detects the driver and selects the correct driver profile automatically, prioritising the last one to drive. In the MX-5e, this is done using BLE tags. If two or more drivers and tags are seen, another driver profile can be selected by cycling through them using a 'change driver' button.

Interior/Ambient Lighting

The DCU directly controls the ambient lighting in the cabin and it is personalised to each driver profile. The DCU communicates with a number of WS2812B 5050 RGB LEDs via a 5V signal and power supply.

The LEDs behind the driving profile and vehicle mode are also lit usign these LEDs, to enable them to be backlit at night and to change colour to show the selected option.

Driving Profile

The DCU enables selection of the driving profile via four buttons, with audible acknowledgement. It remembers the last profile used by each driver.

GPS

We have successfully interfaced a NEO-6M GPS module to ESP32 #1 via the Serial2 port. This provides real-time longitude, latitude, altitude, speed and an accurate time & date. There is an open-source library for the Arduino processor IDE.

As part of the DCU, the GPS module cannot be left permanently connected to the 12V battery because it uses about 45mA. For this reason, it is only powered when the ignition is on.

Accelerometer, Magnetometer & Compass

We are using the GY-511 module which includes a 3-axis accelerometer and a 3-axis magnetometer. This sensor can measure the linear acceleration at full scales of ±2 g / ±4 g / ±8 g / ±16 g and magnetic fields at full scales of ±1.3 / ±1.9 / ±2.5 / ±4.0 / ±4.7 / ±5.6 / ±8.1 Gauss. GY-511 compass module has 8 pins, but you need only 4 of them to interface with Arduino. This module communicates with Arduino processor using the I2C protocol, so we connect the SDA (I2C output) and SCK (I2C clock input) pins of the module to the I2C pins on the Arduino processor processor. There is an open-source library for the Arduino processor IDE.

Audio

The DCU will have the ability to play audio files and make multiple tones. These can be used for audible feedback on pressing buttons or switches. They can also be used to NOT DEFINED the driving experience.

TPMS

To pick up data from the Tyre Pressure Monitoring System (TPMS) sensors in the wheels, we are using a CC1101 module interfaced to ESP32 #2 via an SPI interface.

Development & Testing

Our development focus has shifted to the ESP32 as its very low power consumption allows it to be permanently connected to the 12V battery in 'deep sleep' mode and supports it all of the required features.

For the initial development and testing in the MX-5e, we were using an Arduino processor Mega 2560 Pro. The ATmega2560 has 256KB of flash memory for storing code (of which 8KB is used for the bootloader), 8KB of SRAM and 4KB of EEPROM (which can be read and written with the EEPROM library).

Build

The DCU elements are built using modular components, linked via connectors and ribbon cables. Rob has used this approach with previous smart home and smart vehicles projects and it makes it very easy to develop and test the various components. They are also able to handle the harsh environment found in vehicles, particularly the vibration.

Control Board

DCU2 needs to control 12V power to the Vehicle Control Unit (VCU) and provide a 12V signal to the dc-dc converter directly. It also needs to controls relays to the fans and pumps. We have designed a dedicated PCB with 'high side' switching for the following:

It also has a logic level converters for the 'DCU2 wait' signal (5.0V output to 3.3V input) and the serial communications between DCU1 and DCU2.

Open Source

The OSSEV® philosophy is to open-source our designs and once we are happy our development and testing is complete, we will share our PCB designs and all the software we have developed for our DCU.

Testing

DCU1 12V Battery Voltage

One of the first things we tested was the Driver Control Unit (DCU) measuring and reporting the 12V battery voltage to my smart home using Wi-Fi. This is working really well with notifications being sent when the voltage drops below the configured threshold.

-->