Part of the Jackal project, this Arduino Nano-based board serves as an I2C target device (address 0x02
) that interfaces with various physical controls and sensors, communicating with the Teensy 4.0 main board controller.
- MCU: Arduino Nano (ATmega328P)
- PN532: PN532 NFC RFID module from elechouse (dipswitches set to 0/0 for HSU mode)
- Level Shifter: 5V to 3.3V bidirectional logic level shifter
Arduino Nano Pin | Control Inputs | I2C Bus | NFC Module | Description |
---|---|---|---|---|
A0 | VHF pot | VHF/TV Tuning potentiometer analog input | ||
A1 | VOL pot | Volume potentiometer analog input | ||
A2 | Tone pot | Tone control potentiometer analog input | ||
A3 | Play/prev/next | Multi-button control panel (2.2k pull-down) | ||
A4 (SDA) | SDA | I2C Data line to Teensy 4.0, through 5V to 3.3V level shifter | ||
A5 (SCL) | SCL | I2C Clock line to Teensy 4.0, through 5V to 3.3V level shifter | ||
A6 | Brightness pot | Display brightness control analog input | ||
A7 | FM Capacitor | FM tuning capacitor analog reading | ||
D2 | FM Capacitor | FM tuning capacitor digital control | ||
D3 | Band select | Band selection button (pull-up enabled) | ||
D4 | Orange button | Push button input (pull-up enabled) | ||
D8 | TX | Software Serial TX to PN532 NFC module RXD pin (labeled SCL) | ||
D9 | RX | Software Serial RX from PN532 NFC module TXD pin (labeled SDA) | ||
D12 | Input select | Input selection button | ||
5V | VCC | 5V provided by Teensy 4.0 main board | ||
GND | GND | Ground connection |
- All buttons use internal pull-up resistors except for the Play/Prev/Next which uses a 2.2k pull-down resistor (all 3 buttons are using different resistors values to determine the correct button pressed)
- I2C lines (SDA/SCL) are used for communication with the Teensy 4.0 main board through a level shifter
- Software Serial is used for the PN532 NFC module to avoid conflicts with I2C communication
- The board is powered by the 5V output from the Teensy 4.0 main board
This board operates as an I2C target device at address 0x02, responding to requests from the Teensy 4.1 main board. On each request, it sends a data packet containing:
- Button states (1 byte)
- Volume pot value (1 byte, mapped 0-255)
- Tone pot value (1 byte, mapped 0-255)
- TV tuning pot value (1 byte, mapped 0-255)
- Brightness pot value (1 byte, mapped 0-255)
- FM capacitor value (1 byte, mapped 0-255) - Currently not operational, always sends 0
- Control command value (1 byte)
- NFC UID (7 bytes)
- Potentiometer readings use moving averages to smooth values
- Button inputs are debounced using the Bounce2 library
- NFC polling occurs every 1000ms
- Analog inputs are read every 20ms
This project could not be built without the contributions of many talented people. The io-board has the following dependencies.
- Thomas O Fredericks' Bounce2
- Jack Christensen's movingAvg
- Don Coleman's NDEF Library
- Seeed-Studio's PN532 NFC Library
- Install PlatformIO
- Clone this repository
- Open in PlatformIO IDE
- Build and upload to Arduino Nano
- Debug output can be enabled by uncommenting
#define DEBUG
- FM Capacitor functionality (reading a value from the Jackal's original FM tuner) was removed as it was causing too much noise.
- The code is still there as I might revisit it in the future. It can be re-enabled with
#define ENABLE_FM_CAPACITOR
as well as addingcodewrite/Capacitor
to thelib_deps
section inplatformio.ini
.