Power Distribution Board

From Black Metal Forest
Jump to: navigation, search

This Power Distribution Board (PDB) is specifically designed for Phoenix Solar Racing's Phoenix solar car and hopefully future solar cars.

click image for all kinds of photos!


  • Current Sensing
    • All outputs
    • Total Battery input
    • DCDC input
  • Voltage Sensing
    • Battery inputs
    • DCDC inputs
  • Port Protection
    • Over Voltage
    • Over Current
    • Reverse polarity
    • Battery reverse current protection
  • LED status indicators
  • Remote operated isolation relay
  • CANbus enabled
    • PSR standard atmega32u4 μC
    • All outputs are on the bus
  • Current Rating
    • Output Port: 5 Amps
    • Total Input: 10 Amps


Other files

  • PSR CANbus API


Design Considerations

The back side of the PCB showing power traces, ground flood fill is omitted

I designed the board to handle 10 Amps of current. This is probably more than we will ever use, even in peak situations. To design the trace sizes I used simple geometric calculations of trace L*W*H, to get 0.01ohms from farthest-input to farthest-output. At 10A that's 1W of power dissipation and 0.1V drop. I used 2-once copper PCBs and removed the solder mask on the ground traces around the outside of the board, just in case I needed to increase the current handling by piling on solder.

I tried to keep power traces on one side, and signals on the other. Power-traces had to jump up to the top to connect to surface-mount current sensors.

In tests, 10A of current showed no clear signs warm traces. Only fuses and input diode were warm, nothing to fuss about.


I got these PCBs made by PCBWAY.com for 74$ & 22$ shipping, That's for Ten, 175mm x 120mm boards with 2-once copper. Please excuse me as I shill, but I am really impressed with the quality and price of PCBway as well as their advanced website that shows the status of your PCBs on the assembly line. A real person makes sure your Gerber files are not screwy, and the boards are tested with flying probes before they are shipped, but that might be for protecting their own reputation.

Circuit Protection

I simulated the input protection in Multisim and experimented and tested many different Zener Diodes. The diode I chose is a special type of Zenar called a TVS diode. Unlike normal zeners, TVS diodes can conduct thousands of Amps when in breakdown (for a few micro seconds). The simple cheap automotive fuses used on the board take relatively a long time to break. The TVS diodes "burn up" and fail closed by the time the fuse breaks. if the PDB experiences an Over-voltage situation, one or more TVS diodes will need to be desoldered and replaced. I chose this input protection circuit because of its simplicity, low cost, and feature-set.

5V Rail

I added 5.1V zener diodes on the 5V rail just in case a high voltage tries to find it way onto it.

LED Indicators

15 Red-Green combo LEDs display the status of different parts of the power bus.

Generally, (1) Green: good, (2 )Yellow: warning, (3) Red: bad, (0) OFF: N/A

  • Battery Input
    • G.. Battery >40%
    • Y.. Battery 10-40%
    • R.. Battery 0-10%
    • 0.. No Battery Connected
  • Batteries Input Current
    • G.. 0-7A
    • Y.. 7-10A
    • R.. >10A
    • 0.. No Current
  • DCDC Input
    • G.. 11.4V - 11.6V
    • Y.. --
    • R.. <11.4V - >11.6V
    • 0.. <3V, No Power Connected
  • DCDC Input Current
    • G.. 0-7A
    • Y.. 7-10A
    • R.. >10A
    • 0.. No Current
  • Output Port
    • G.. <3A
    • Y.. 3-4A
    • R.. >5A or <0A
    • 0.. No Current

The RG LEDs are controlled by two 16 bit Shift Registers with Constant Current outputs. One register is used exclusively on the red, and the other, green. That way different current settings can be used for each color. In tests, Red needs 20ma to have the same relative brightness as Green at 0.5ma.


We use only one kind of microcontroller on the team for applications like this, a Sparkfun "pro micro" (20$) or equivalent knockoff (5$), loaded with the Arduino Leonardo boot-loader, not the Sparkfun boot-loader. It is coupled with a MCP2515 CANbus Controller IC to give the setup the ability to report the PDB's status to the bus.


  1. Analog sensors a read thorough a 16 port multiplexer IC.
  2. Values are converted to Currents and Voltages.
  3. Calibrations can be made via the USBserial to set for Vref, and every individual current sensor at 0A and 2A
  4. Voltages are mapped to battery percent values specific to our NiMH low voltage batteries.
  5. LEDs light up Green, Yellow, Red or Off depending on acceptable voltage and current ranges.
  6. Data about voltages, percents, currents, LEDs and misc. errors, are sent over CANbus using our PSRCAN protocall and API

Current & Voltage Sensing

When sensing current, the ADC reference voltage is set to VCC, since the current sensor output voltage is proportional to VCC (at a constant sensed current).

When sensing voltage, the ADC reference voltage is set to the internal 2.56V bad-gap reference. However, this voltage reference can very quite bit. All sensed voltages are divided with a R1=100k R2=10k arrangement for a 28.16V-in, 2.56V-out full scale result. This is to help protect the micro controller ADC inputs during an over-voltage event at the inputs. The micro-controller can be swapped out in the unlikely event that it is zapped though.

Serial Monitor

For diagnostics, use a serial monitor like the one provided in the Arduino environment and plug into the micro usb power on the Arduino.

BUG WARNING: The PDB needs to be power cycled after disconnecting from the USB serial monitor


Reverse Leakage Current

The reverse leakage current of the power input diodes is something that caught me off guard, 150uA or more at 13V. The leakage makes it appear as though there is a 11.5V ghost battery connected to empty ports. The 100k+10k voltage divider to ground dose not drain enough current away so I have to bodge in a 5K resistor in parallel. Even wth the 5K, the ghost voltage is about 3V, but in software I can say that anything below 5V will mean that there is no battery connected.

Relay Power

The relay coil power is sourced from the wrong side of the relay. That is, the relay needs to turn on... in order for the relay, to get power, to turn on... I noticed this problem when I was laying to the board, but forgot to change it! I also had no room left to route a trace and would of had to use a jumper anyway

Two VCC's

The current sensors output a ratiometric voltage per current, meaning for every 1A increase, the output voltage increases 5%vcc. This is great because the ADC on the micro-controller works the same way if you set the reference voltage to VCC as well. The problem arose when I supplied the the Arduino pro micro board with 5V on it "RAW" pin so the VCC that the 32u4 saw was only 4.2V, because of the voltage regulator on the board. The fix was just to put a jumper wire to short the VCC and RAW pin on the Arduino, so that the pro micro regulator was bypassed alltogether, lucky break.

If I Was To Do It Again

I would fix all the mistakes duh, but there are also a lot of non-ideal things I would change too.

  • Instead of the rats-nest of led signal wires, I could of just used 1 wire "Neopixle" LEDs like the WS2812B
  • I definitely should have used shunt resistors and op-amps to sense current. The hall effect current sensors I used have crummy accuracy, but the team had a surplus of them and I was lulled into a trap! What makes matters worse is the hall effect current sensors susceptibility to external magnetic fields! Even the earths magnetic field will change the reading +/- 5mA!!!


Calibration is done on the Voltage Reference and each of the individual Current Sensors at 0-Amps and 2-Amps. Calibrations are entered by changing values in the Arduino PDB source code and re-uploading the program. This avoids the added complexity of including serial input commands, parsing and EEPROM storage.

Preparation for calibration

  1. Always make sure you are powering the board from a 10V-14V power-source
  2. Make sure the relay is on
  3. Make sure there are no magnetic fields near the current sensors
    1. magnets near by
    2. bits of metal like screws
    3. test wires carrying current
  4. Plug the Arduino into your PC with a Micro USB cable
  5. Open the Arduino Serial Monitor (115200 baud, it doesn't really matter for emulated USB serial)
  6. Open the PDB_program source code
  7. You need a 5-7 ohm resistor with a heat sink.
    1. or, try putting the resistor in a bowl of water to dissipate the heat

How to do Voltage Calibration

  1. Apply a voltage (10-14V, your choice) to an input (1-5, your choice)
  2. Attach a Multi-meter on volts mode to the "GND" and "12V" test pads
  3. Tweak the "VoltageReference" value in the PDB Arduino Source Code (example: 2.545V)
  4. Upload
  5. goto -> step 3 until the "12Vbus:" matches your multimeter voltage measurement within +-0.01V

All voltage measurement spots on the on the PDB should now be calibrated from this one operation

Output Current Sensors at 2A (U6 - U13)

  1. Apply a voltage (10-14V, your choice) to an input (1-5, your choice)
  2. Attach a 5-7 ohm load to the output port you want to calibrate
  3. With a multimeter in Amps mode, insert it in series with the load to measure the current.
  4. Adjust the power supply voltage from between 10V and 14V, until the meter reads 2.00A, do not exceed the voltage rating of the board
  5. Tweak the second "CurrentReference" array value in the PDB Arduino Source Code, for the port you are calibrating.
    1. Example: {102.00,175.50}, //U6 - Port6
  6. Upload
  7. goto -> step 5 until the the Serial monitor current matches your multimeter voltage measurement within +-0.02A

Calibrate all current sensors for 0 Amps

  1. Apply a voltage (10-14V, your choice) to an input (1-5, your choice)
  2. Leave all outputs completely disconnected
  3. Tweak the first "CurrentReference" array value in the PDB Arduino Source Code, for the port you are calibrating.
    1. Example: {101.00,170.50}, //U1 - Battery Current
  4. Upload
  5. goto -> step 3 until the port you are calibrating reads +-0.02A around 0.00A

Input Current Sensors at 2A (U1 & U2)

  1. Attach an adjustable voltage power source with its negative lead to ground
  2. With a multimeter in Amps mode, Attach the positive lead of the power source to your multimeters positive lead.
  3. Attach your multimeters negative lead to the loop of wire soldered next to the input current sensor you are trying to calibrate (U1 or U2)
  4. Attach a 5-7 ohm load to the any of the outputs
  5. Adjust the power supply voltage from between 10V and 14V, until the meter reads 2.00A, do not exceed the voltage rating of the board
  6. Tweak the second "CurrentReference" array value in the PDB Arduino Source Code, for the port you are calibrating.
    1. Example: {101.00,170.50}, //U1 - Battery Current
  7. Upload
  8. goto -> step 4 until the "12Vbus:" matches your multimeter voltage measurement within +-0.01V