Smartlink is a robust, master-slave IoT automation framework that bridges cloud-based remote interfaces with deterministic, bare-metal hardware execution.
Designed to overcome the limitations of single-SoC IoT setups, this architecture uses an ESP8266mod as a dedicated network coprocessor to handle Wi-Fi connectivity and MQTT brokering via the Arduino IoT Cloud. The network module translates remote dashboard interactions into asynchronous serial commands (UART). These commands are transmitted to an LPC2129 (ARM7) master controller running bare-metal C firmware. The LPC2129 ensures highly reliable, real-time hardware execution, driving a local LCD interface and safely actuating high-voltage AC loads via an opto-isolated relay manifold.
Author: Aadhitya G.
- LPC2129 Development Board (ARM7TDMI-S Master Controller)
- ESP8266 NodeMCU (Network Coprocessor / Wi-Fi Bridge)
- HD44780 based 16x2 Alphanumeric LCD (Local UI)
- 4-Channel Opto-isolated Relay Module (Actuator)
- 4x Test LEDs & 330Ω Resistors (For safe logic testing before the actual implementation)
- Jumper Wires & Breadboard
- Standard 3.3V Power Supply (Vcc)
- Keil µVision (For compiling the bare-metal C firmware for LPC2129)
- Arduino IoT Cloud (For the remote MQTT dashboard (virtual switches) and uploading the sketch to ESP8266mod)
- Flash Magic (Or equivalent programmer for LPC2129)
Both microcontrollers operate on 3.3V logic, allowing for direct, level-shifter-free communication at 9600 Baud.
| ESP8266mod (Serial) | LPC2129 (Hardware UART0) | Function |
|---|---|---|
| D2 (GPIO 4) - TX | RXD0 (Port 0.0) | Transmits cloud commands ('A', 'a', etc.) |
| D1 (GPIO 5) - RX | TXD0 (Port 0.1) | Receives debug/status confirmations |
| GND | GND | Common Ground (Crucial) |
- UART0 TxD and RxD
P0.0andP0.1 - LCD Data/Control:
P0.2toP0.11 - Relay/LED Outputs:
P0.12toP0.15
- Navigate to the Arduino IoT Cloud.
- Create a new "Thing" and bind it to your ESP8266mod NodeMCU 1.0 (ESP-12E Module) device.
- Add four Cloud Variables:
L1,L2,L3, andL4(Type: Boolean/CloudLight, Permission: Read & Write). - Navigate to the "Dashboards" tab and create 4 switch widgets mapped to these variables.
- Open the auto-generated sketch in the Web Editor.
- Map the state of
L1-L4inside the auto-generated callback functions to transmit specific character bytes overSerial(e.g.,if (L1 == true) { Serial.print('A'); }). - Upload the code to the ESP8266mod.
- Open the provided project files in Keil µVision.
- Ensure the
UART0_Rx()logic is set to polling mode (not interrupt-driven) to sequentially parse incoming commands. - Compile the
.cfiles (main.c,LCD_functions.c,UART_config.c, etc.) to generate the.hexbinary. - Flash the binary to the LPC2129 using Flash Magic.
- Wire the common ground between the LPC2129, ESP8266mod, and your power supply.
- Connect the TX/RX lines according to the pin mapping table.
- Phase 1 (Safe Testing): Connect standard LEDs to pins
P0.12-P0.15to verify the logic. - Phase 2 (Deployment): Replace the LEDs with the
IN1-IN4pins of the relay module. Wire your AC loads through the Normally Open (NO) and Common (COM) terminals of the relays.
- Power up the master LPC2129 board first. The LCD will initialize and display the startup text:
"SmartLink-Smart Device Automatio". - Power the ESP8266. Wait 5-10 seconds for it to establish a Wi-Fi connection with the Arduino Cloud.
- Open the Arduino IoT Cloud Dashboard on your mobile device or PC.
- Toggle a switch. The command is routed over MQTT to the ESP8266mod, bridged via UART to the LPC2129, and physically executed by the relays within milliseconds.