Complete system architecture documentation for the WireLessText Terminal project
The WireLessText Terminal is a distributed embedded system consisting of two Arduino-based nodes that communicate wirelessly to enable bidirectional text messaging. The system has been implemented in two versions:
- v1 (IR): Uses infrared LEDs and receivers with NEC protocol
- v2 (HC-12): Uses HC-12 433 MHz RF transceiver modules
Both versions share the same core functionality: multi-tap text input, message buffering, LCD display, and character-by-character wireless transmission.
📸 Diagram Placeholder: High-resolution system architecture diagram showing both nodes and wireless link
┌─────────────────────────────────────────────────┐
│ Arduino Node (Single Unit) │
│ │
│ ┌──────────┐ ┌─────────────┐ │
│ │ 4×3 │ │ 16×2 │ │
│ │ Keypad │────────▶│ LCD │ │
│ │ │ │ Display │ │
│ └──────────┘ └─────────────┘ │
│ │ ▲ │
│ │ │ │
│ ▼ │ │
│ ┌──────────────────────────────────┐ │
│ │ Core UI Logic │ │
│ │ - Keypad scanning │ │
│ │ - Multi-tap input │ │
│ │ - Message buffer (32 chars) │ │
│ │ - LCD rendering │ │
│ │ - Status line management │ │
│ └──────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────┐ │
│ │ Transport Abstraction │ │
│ │ - sendChar() │ │
│ │ - receiveChar() │ │
│ └──────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌─────────────┐ │
│ │ IR/RF │ │ IR/RF │ │
│ │ Transmit │ │ Receive │ │
│ └──────────┘ └─────────────┘ │
│ │ │ │
└────────┼──────────────────────┼─────────────────┘
│ │
│ │
┌────▼────┐ ┌────▼────┐
│ IR LED │ │ IR Rx │ (v1)
│ /HC-12 │ │ /HC-12 │ (v2)
└─────────┘ └─────────┘
Node A Node B
┌──────────────┐ ┌──────────────┐
│ Arduino │ │ Arduino │
│ + Keypad │ │ + Keypad │
│ + LCD │ │ + LCD │
└──────┬───────┘ └──────┬───────┘
│ │
│ │
┌──────▼──────┐ ┌──────▼──────┐
│ IR/RF │◄──────────────────►│ IR/RF │
│ Transport │ Wireless Link │ Transport │
└─────────────┘ └─────────────┘
Note: In v1 (IR), communication is unidirectional (sender → receiver). In v2 (HC-12), communication is fully bidirectional (either node can send/receive).
📸 Diagram Placeholder: Professional CAD or schematic diagram showing physical node layout and interconnections
The firmware is organized into distinct layers:
- Hardware I/O Layer: Direct pin manipulation for keypad, LCD, and transport hardware
- UI Logic Layer: Multi-tap input, message buffer management, status updates
- Transport Layer: Protocol-specific send/receive functions (IR NEC or HC-12 serial)
This separation allows transport layers to be swapped without modifying UI logic.
Both v1 and v2 share identical:
- Keypad scanning algorithm
- Multi-tap text input state machine
- Message buffer management (32-character limit)
- LCD rendering and status line formatting
- Character commit logic (timeout-based)
Receivers strictly validate incoming data:
- v1 (IR): Protocol == NEC, Address == 0xEF00, Command in valid set (32-126 or 0x08)
- v2 (HC-12): Byte in valid set (32-126 or 0x08)
Invalid frames/bytes are silently ignored, preventing message corruption from noise.
- User presses keypad key
- Multi-tap state machine updates
currentCharpreview - If timeout expires or different key pressed:
commitCurrentChar() - Character appended to message buffer
- Status updated:
"TX:'<char>'" - LCD redrawn
- Transport layer sends character (IR NEC frame or HC-12 byte)
- Transport layer receives frame/byte
- Protocol validation (v1 only: NEC + address check)
- Command validation (printable ASCII 32-126 or 0x08)
- If valid: append to message buffer or handle backspace
- Status updated:
"RX:'<char>' Len:XX"or"RX:BKSP" - LCD redrawn
- Hardware: IR LED (pin 9) and IR receiver (pin 9)
- Protocol: NEC with fixed address
0xEF00 - Frame Format: Address (16-bit) + Command (8-bit char) + Repeat (8-bit, unused)
- Timing: ~40 ms delay between frames
- Direction: Unidirectional (separate sender/receiver sketches)
- Hardware: HC-12 module on SoftwareSerial (RX=2, TX=3)
- Protocol: Raw bytes, no framing
- Baud Rate: 9600
- Character Encoding: Direct ASCII (32-126) or 0x08 (backspace)
- Direction: Bidirectional (single symmetric sketch)
- Note: Voltage divider required on HC-12 RX line (5V → 3.3V)
- Multi-character framing: Wrap characters in packets with length headers, checksums
- Message acknowledgment: Add ACK/NACK protocol for reliable delivery
- Message history: Scrollable buffer with arrow keys
- External interface: UART connection to separate CPU for higher-level processing
- Encryption: Add simple XOR cipher or more advanced encryption for security
- Multiple nodes: Network addressing for more than two nodes
- RAM: Message buffer (32 bytes) + status line (16 bytes) + stack ≈ <200 bytes used
- Flash: ~10-15 KB per sketch (well within Uno/Nano 32 KB limit)
- Timing: Multi-tap timeout (800 ms) provides smooth user experience without blocking