When your Pi4J code passes the smoke tests but something still feels off, or when you’re implementing support for a new sensor and you’re not sure whether you’re sending the right commands, a logic analyser is the tool that lets you see exactly what is happening on the wire.
This page describes how to use the Ikalogic SE254 alongside the Pi4J Smoke Test setup to visualize and validate your GPIO signals.
Unit tests verify your Java code. The smoke tests verify that your code interacts correctly with real hardware. But neither of those tools tells you what data is physically being transmitted on the I2C, SPI, or PWM lines.
A logic analyser connects directly to the pins of your Raspberry Pi (or your peripheral device) and captures the electrical signals in real time. The Ikalogic software then decodes those signals and displays the actual bytes, commands, and timing in a readable format. This makes it straightforward to check:
The SE254 is an affordable entry-level logic analyser with four logical channels, operating between 1.2V and 5V — which makes it compatible with the Raspberry Pi’s 3.3V logic level. It supports a wide range of protocol decoders including PWM, SPI, I2C, UART, and many more, all accessible through the ScanaStudio software.
Four channels is enough for the most common Pi4J I/O types:
For more complex multi-bus scenarios, Ikalogic also offers analysers with more channels — but for typical Pi4J development work, four channels covers the majority of use cases.
At around 95 euros, the SE254 is an accessible option compared to professional bench analysers that can cost thousands of euros.
The SE254 connects to your Raspberry Pi via probe wires. When using it with the Pi4J Smoke Test wiring, you hook up the probe wires to the relevant T-cobbler pins alongside the existing jumper wires.
Always connect the black ground wire to a ground pin on your breadboard or T-cobbler before connecting any signal wires. The ScanaStudio software will colour-code your channels to match the physical probe cables.
Below you can find some examples of how to use the Ikalogic analyser to validate your Pi4J code. These were discussed in the video with Tom Aarts and Frank Delporte, starting at 12'59".
In the Pi4J core code you can find an application that executes a set of “Smoke Tests”. The PWM test case configures a PWM signal on BCM 18 and connects it via a green jumper wire to BCM 23. The test runs the PWM for 10 seconds and counts the number of low-to-high transitions, expecting exactly 10 state changes at the default 50% duty cycle.
To visualise this with the Ikalogic analyser:
At a 50% duty cycle with a slow flash rate, the analyser will capture the transition from low to high and display the waveform. To see multiple pulses clearly, reduce the duty cycle in your test code. For example, setting it to 1% produces a narrow pulse that is much easier to inspect visually, and the ScanaStudio display will confirm the configured duty cycle matches what is observed on the wire.
The smoke test SPI test case communicates with a BME280 or BMP280 sensor wired as an SPI device. Once the test passes (confirming the sensor responds correctly), you can connect the Ikalogic analyser to inspect the actual bytes being exchanged.
For SPI analysis in ScanaStudio:
The ScanaStudio raw view will decode the captured traffic and display which bytes were sent over MOSI and which were received over MISO. This lets you cross-reference what your Java code sent against the sensor’s datasheet to confirm correctness — useful both for verifying existing functionality and for debugging new sensor drivers.
ScanaStudio supports running multiple protocol decoders simultaneously, so you can capture I2C traffic on two channels while also watching a GPIO state change on a third channel. This is particularly useful when debugging timing-sensitive interactions between different I/O types.