Car Plant

One sentence pitch

Executive summary

blue and white striped round textile
blue and white striped round textile
an abstract photograph of a curved wall
an abstract photograph of a curved wall
low-angle photography of blue glass walled building during daytime
low-angle photography of blue glass walled building during daytime

The Hard Parts

There are a few things that I need to teach myself how to do for that I will be documenting

Understanding The STM32

I have intermediate experience with the Arduino/Atmega family of microcontrollers. For this project, I will be branching out to the STM32 as well as their IDE. These are two good families of embedded systems that operate in C, but there will be differences to understand.

Determining "Inefficient Driving"

As I start this, I am uncertain of what exactly I can query from the car over the CAN Bus, or how fast I can gather information. I will need to determine what would constitute gaining a leaf or losing a leaf.

Setting Up CAN Bus Communication

All modern cars are required to have Controller Area Network (CAN) communication. I will be using this method to query statistics from the car to determine if the vehicle is being driven efficiently.

I will need to understand the physical layer's properties (i.e., voltage levels, clock speeds, connections) and data structure to send and receive data on the line.

Understanding the STM32

The STM32 has a nice IDE (STM32CubeIDE) that allows for the configuration of hardware timers and interrupts in a nice GUI without the need for getting bare metal.

Configuration

The STM32CubeIDE has a nice menu. I am able to configure hardware timers for periodic queries. There is even a CAN option for RX and TX which can be interfaced with a transceiver chip and the STM32CubeHal libraries.

I am using a hardware timer set to 10Hz to transmit queries over the CAN Bus. I am asking for 3 pieces of information: Fuel Intake, MPH, and RPM. I have to send these commands separately, as CAN does not support multiple queries at a time.

Transceiver Chip (TJA1050)

Unfortunately, I will need to add a transmitter chip to the mix to transmit over an actual CAN Bus. The tranceiver module acts as the translator between the physical layer and the data layer. There are a lot of reasons why I cannot use just an ADC/DAC. Most microcontroller ADC pins are unable to sample fast enough, and similarly do not have a fast enough slew rate to keep up with a digital signal. Also, these pins are not made to supply current to a load, nor are they good candidates for the noisy environment of the CAN Bus.

Resources

Link

Link