Trip computer and tracking for Citroën C-zero

img

Summary

The C-zero is a cheap and popular electric car in Norway, along with it's "triplets" Mitsubishi i-MiEV and the Peugeot iOn. However, to keep the cost down, it lacks features such as a trip computer and remote tracking and monitoring (at least my 2012 model). With the shutdown of the FM broadcast band in Norway, I had to do something with the radio, and used the opportunity to make something more out of it.

Functionality

I decided to do the following:
  • Read relevant CAN bus messages (state of charge, power, speed etc.) to calculate energy per distance (kWh/km) etc.
  • Get position from a GPS/GNSS module
  • Send realtime telemetry through the cellular network to my server
  • Show trip information on a small display in the car
  • Replace the current radio solution

Components

To accomplish the aforementioned I use the following components:
  • GPRS modem with complete IP stack (Presto Classic CL102)
  • Custom motherboard (see below)
  • 4x20 character HD44780 display
  • Active GPS antenna
  • Efficient class D audio amplifier (Sure Electronics, TA2024 based)
  • DAB radio adapter
  • Two CNC milled panels
The motherboard is a 2-layer PCB design with the standard 75x45 mm form factor I tend to use. It has the following main parts:
  • PIC32 microcontroller with CAN peripheral and plenty of UART's
  • u-blox MAX-7W GNSS for positioning
  • 3.3 V buck regulators with low no-load current (will always be on with the PIC in sleep)
  • 5 V buck regulator to supply the DAB radio
  • Switched outputs for enabling/disabling devices
  • CAN transceiver (for the car's CAN bus)
  • Double RS-232 transceiver (for the GPRS modem and a debugging port)


img img img

Assembly

A mounting plate was milled in nylon for all the electronics.

img img img

A panel was milled in plywood for the display, the radio, a potmeter to adjust volume and a rotary encoder to change the display wiew, and painted black.

img img img img img

After testing the DAB receiver, it turned out the roof mounted FM antenna was useless for the DAB band. An LNA and a filter was part of the antenna assembly, which attenuated the DAB band by more than 70 dB! I simply bypassed this part for now, which works well. I terminated the antenna cable with SMA connectors to be able to easily put an LNA in the signal chain at a later time, if necessary. The first plot shows S21 of the filter and LNA with a 20 dB attenuator, the second plot is the SWR of the antenna.

img img img img img img

Firmware

The main effort was writing a state machine for the AT GPRS modem. The HD44780 display is straight forward to control. CAN messages are used to decide which state the car is in (off, radio on, "ignition" on, charging) and change the display view accordingly. Telemetry gets transmitted as UDP packets containing NGHam extension data, so it can be displayed in the same software I use for the Owl VHF radio.

Results

The information proved by the display is very handy, at least knowing the consumption per distance and accurate state of charge (the instrument panel only provides 16 steps in the range 10-100 %), and realtime charging information and position available on my phone is nice to have.

img img img

Comments

You need to be logged into Facebook in the browser for comments to appear



Design: Jon Petter Skagmo