What is Midnight Sun?

Midnight Sun is a student design team focused on creating a solar car for the American Solar Car Challenge. Each season we make a new solar car. The video below describes what my team does.

Midnight Sun Official Website

My Work on Midnight Sun

CAN Explorer

Currently, I am leading a project to develop software for our team to be able to visualize the data we get from our CAN Bus. The architecture of this project is shown below

Our team needed a better way of being able to monitor how our vehicle was behaving and to be able to test our the different ECUs in the car. Originally we thought about obtaining a license for tools such as CANalyzer but we ended up designing our own CAN analyzing software since it would be able to meet the exact requirements we needed and would be helpful for testing. We are using Django and React to create this web application. The backend, which is hosted by Django, is used to grab data and process it using tools such as cantools and SocketCAN. The React front-end is currently being developed, but the idea is to create a simple UI that can easily sort through and display the CAN data.

Driver Display

This is the driver display. It is basically what the driver will use when they are in the vehicle to monitor their speed, battery, lights, and check for any errors.

This driver display was created with Flutter (Dart). I worked mainly on connecting the driver-display to the CAN bus so that the data on the driver display, such as speed, could be updated accordingly. I also developed the warning signals on the driver display so that any faults that are picked up on the CAN bus would be shown to the driver.

Telemetry

Below is a brief outline of how I have layed out everything for telemetry

The Raspberry Pi runs a Python script that I wrote to pick up CAN messages from the vehicle and GPS alongside it. This then writes this data to a CSV file, sends it to DynamoDB, the driver display flutter app, and FRED (Front End for Node Red). The data is sent to FRED using MQTT, which picks up the CAN messages and stores them in InfluxDB for 2 days. Below I have an example of the format of the data which has already been decoded from the CAN bus.

Battery Management System (BMS)

Below is an LTC6811 which is used to monitor our batteries. In our vehicle, we have to make sure the sun is able to charge up our batteries properly and that these batteries do not overheat. Part of the code I wrote for our AFEs (Analog Front End), uses SPI to retrieve the temperatue of 32 thermistors connected to a mux in the BMS.

Below is the mux I interfaced to. Basically, we have controllers boards that talks to the LTC6811 with SPI, which then talks to the mux with SPI as well. However, all the code I wrote directly controls everything from the controller boards.

Steering

The steering stalk was the first project I was given when I entered the solar car team. It is in charge of controlling the cruise control, lights, horn, and radio in the car. For all the digital input (eg horn), there is an interrupt attatched to the pin on the board for each peripheral. When the driver presses a button on the steering stalk, they can toggle the state of the lights, horn , or radio. My module then detects this, raises an interrupt, and sends a CAN message to the power distribution to provide power to the proper location in the vehicle. For the analog input (specifically the control stalk), the module uses an ADC to read voltages from the control stalk and sends CAN messages based off of the voltages. So for example, a voltage of 2078mV from the