STC12–Arduino Master-Slave Smart Monitoring and Control System
This project was developed as an Embedded Systems Mini Project to demonstrate Master-Slave communication between two distinct microcontroller platforms: the STC12 (8051 architecture) and the Arduino UNO (ATmega328P). The core functionality relies on the I2C protocol, enabling efficient data exchange over a simple two-wire interface (SDA and SCL).
The STC12 microcontroller was designated as the Master Controller. Its primary role involves coordinating system operations, initiating sensor data requests, and executing high-level control decisions based on the information received from the slave device. Conversely, the Arduino UNO functioned as the Slave Device, responsible for managing analog sensor readings via its built-in Analog-to-Digital Converter (ADC) and controlling external outputs such as relays and actuators.
By leveraging the Arduino UNO's integrated ADC, we successfully eliminated the need for external ADC hardware typically required by traditional 8051-based systems. This design choice significantly reduced circuit complexity, lowered the component count, and improved overall scalability.
The architecture follows a highly modular design approach. This allows for the seamless addition of more slave devices or different sensor types in the future without requiring significant modifications to the master controller, providing practical experience in distributed processing and real-time control systems.
Features
- Master-Slave communication framework using I2C protocol
- Real-time monitoring of analog sensor data
- Built-in ADC utilization for sensor processing
- Command-based control of external actuators (relays)
- Modular architecture supporting future expansion
- Distributed processing between two microcontrollers
Challenges
Implementing reliable I2C communication between two different microcontroller architectures, developing custom communication routines for the STC12, synchronizing data exchange between master and slave devices, and designing a scalable architecture.
Solutions
We established a robust Master-Slave communication framework using I2C. The Arduino UNO's built-in ADC handled all analog processing, while the STC12 managed high-level decision-making. Structured command-response communication was implemented, and a modular system architecture was adopted to ensure future scalability with minimal master controller changes.