Dashboard console
Post date: Jan 7, 2017 11:19:17 AM
To show remaining battery SOC and range, and actual power output or regeneration, we wanted to have a nice screen integrated in the Mazda's dashboard. The oiginal radio, rear window defrost button and mirror adjustment controls were moved to the console between the seats.
Then we combined a Raspberry Pi 3 and the official 7 inch touchscreen, added two MCP2515 SPI CAN bus modules, an ADS1015 12-bit ADC, a DS3231 RTC and some circuitry to switch the power based on the ignition key position.
On this photo you can see the two CAN modules. The MCP2515 is powered from the 3.3V of the Raspberry Pi, the transceiver from the global 5V supply.
To configure the modules, we followed the guide from the PiCan2 board.
The user interface is written in Python, using SDL for the graphical part and the python socketcan library to read and write from the CAN modules. The whole linux SocketCAN implementation is really awesome, btw. Simple widgets were written from scratch (button, graph, progressbar, etc.). On the photo below, we used 'canplayer' on one raspberry to replay logged messages to another pi, running the user interface.
When the ignition key is turned, the raspberry starts. When the key is turned to off, power to the Pi is kept for another ~15 secs and a GPIO pin is set. This pin is read out in the python application and initiates a clean shutdown.
The received values from the BMS are displayed in a 'rolling horizon' graph and written to a CSV file for later inspection.