Skip to content

Commit 1bb4f4c

Browse files
committed
Video smoke test with Tom
1 parent 442f165 commit 1bb4f4c

6 files changed

Lines changed: 127 additions & 0 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: 'Ikalogic Analyser'
3+
tags: ["PWM", "SPI", "Ikalogic"]
4+
---
5+
6+
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.
7+
8+
This page describes how to use the [Ikalogic SE254](https://ikalogic.com/logic-analyzers/se254/intro/) alongside the Pi4J Smoke Test setup to visualize and validate your GPIO signals.
9+
10+
## Why a Logic Analyser?
11+
12+
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.
13+
14+
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:
15+
16+
- Did you send the correct initialisation command to your sensor?
17+
- Is the data coming back from the sensor present on the bus, even if your Java code isn't interpreting it correctly?
18+
- Is your PWM duty cycle actually what you configured in code?
19+
- Are your SPI MOSI and MISO lines behaving as expected?
20+
21+
## The Ikalogic SE254
22+
23+
The [SE254](https://ikalogic.com/logic-analyzers/se254/intro/) 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](https://ikalogic.com/logic-analyzers/se254/software/).
24+
25+
Four channels is enough for the most common Pi4J I/O types:
26+
27+
- **PWM**: one channel for the signal, one for ground
28+
- **I2C**: SDA + SCL (two channels), plus ground
29+
- **SPI**: MOSI + MISO + SCLK + CS (four channels)
30+
31+
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.
32+
33+
At around 95 euros, the SE254 is an accessible option compared to professional bench analysers that can cost thousands of euros.
34+
35+
## Connecting the Analyser
36+
37+
The SE254 connects to your Raspberry Pi via probe wires. When using it with the [Pi4J Smoke Test wiring](https://www.pi4j.com/hardware-testing/hardware-testing/), you hook up the probe wires to the relevant T-cobbler pins alongside the existing jumper wires.
38+
39+
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.
40+
41+
{{< gallery >}}
42+
{{< figure link="/assets/hardware-testing/test-setup.jpg" caption="" caption-position="center" caption-effect="fade" >}}
43+
{{< figure link="/assets/hardware-testing/scana-pwm.png" caption="" caption-position="center" caption-effect="fade" >}}
44+
{{< figure link="/assets/hardware-testing/scana-spi.png" caption="" caption-effect="fade" >}}
45+
{{< /gallery >}}
46+
{{< load-photoswipe >}}
47+
48+
## Analyser Examples
49+
50+
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".
51+
52+
{{< youtube id="uy3oWn9iIWs" start="779" >}}
53+
54+
### Validating PWM with the Smoke Test
55+
56+
[In the Pi4J core code](https://github.com/Pi4J/pi4j/blob/develop/pi4j-test/src/main/java/com/pi4j/test/Main.java) 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.
57+
58+
To visualise this with the Ikalogic analyser:
59+
60+
1. Open ScanaStudio and create a new workspace
61+
2. Select your SE254 device
62+
3. Add a new protocol and choose **PWM**
63+
4. Connect the **blue probe wire** to the T-cobbler pin for BCM 18 (the PWM output pin)
64+
5. Connect the **black ground wire** to any ground row on the breadboard
65+
6. Set a trigger and start capturing
66+
7. Run your Pi4J smoke test (or your own Pi4J application)
67+
68+
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.
69+
70+
### Validating SPI with the Smoke Test
71+
72+
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.
73+
74+
For SPI analysis in ScanaStudio:
75+
76+
1. Create a new workspace and add an **SPI** protocol
77+
2. Connect the four probe wires to the T-cobbler pins according to the smoke test wiring table:
78+
- **Blue (MOSI)** → BCM 10 (Pin 19)
79+
- **Yellow (MISO)** → BCM 9 (Pin 21)
80+
- **Green (SCLK)** → BCM 11 (Pin 23)
81+
- **CS probe** → BCM 8 (Pin 24)
82+
- **Black (GND)** → any ground
83+
3. Set a trigger and start capturing
84+
4. Run the SPI smoke test
85+
86+
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.
87+
88+
### Combining Multiple Triggers
89+
90+
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.
91+
92+
## Further Reading
93+
94+
- [Pi4J Smoke Test setup and wiring](https://www.pi4j.com/hardware-testing/hardware-testing/)
95+
- [Ikalogic SE254 product page](https://ikalogic.com/logic-analyzers/se254/intro/)
96+
- [ScanaStudio software](https://ikalogic.com/logic-analyzers/se254/software/)
97+
- [PWM I/O type documentation](https://www.pi4j.com/documentation/io-types/pwm/)
98+
- [SPI I/O type documentation](https://www.pi4j.com/documentation/io-types/spi/)
99+
- [I²C I/O type documentation](https://www.pi4j.com/documentation/io-types/i2c/)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: '2026 Pi4J Smoke Tests with Pi4J'
3+
date: 2026-03-30
4+
tags: ["Video", "FFM", "Ikalogic"]
5+
---
6+
7+
## Validating Pi4J V4 on real hardware, catching bugs, and exploring the Ikalogic logic analyser
8+
9+
**20260330 - Video with Tom Aarts**
10+
11+
{{< youtube uy3oWn9iIWs >}}
12+
13+
Pi4J contributor Tom Aarts joins Frank Delporte for a hands-on session focused on hardware testing in Pi4J V4. Tom has been a long-time contributor to the Pi4J ecosystem. He added example devices, improved core code by finding gaps through real-world usage, and most recently designed the Pi4J Smoke Test hardware setup that makes integration testing on real Raspberry Pi hardware practical and repeatable.
14+
15+
This video covers the design philosophy behind the smoke tests, a live demo of how they were used to reproduce a real bug (virtual thread pinning in the FFM plugin causing only 4 of 8 button listeners to fire on a 4-core Raspberry Pi), and a first look at using the affordable Ikalogic SE254 logic analyser to visualise PWM and SPI signals directly on the wires.
16+
17+
We also talk about the upcoming Pi4J drivers library, Tom's planned example rework, and an honest look at what AI-assisted coding with GitHub Copilot and Claude actually feels like in practice — including the risk of taking on too many parallel sessions at once.
18+
19+
* [Pi4J website](https://www.pi4j.com/)
20+
* [What's new in Pi4J V4](https://www.pi4j.com/about/info-v4/)
21+
* [FFM plugin interview with Nick Gritsenko](https://www.pi4j.com/blog/2026/20260220-interview-nick-ffm/)
22+
* [Pi4J Smoke Test documentation](https://www.pi4j.com/hardware-testing/hardware-testing/)
23+
* [Smoke Test source and README](https://github.com/Pi4J/pi4j/blob/develop/pi4j-test/README.md)
24+
* [Bug report: issue #622](https://github.com/Pi4J/pi4j/issues/622)
25+
* [Bug fix: PR #623](https://github.com/Pi4J/pi4j/pull/623)
26+
* [Ikalogic SE254 logic analyser](https://ikalogic.com/logic-analyzers/se254/intro/)
27+
* [Ikalogic ScanaStudio software](https://ikalogic.com/logic-analyzers/se254/software/)
28+
* [Pi4J example devices (Tom's repository)](https://github.com/Pi4J/pi4j-example-devices)
-128 KB
Binary file not shown.
116 KB
Loading
128 KB
Loading
2.43 MB
Loading

0 commit comments

Comments
 (0)