Wiki source code of Power controller

Version 13.1 by Mathias Larsen on 2026/06/17 16:23

Hide last authors
Mathias Larsen 6.2 1
2
3 == Microcontroller Pinout ==
4
Mathias Larsen 11.1 5 The power controller uses a microcontroller to control the pumps, fans, buzzer, and brake light. It also features current monitoring and LED indicators. The Microcontroller used in this system is STM32G431CBT6
Mathias Larsen 7.1 6
7
Mathias Larsen 2.4 8 |=Physical pin|=Electrical pin|=(((
9 Description
10 )))
Mathias Larsen 4.2 11 |1|VBAT|Power source from a backup battery if a RTC would be used (Connected to +3V3 in this case)
12 |5|OSC_IN|Clock input (8MHz oscillator)
13 |7|NRST|Negative reset which can be connected to a button (Connected to +3V3)
Mathias Larsen 7.2 14 |8|PA0|Analog signal: Current 6 Supply 24V resserve
15 |9|PA1|Analog signal: Current 7 Supply 24V resserve
16 |10|PA2|Analog signal: Current 5 Supply sensor card
17 |11|PA3|Analog signal: Current 4 Supply front
18 |12|PA4|Analog signal: Current 3 Supply accumulator
19 |13|PA5|Analog signal: Current 2 Supply fans
Mathias Larsen 7.3 20 |14|PA6|Digital output LED 9
21 |15|PA7|Digital output LED 2
22 |16|PB0|Analog signal Current 8 Supply buzzer, brake light
Mathias Larsen 8.1 23 |17|PB1|PWM: enable Fan 1
Mathias Larsen 7.4 24 |18|PB2|Input: V-sense
Mathias Larsen 5.1 25 |19|VSSA|Voltage source: Ground
Mathias Larsen 9.1 26 |20|VREF|Voltage reference (Internal voltage refferance)
Mathias Larsen 5.1 27 |21|VDDA|Voltage source: Power (+3V3)
Mathias Larsen 7.4 28 |22|PB10|Digital output: LED 8
Mathias Larsen 5.1 29 |23|VSS|Voltage source: Ground
30 |24|VDD|Voltage source: Power (+3V3)
Mathias Larsen 7.1 31 |25|PB11|Current 1 Internal components
32 |26|PB12|Current 9 Supply 12 V Pumps inverter and datalogger 
Mathias Larsen 8.1 33 |29|PB15|PWM: enable fan 2
Mathias Larsen 13.1 34 |30|PA8|Digital output Enable buzzeer(On the car it is Brake light)
35 |31|PA9|(((
36 Digital output Enable brake light(On the car it is the buzzer)
37 )))
Mathias Larsen 7.4 38 |32|PA10|Input ASMS signal
Mathias Larsen 12.1 39 |33|PA11|CAN-BUS RXD
40 |34|PA12|CAN-BUS TXD
Mathias Larsen 5.1 41 |35|VSS|Voltage source: Ground
42 |36|VDD|Voltage source: Power (+3V3)
43 |37|PA13|SWDIO
44 |38|PA14|SWCLK
Mathias Larsen 9.2 45 |40|PB3|Digital output: LED 3
46 |41|PB4|Digital output: LED 4
47 |42|PB5|Digital output: LED 5
Mathias Larsen 10.1 48 |43|PB6|Digital output: Enable Pump 1
Mathias Larsen 9.2 49 |44|PB7|Digital output: Enable Pump 2
50 |45|PB8|Digital output: LED 6
Mathias Larsen 5.1 51 |46|PB9|LED 7
52 |47|VSS|Voltage source: Ground
53 |48|VDD|Voltage source: Power (+3V3)
Mathias Larsen 2.1 54
55