Flight simulation hardware
Electrical panel
Citation Longitude (Model 700), Arduino Uno R4 WiFi and SPAD.neXt
- PID
- ELEC
- Board
- Arduino Uno R4 WiFi
- Inputs
- 14
- LEDs
- 14 × WS2812B
- SPAD
- 0.9.24+
Hardware & software
Hardware & software
Microcontroller
Arduino Uno R4 WiFi
- Renesas RA4M1, 48 MHz, 32 KB RAM
- 14 digital I/O pins, built-in WiFi (ESP32-S3)
- Built-in 12×8 LED matrix, USB-C
WiFiS3 + Adafruit NeoPixel
Simulation middleware
SPAD.neXt
- Version 0.9.24+
- REST Serial API, SSE event stream
- SimConnect + B:InputEvent bridge
- ServiceStack web framework
REST Serial Device API
LED strip
NeoPixel WS2812B
- 14 LEDs on pin 2, NEO_GRB + NEO_KHZ800
- Brightness: 100/255
- Individual RGB control per LED
14 indicators
Aircraft
Cessna Citation Longitude
- Default MSFS 2024 aircraft
- Dual Li-Ion batteries, APU generator
- Electrical vars via B:InputEvents (BVAR:)
MSFS 2024
LED colours
LED status colours
- Ambersystem off / standby
- Bluesystem active / on
- Greenbus tie active (one gen only)
- Greydim / emergency standby
- Offno SPAD connection
Architecture
Communication architecture
Arduino Uno R4 WiFi
- 14 buttons (INPUT_PULLUP)
- 14 NeoPixel LEDs
- WiFi 802.11 b/g/n
SPAD.neXt
- REST Serial Device API
- SSE event stream
- SimConnect bridge
- Port 28001
MSFS 2024
- Citation Longitude
- SimConnect API
- B:InputEvents
Button press → sim
- 1Pin reads LOW
- 230 ms debounce
- 3POST 8,<index>,1 to SPAD
- 4SPAD fires B:Event in sim
Sim state → LED
- 1SPAD detects var change
- 2SSE delivers 5,<ch>,<val>
- 3Arduino updates bool state
- 4NeoPixel colour set
Connection keepalive
- 1SSE stream persistent TCP
- 2Heartbeat GET every 15 s
- 3PING/PONG on channel 0
- 4Auto-reconnect on drop
Startup protocol
Startup protocol sequence
- RX ◂0,INIT,2,0.9.24,0// SPAD announces itself
- TX ▸0,SPAD,{GUID},Electrical Panel,2,1.0,AUTHOR=...,PID=ELEC// device identifies
- RX ◂0,CONFIG// SPAD requests configuration
- TX ▸0,OPTION,ISGENERIC=1,...// declare device options
- TX ▸0,INPUT,1,LBATT,PUSHBUTTON,SPAD_PUSHBUTTON ... ×14// declare 14 buttons
- TX ▸1,SUBSCRIBE,10,BVAR:LNG_ELECTRICAL_BATTERY_L ... ×8// subscribe to sim vars
- TX ▸0,CONFIG// configuration complete
- RX ◂2,PROVIDER,SIMCONNECT,1 ... ×n// provider status messages
- RX ◂2,START// panel is active, LEDs light up
- RX ◂5,10,1// initial sim var values delivered
- RX ◂5,10,0// L Battery toggled OFF → LED amber
- TX ▸8,1,1// LBATT button pressed → fires event in sim
- RX ◂0,PING,42// keepalive ping
- TX ▸0,PONG,42// keepalive response
New computer setup
Setting up on a new computer
Only three things change when moving to a new PC with its own SPAD installation. Everything else (device GUID, button names, variable subscriptions and protocol) transfers unchanged.
Step 1: WiFi credentials
Update if the new PC is on a different network.
SketchWIFI_SSID = "NewNetwork"; WIFI_PASS = "NewPassword";Step 2: SPAD host IP
Set the new PC's local IP address. Find it by running
ipconfigin Windows cmd and looking for IPv4 Address.SketchSPAD_HOST = "192.168.x.x";Step 3: New API key
The API key is tied to the SPAD installation. Clear it to trigger the challenge flow on first boot.
SketchAPIKEY = "";
First boot sequence
- STEPFlash sketch with APIKEY = ""// clears old key
- STEPOpen Serial Monitor at 115200 baud// must be open before boot completes
- MCUSending challenge to SPAD...// Arduino contacts SPAD
- STEPLook at SPAD window: a 4-digit code appears// popup or notification in SPAD UI
- STEPType the 4 digits in Serial Monitor + Enter// e.g. 4827
- MCU=== API KEY (copy into APIKEY in sketch) ===// key printed in Serial Monitor
- STEPCopy the printed key into APIKEY = "..." and reflash// stored permanently
- MCUSPAD START: panel ready// LEDs light up, panel operational