A Propeller 2 (P2) implementation for interfacing with the SparkFun Magnetic Imaging Tile V3, providing real-time magnetic field visualization and high-speed data acquisition. I'm using the project as my playground, having CLAUDE implement all of the code itself.
NOTE: I'm using this project as a means to dial in the types of information available for download from our P2 Knowledge Base. In doing so i'm continually improving the CLAUDE ability to generate working P2 code in both pasm and spin
The SparkFun Magnetic Imaging Tile V3 is an 8×8 array of Hall effect sensors capable of visualizing magnetic fields in real-time. This project creates a complete P2-based interface system with two primary objectives:
Primary Purpose: Create a low-hardware-cost magnetic field visualizer using minimal components (P2 + magnetic tile + OLED display)
Secondary Purpose: Determine the maximum achievable frame rate using Propeller 2 hardware with this sensor configuration
- SparkFun Magnetic Imaging Tile V3 - 8×8 Hall effect sensor array
- Waveshare 1.5" RGB OLED Module - 128×128 pixel display
- Propeller 2 Development Board - Main controller
| Pin Range | Function | Description |
|---|---|---|
| P40-P55 | Data Bus | 16-bit PSRAM data (DIRB bits 8-23 + 32 = P40-P55) |
| P56 | CK | PSRAM Clock |
| P57 | CS | PSRAM Chip Select |
Note: PSRAM driver uses DIRB register for data pins. The bit pattern $00FF_FF00 (bits 8-23) maps to physical pins P40-P55 (add 32 to DIRB bit numbers to get physical pin numbers).
| Pin | Function | Wire Color | LA Ch Color | Description |
|---|---|---|---|---|
| P8 (+0) | CS | VIOLET | 00 0-0 YELLOW | AD7940 Chip Select |
| P9 (+1) | CCLK | WHITE | 05 1-1 BROWN | Counter Clock (sensor mux) |
| P10 (+2) | MISO | BLUE | 01 0-1 GREEN | AD7940 Data Input |
| P11 (+3) | CLRb | GRAY | 04 1-0 GRAY | Counter Clear (sensor mux) |
| P12 (+4) | SCLK | GREEN | 02 0-2 BLUE | AD7940 SPI Clock |
| P14 (+6) | AOUT | YELLOW | Analog Input (optional) | |
| GND | Ground | BLACK | Ground connection | |
| 3.3V | VCC | RED | Power supply |
| Pin | Function | Wire Color | LA Ch Color | Description |
|---|---|---|---|---|
| P16 (+0) | DIN | BLUE | 04 2-0 GRAY | SPI data output (MOSI) |
| P18 (+2) | CLK | YELLOW | 05 2-1 BROWN | SPI clock (SCLK) |
| P20 (+4) | CS | ORANGE | 06 2-2 RED | Chip Select (active low) |
| P22 (+6) | DC | DK GREEN | 07 2-3 ORANGE | Data/Command select |
| P23 (+7) | RST | WHITE | 03 1-3 ORANGE | Reset (active low) |
| GND | Ground | BLACK | Ground connection | |
| 3.3V | VCC | RED | Power supply |
For detailed hardware specifications, see:
- Low-Cost Design: Minimal hardware components for cost-effective implementation
- Dual ADC Support: P2 internal ADC and external AD7940 14-bit ADC for performance comparison
- Maximum Frame Rate Testing: Benchmark P2 performance limits with this sensor configuration
- Frame Buffering: Extensive buffering using P2's 512KB Hub RAM
- Primary Display: 128×128 OLED (SPI) for compact real-time visualization
- Secondary Display: HDMI output for expanded visualization
- Debug Logging: Serial output for driver verification and troubleshooting
- Dual Sensitivity: Normal and 10× amplified displays
- Color Mapping: Bipolar visualization (red for negative, green for positive fields)
- Background Calibration: Adaptive baseline correction for improved accuracy
- SPI Interface: Direct hardware connection for sensor data and display output
- Control Interface: TBD - possibly debug console for device control
- Live Display: Real-time magnetic field visualization without external commands
Initial Implementation: Live continuous scanning with real-time OLED display
| Mode | Description | Frame Rate |
|---|---|---|
| Live Scan | Continuous real-time magnetic field visualization | Limited by display refresh |
| High-Speed | Maximum speed capture and display | Up to 2000 Hz |
| Debug | Single sensor diagnostic via debug console | Variable |
Note: Command interface for mode switching is under development
Each frame contains 64 sensor readings arranged as an 8×8 grid, processed internally and displayed directly on the OLED screen:
[0,0] [0,1] [0,2] [0,3] [0,4] [0,5] [0,6] [0,7]
[1,0] [1,1] [1,2] [1,3] [1,4] [1,5] [1,6] [1,7]
...
[7,0] [7,1] [7,2] [7,3] [7,4] [7,5] [7,6] [7,7]
- 64 sensor values per frame
- Real-time color mapping for OLED display
- Internal processing without external data output
Current Phase: Documentation and Planning
This project is currently in the initial development phase. Comprehensive documentation has been created based on the Arduino reference implementation:
- ✅ Hardware interface specifications
- ✅ Communication protocol definition
- ✅ System architecture design
- ⏳ P2 source code implementation
- ⏳ VGA/HDMI display system
- ⏳ Testing and validation
Detailed technical documentation is available in the DOCs/ directory:
- Magnetic Tile Hardware - Detailed sensor array specifications
- OLED Display Hardware - Display module specifications
- Theory of Operations - Comprehensive system overview
- Communication Protocol - Hardware interface details
- Visualization System - Display implementation guide
- Hardware Schematics - Circuit diagrams
- IC Datasheet - AD7940 ADC specifications
- Real-time magnetic field visualization
- Motor and transformer analysis
- Permanent magnet characterization
- Electromagnetic interference detection
- Physics demonstrations
- STEM outreach activities
- Interactive magnetic field exploration
- Engineering design validation
- Quality control testing
- Magnetic component inspection
- Research and development tools
- Prototype validation
- Propeller 2 development board (choose one):
- SparkFun Magnetic Imaging Tile V3 - SparkFun
- Waveshare 1.5inch RGB OLED Module - Waveshare
- HDMI display capability (optional secondary display) - Amazon
- P2 Eval Digital Video Out Add-on Board (HDMI adapter for P2)
- Propeller 2 development environment
- PNut or FlexProp compiler
- Serial terminal application
- Debug console for development and diagnostics
- Hardware Setup: Connect the magnetic imaging tile to P2 using the pinout above
- Display Setup: Connect 128×128 OLED display via SPI for primary visualization
- Compile Code: Use PNut or FlexProp to compile the P2 source code (when available)
- Load Program: Upload the compiled binary to P2
- Operation: Device will automatically start live scanning and display magnetic fields
- Optional: Connect HDMI display for secondary visualization
This is an open-source project under the MIT License. Contributions are welcome for:
- P2 source code implementation
- Performance optimization
- Feature enhancements
- Documentation improvements
- Testing and validation
This project is licensed under the MIT License. See the LICENSE file for details.
- SparkFun Electronics for the Magnetic Imaging Tile hardware design
- Parallax Inc. for the Propeller 2 microcontroller
- Original Arduino implementation authors for reference documentation
Project Maintainer: Stephen M Moraco Organization: Iron Sheep Productions LLC
For questions, issues, or contributions, please use the project's issue tracking system.
If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices or support my work by contributing at Patreon!

