# Hyperpixel 4.0 + PiJuice HAT

**URL:** <https://forums.pimoroni.com/t/hyperpixel-4-0-pijuice-hat/11916>\
**Category:** Support\
**Created:** [October 14, 2019, 1:58am UTC](https://forums.pimoroni.com/t/hyperpixel-4-0-pijuice-hat/11916 "2019-10-14T01:58:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![GregOMC](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@GregOMC](https://forums.pimoroni.com/u/GregOMC)\
**Post date:** [October 21, 2019, 10:48pm UTC](https://forums.pimoroni.com/t/hyperpixel-4-0-pijuice-hat/11916/3 "2019-10-21T22:48:06Z")

</div>

I’ve had some success with using the HyperPixel 4.0 with the PiJuice HAT (and the PiJuice Zero pHAT).

To use the HP4 with the PJ, the missing electronic piece is to add +5V/GND header to the underside of the Pi’s (3b+) GPIO pins 4 & 6, which is not easy to do.

Once this is done, the I2C pins on the HyperPixel (+3.3V, SDA, SCL, GND) can be connected to the PiJuice GPIO pins 1, 3, 5 and 9 respectively, and the Pi’s GPIO 4&6 to the PiJuice GPIO 4&6 (don’t get them the wrong way around!).

One more step, set the PiJuice BUS from 1 (default) to 3 (via the HyperPixel), leave the bus address to 0x14. Depending on how you’re using the PiJuice, you may need to modify this in the python code.

```auto
/usr/bin/pijuice_sys.py # the important one
/usr/bin/pijuice_tray.py # desktop
/usr/bin/pijuice_gui.py # desktop GUI

```

Setting the battery profile was annoying, since the CLI doesn’t work with the non-default I2C (even with a symlink in place) and the Python GUI apply button falls below the display area on the HP4, so can’t be pressed.

The workaround was to set it manually from python:

```auto
import pijuice
pj_i2cBUS = 3
pj = pijuice.PiJuice(pj_i2cBUS , 0x14)
print(f"Setting battery profile to {pj.config.batteryProfiles[2]}")
pj.config.SetBatteryProfile(pj.config.batteryProfiles[2]) 

```

I haven’t been able to get the RTC (ds1339) working however, since the dtoverlays don’t expect it on i2c-3. Ths symbolic link that is suggested doesn’t seem to work for this, and I’ve had no luck with dtoverlays (i2c-gpio-rtc, or even making my own with target=\<&i2c3\>; dtbo). Any help appreciated!

NOTE - I’ve added my RTC issue as it’s own topic

> [@Getting RTC driver working on i2c-3 (HyperPixel)](https://forums.pimoroni.com/t/getting-rtc-driver-working-on-i2c-3-hyperpixel/11982):
>
> I’ve had some success with using the HyperPixel 4.0 with the PiJuice HAT (and the PiJuice Zero pHAT). However I haven’t been able to get the RTC (ds1339) working however, since the dtoverlays don’t expect it on i2c-3. The symbolic link that is suggested doesn’t seem to work for this, and I’ve had no luck with dtoverlays (i2c-gpio-rtc, or even making my own with target=\<&i2c3\>; dtbo). I’ve followed i2c-rtc-gpio the instructions at: [https://forums.pimoroni.com/t/pi3-b-hyperpixel-4-ds3231-timer-…](https://forums.pimoroni.com/t/pi3-b-hyperpixel-4-ds3231-timer-debian/10492/5)

---

_[View the full topic](https://forums.pimoroni.com/t/hyperpixel-4-0-pijuice-hat/11916)._
