5V MANAGED POWER SUPPLY

Image of power supply

This project is a 5V managed power supply built around a Raspberry Pi. Its purpose is to monitor the current consumption for Raspberry Pi, Arduino and other 5V devices connected to the USB outlets on the front panel. The current limit for each output channel can be programmed independently and the outlet is switched off if the limit is exceeded. There is a button on the rear panel to reset any channels that have tripped. The power supply connects to a LAN using WiFi - there is a USB output on the rear to which a WiFi dongle can be connected. The Pi then runs in headless mode with access using SSH.

The unit uses a 5V/12V power supply from some surplus equipment. The 5V supply is used for the Pi and for the three monitored outlets. The outlets are independently switched using solid state relays connected directly to the Pi's GPIO pins. The SSRs require a 3-32VDC control voltage and will switch 5-230VDC at 5A - ample for my requirements. Although the 3V control voltage is close to the 3V3 of the Pi's GPIO pins, the SSRs work without problem. The bi-colour LEDs are connected to separate pairs of GPIO pins, each LED being in series with a resistor. The colour is switched by setting the pair of GPIOs HIGH-LOW or LOW-HIGH with off being either HIGH-HIGH or LOW-LOW. The LEDs show green when the outlet is energised and red when the outlet has tripped due to overcurrent.

Image of power supply rear panel

The SwitchDoc Labs PCB (it uses a TI INA3221 chip) and the LCD display are both connected to the I²C bus on the Pi. A single C program measures voltage and monitors current and then displays the bus voltage and current values on the LCD.

The rear panel has an IDC C14 mains input socket, a push button to reboot the Pi, a button to reset any tripped outputs and a USB connection for the WiFi dongle. This USB is connected internally to the Pi using a short extension cable. The USB outlets on the front panel are for voltage only - the data lines are not connected.

Graph of current drawn

The power supply also has a data logging feature that writes out the time from program startup in milliseconds, bus voltage and three current values. This can then be loaded into Excel or some other graphing application for further analysis and processing. A graph of the current drawn by three different Pis is shown here as an example.

Since the Pi is completely programmable, you could change the LCD to show power, energy consumed, or alternate between different sets of data.