Skip to content

I2C Interface in H2 M

bitstuffing edited this page May 28, 2025 · 1 revision

I²C Access on PortaPack H2 (Unofficial Mod)

Although the official documentation states that only PortaPack H4 or M variants support I²C communication, it is technically possible to enable this functionality on PortaPack H2 and H2+ as well.

This guide describes a simple hardware modification that enables I²C communication on H2/H2+ by internally wiring existing HackRF One signals to the ESP32 inside the PortaPack.


Why This Works

The HackRF One already provides an I²C interface (I2C0) through its expansion header. PortaPack H4 and M expose these I²C signals as part of their extended GPIO headers — allowing the ESP32 on board to communicate with the HackRF over I²C with an external interface (GPIO mod).

However, PortaPack H2 and H2+ do not connect these signals to an external port. They receive the same interface from the HackRF, but the I²C lines (we're insterested in SCL and SDA) are left exposed from inside the PortaPack to external GPIO port.

By adding just two wires inside the PortaPack H2 or H2+, you can route these existing I²C lines from the HackRF to the ESP32, replicating the hardware behavior of the H4/M.

This mod does not require opening or modifying the HackRF One itself — the wiring is entirely inside the PortaPack.

For more details on the ESP32’s role and pin assignments, see the official guide:
Build your module (Wiki)


🔌 GPIO Reference (H4 vs H2)

The PortaPack H4 exposes its GPIOs through a 12-pin connector, physically accessible from outside.

imagen

This connector includes both I²C lines:

Pin Label (Top Row) Description
1 GND Ground
2 VBAT Battery voltage
3 SCL I²C Clock (I2C0_SCL)
4 SDA I²C Data (I2C0_SDA)
5 V3.3 3.3V
6 VCOIN Coin cell power
Pin Label (Bottom Row) Description
7 VCOIN Coin cell power
8 V3.3 3.3V
9 SDA I²C Data (I2C0_SDA)
10 SCL I²C Clock (I2C0_SCL)
11 VBAT Battery voltage
12 GND Ground

Notice that the bottom row mirrors the top row in reverse order, and some vol. wires never are used.

This GPIO header is not present on PortaPack H2 or H2+, but the internal signals are still routed from the HackRF expansion interface. The mod simply replicates this physical connectivity inside the H2/H2+ by wiring to the same I²C lines.

Source: Build your module - Wiki


What You Need

  • PortaPack H2 or H2+ with HackRF One
  • Soldering iron with a fine tip
  • Two short wires
  • FLUX, always use FLUX when use a soldering iron

How to Do It (PortaPack Mod)

1. Open Your PortaPack H2 or H2+

Carefully disassemble the PortaPack H2 or H2+ unit to access its PCB. You do not need to open the HackRF One.

2. Locate the Expansion Pads (From HackRF)

On the PortaPack’s edge connector (which mates with the HackRF), locate the pads corresponding to:

Signal Label on HackRF (P22) Description
SCL Pin 24 – I2C0_SCL I²C Clock
SDA Pin 26 – I2C0_SDA I²C Data

These signals come from the HackRF expansion port but are not connected internally in H2/H2+.

imagen

Schematics

3. Wire the ESP32 to These Pads

Solder two short wires from the PortaPack expansion pads for SCL and SDA to the corresponding ESP32 GPIO pins configured for I²C clock and data in your firmware.

imagen

Also, use FLUX, to extract the 3.3v and GND:

imagen

If you want the battery and the coin voltage (I don't recommend it) you simply solder a wire to the + connector of the coin and lithium battery.

For more information related to this mod, use the Build your module guide to identify which ESP32 pins are used in your build.

Important: You are not modifying the HackRF itself — only wiring existing signals inside the PortaPack.


Software Compatibility (not issues identified)

No firmware changes are required.

The ESP32 inside the PortaPack is configured as an I²C slave using only the SCL and SDA lines, with default I²C address 0x51.

From the firmware source (main.cpp):

PPHandler::init((gpio_num_t)CONFIG_I2C_SLAVE_SCL_IO, (gpio_num_t)CONFIG_I2C_SLAVE_SDA_IO, 0x51);

Once wired correctly, the PortaPack H2/H2+ will communicate over I²C just like the H4/M models.

Provenance

This modification was proposed and discussed in the community at:

Issue #45 – Enable I²C support on PortaPack H2

It has been verified by schematic inspection and code review as electrically compatible.

Clone this wiki locally