"PiSerialPower" Hat

From Techno-Innov's Wiki
Jump to navigation Jump to search

Raspberry Pi 4 Hat with 5-28VDC - 3A power with barrel jack input, Fan, RTC with Supercap backup, Debug UART, temp sensor and WS2812 RGB led

Description

The "PiSerialPower" Hat Power-supply Hat for RaspberryPi (and pin-compatible competitors) which also provides a rich set of features :

  • 5 to 28VDC barrel jack power input
  • 5V - 3A voltage regulator to power the Raspberry Pi
  • a Fan (PWM controlled)
  • an RTC (PCF85363) with Super capacitor backup (about one month date/time retention, and will not need to be changed in a few years !)
  • a USB to UART FTDI chip (FT230XS) to give you access to the debug console using a simple, common micro-USB cable
  • a reset button
  • a TMP101 temperature sensor
  • and a WS2812 RGB led ... well, there was some place left on the PCB ...

The serial and reset signals are also available on a 2.54mm header.

Of course, the board uses the format specified by Raspberry Pi and allows access to both FPC connectors, and is provided with mounting screws.

The board comes fully assembled and tested.

Where to buy

Contact us by email before (sales *at* techno-innov.fr) to get a quotation which will include shipping costs and reduction for direct order.

License

  • Documentation : Creative Commons CC BY-SA-NC 4.0
  • Hardware : The PiSerialPower RPi Hat hardware and schematics are under Creative Commons CC BY-SA-NC 4.0 License. You can produce your own original or modified version of the PiSerialPower RPi Hat, and use it however you like, but not sell them, even without profit.
  • Software : All the software examples created by Techno-Innov for the PiSerialPower RPi Hat are under GPLv3 License.
Note that most of the software you will use with this Hat has not been written by us and is covered by other licenses. Refer to each software for more information.

Hardware

Dimensions

Figures 1, 2 and 3 give the different dimensions and the position of the main elements (FAN, connectors, reset button and user led) of the PiSerialPower RPi Hat.

Connectors

Fig 4 - Connectors
Fig 4 - Connectors

The HAT has one USB connector numbered P1, a DC barel Jack connector numbered P3, and two 2.54mm pitch headers numbered P4 (Debug) and P5 (Raspberry Pi connector). Refer to figure 4 for connectors position.
Detailed description of the signals found on each connector pin follow.

  • P1 : USB microB female connector.
  • P3 : DC barrel jack. +Vin and ground input.
  • P4 : 4 pins, 2.54mm pitch header. Provides Debug UART and Reset.
  • P5 : 40 pins, 2.54mm pitch header. Provides access to RPI expansion header.

P1 : USB debug connector

P1 is a female USB microB port.
Refer to the Universal Serial Bus (USB) page on Wikipedia for pinout and more information on the USB bus and connectors.

P3 : 2.1mm barrel jack

P3 connector is a standard 2.1mm barrel jack.
+Vin is on the central tip, and GND on the outer sleeve.
Insersion detection is not used.
P3 connector provides access to +Vin and Ground for the onboard step-down regulator. Despite the comment on the schematics, the input ranges from 5V to 24V (28V is the max allowed, and 30V the absolute max the step-down converter can handle) . This lets you power the board using a large variety of power sources.

Note : be very carefull when powering the board with a 24V power-supply, as the voltage can go well above 30V upon power-supply startup and destroy the step-down converter.
Future versions will include a 28V zener diode between Vin and GND to further protect the Hat.

P3 connector
Pin # Description RPi signal RPi Pin
1 +Vin : External unregulated input, +5V to +28V -- --
2 GND : Ground GND GND pins 6, 9, 14, 20, 25, 30, 34 and 39

P4 Connector

P4 connector is a standard 2.54mm (0.1 inch) pitch header, with 1 row of 4 pins.\\ P4 connector provides access to Debug UART and Reset.

P4 connector
Pin # Description RPi signal RPi Pin
1 GND : Ground GND GND pins 6, 9, 14, 20, 25, 30, 34 and 39
2 RPi TxD UART0 Tx pin 8
3 RPi RxD UART0 Rx pin 10
4 5V enable (Reset) -- --

Note : P4 connector allows direct access to the debug UART and to the power enable pin without powering the USB-to-UART bridge. This option has been added to allow external access and control of clusters of Raspberry Pi boards through a single UART concentrator with aditionnal GPIO to control the DC/DC enable pin.

P5 Connector

P5 connector is a standard 2.54mm (0.1 inch) pitch header, with 2 row of 20 pins.\\ P5 connector provides access to the Raspberry PI expansion header.

P5 connector
Pin # Description RPi signal
1 +3.3V from RPi +3.3V
2 +5V to RPi +5V
3 SDA : Bidirectional Serial Data for I²C bus 1 I2C1 SDA
4 +5V to RPi +5V
5 SCL : Clock for I²C bus 1 I2C1 SCL
6 GND : Ground GND
7 RTC GPIO GPIO 4
8 RPi TxD UART0 Tx
9 GND : Ground GND
10 RPi RxD UART0 Rx
11 Temp sensor GPIO GPIO 17
12 RGB Led GPIO 18 - PWM0
13 -- --
14 GND : Ground GND
15 -- --
16 -- --
17 +3.3V from RPi +3.3V
18 -- --
19 -- --
20 GND : Ground GND
21 -- --
22 -- --
23 -- --
24 -- --
25 GND : Ground GND
26 -- --
27 SDA : Bidirectional Serial Data for I²C bus 0 (EEPROM) I2C0 SDA
28 SCL : Clock for I²C bus 0 (EEPROM) I2C0 SCL
29 -- --
30 GND : Ground GND
31 -- --
32 -- --
33 Fan PWM GPIO 13 - PWM1
34 GND : Ground GND
35 -- --
36 -- --
37 -- --
38 -- --
39 GND : Ground GND
40 -- --

Electronics

The PiSerialPower RPi Hat has been created using KiCad EDA software suite for the creation of the schematics and printed circuit boards.

See below for the full schematics. The sources for the schematics are available for download here.


Software

Official and custom images

I2C : RTC, EEPROM and temperature sensor support

Kernel Modules (use modprobe to load them if they are not already loaded or included in the main kernel image) :

  • RTC : rtc-pcf85363.ko
  • TMP101 : lm75.ko
  • EEPROM : at24.ko

Check that the components are detected :

  • root@raspberrypi:~# i2cdetect 1
[...]
40: -- -- -- -- -- -- -- -- -- -- 4a -- -- -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
[...]
  • root@raspberrypi:~# i2cdetect 0
[...]
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
[...]
  • echo tmp101 0x4a > /sys/bus/i2c/devices/i2c-1/new_device
  • echo 24c64 0x50 > /sys/bus/i2c/devices/i2c-0/new_device
  • echo pcf85363 0x51 > /sys/bus/i2c/devices/i2c-1/new_device

GPIO

GPIO support with Raspberry-Pi is a real pain.
Obviously, people do not understand what "stable" means, and try to create new interfaces for GPIO both from the kernel and from the userspace, each supposed to be the very best one, but none usable, making about every piece of information obsolete.

PWM Support for FAN control

  • Device tree information :
https://github.com/raspberrypi/linux/blob/rpi-4.19.y/arch/arm/boot/dts/overlays/pwm-overlay.dts
https://www.raspberrypi.org/forums/viewtopic.php?t=222428
  • Solution using pigpio (pigpiod daemon) and pigs for hardware PWM
pigpiod
pigs hp 13 100000 0
pigs hp 13 100000 30000
pigs hp 13 100000 1000000
killall pigpiod

Remember to kill pigpiod or it will burn your processor to death. PWM keeps running after pigpiod is killed.

WS2812B Support

The WS2812B is connected to pin 12 of the Raspberry Pi connector, which is gpio 18 - PWM0
I gathered various information, I hope it will be usefull :

dtb generation and eeprom flash

DTB sources :

You will also need eepromutils to flash the EEPROM :

Generate the dtbo and flash the EEPROM (Note : the write protection jumper must be "on" in order to flash the EEPROM) :

dtc -@ -I dts -O dtb -o overlay.dtbo overlay.dts
dtoverlay overlay.dtbo
./eepmake eeprom_settings.txt myhat.eep overlay.dtbo
./eepflash.sh -w -f=myhat.eep -t=24c64 -a=50 -d=0

You can erase the EEPROM with the following command (blank.eep is an 8Kb file filled with zeroes) :

./eepflash.sh -w -f=blank.eep -t=24c64 -a=50 -d=0

Links to various Raspberry Pi information

Raspberry Pi 4 specs

Hats mechanical data

EEPROM ID

Raspberry Pi Pinouts

TODO List

  • Test over-voltage protection with 28V zener diode and/or add resetable fuse on power input
  • Manage to sell a few (or many) boards ! Orders welcome !

Technical documentation and Schematics

  • Current documentation (PDF subpart of what's on this page) here
  • Sources for the schematics here

History

v0.1

This board revision has not been sold to public. First prototype version, produced on customer request.

v0.2

Actual version sold as of writting of this documentation. Fixes v01 mistakes and adds PWM for the FAN and a RGB led.