Skip to content

DIP Switch Test Modes

The AED firmware supports hardware-triggered test modes via a TCA9534 I2C GPIO expander (address 0x20). Switches are active-low; the mode value is the bitmask of pressed switches (SW1=bit0, SW2=bit1, SW3=bit2, SW4=bit3).

Mode table

Mode Switches Description
0 all off Normal operation
1 SW1 Normal run — fans 50%, dampers open
2 SW2 Ventilation off — fans off, dampers open
3 SW1+SW2 Power loss sim — fans off (coast), dampers open
4 SW3 Abnormal test — fans 100%, dampers closed
5 SW1+SW3 Fan 0 failure sim — fan 0 off, fan 1 100%
6 SW2+SW3 Fan 1 failure sim — fan 1 off, fan 0 100%
7 SW1+SW2+SW3 Thread transmit, WiFi off (not yet wired)
8 SW4 WiFi transmit, Thread off (not yet wired)
9 SW1+SW4 WiFi and Thread transmit (not yet wired)
10 SW2+SW4 Both dampers find home
11 SW1+SW2+SW4 Both dampers open-close cycle (repeat)
12 SW3+SW4 Logo RGB demo — rainbow fade across all 6 LED groups
13 SW1+SW3+SW4 Field durability test — random fan speeds every 10–20 s, random damper open/close cycles
14–255 — Reserved for future use

When a non-zero mode is active, normal telemetry and pressure control are suppressed. BLE remains functional.

Software override (no physical switches)

Set CONFIG_DIP_TEST_FORCE_MODE at build time to override hardware switches:

# Build for mode 1 (fans 50%, dampers open)
west build -b nrf52840dk/nrf52840 --sysbuild /home/vibrant/firmware_sense \
  -- -DEXTRA_CONF_FILE="aed.conf" -DCONFIG_DIP_TEST_FORCE_MODE=1

Or add to a conf file:

CONFIG_DIP_TEST_FORCE_MODE=1

Set back to 0 (the default) to restore normal hardware-switch behaviour.

Use ble_test_dip_modes.py to verify mode state over BLE:

python3 ble_test_dip_modes.py --mode 1
python3 ble_test_dip_modes.py --mode 10 --settle-s 80