A multi-device IoT information interaction system based on cloud computing services, supporting cloud storage and real-time monitoring of IoT node sensor information.
This project implements a complete IoT system including:
- Cloud Services: TCP-based cloud servers for data reception, storage, and forwarding
- Device End: Support for 8051 and STM32 microcontrollers
- Sensors: DS18B20 temperature sensor
- Communication Module: ESP8266 WiFi module
- Display Interface: TFT LCD and OLED displays
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ 8051 Device │ │ STM32 Device │ │ Cloud Server │
│ │ │ │ │ │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ DS18B20 │ │ │ │ OLED │ │ │ │ TCP Server │ │
│ │ Temperature │ │ │ │ Display │ │ │ │ Port 1011 │ │
│ │ Sensor │ │ │ │ │ │ │ │ │ │
│ └─────────────┘ │ │ └─────────────┘ │ │ └─────────────┘ │
│ │ │ │ │ │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ ESP8266 │ │ │ │ ESP8266 │ │ │ │ Data Logger │ │
│ │ WiFi │ │ │ │ WiFi │ │ │ │ Port 1013 │ │
│ │ Module │ │ │ │ Module │ │ │ │ │ │
│ └─────────────┘ │ │ └─────────────┘ │ │ └─────────────┘ │
│ │ │ │ │ │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ TFT LCD │ │ │ │ LED │ │ │ │ Data Sender │ │
│ │ Display │ │ │ │ Control │ │ │ │ Port 1014 │ │
│ └─────────────┘ │ │ └─────────────┘ │ │ └─────────────┘ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────┐
│ Internet │
│ Connection │
└─────────────────┘
- Language: C++
- Protocol: TCP/IP
- Features:
- Data reception servers (Port 1011, 1013, 1014)
- Temperature data logging
- Data forwarding and acknowledgment
- File storage management
- Microcontroller: STC12C5A60S2
- Sensor: DS18B20 temperature sensor
- Communication: ESP8266 WiFi module
- Display: TFT LCD screen
- Features: Temperature acquisition, WiFi connection, data upload
- Microcontroller: STM32F103
- Communication: ESP8266 WiFi module
- Display: OLED display
- Control: LED control, key input
- Features: Remote control, status display
Cloud_IoT_System/
├── Cloud_Host_Service/ # Cloud Services
│ ├── Tcp.Client.cpp # TCP Client
│ ├── Send.Log.cpp # Data Sending Service (Port 1014)
│ ├── Rcv.Log.cpp # Data Reception Service (Port 1013)
│ └── Celsius.Rcv.Log.cpp # Temperature Data Reception (Port 1011)
├── Device_8051/ # 8051 Device End
│ ├── main.c # Main Program
│ ├── DS18B20.C # Temperature Sensor Driver
│ ├── LCD.C # LCD Display Driver
│ ├── UART.C # Serial Communication
│ └── sys.C # System Functions
├── Device_STM32/ # STM32 Device End
│ ├── main.c # Main Program
│ ├── HARDWARE/ # Hardware Drivers
│ │ ├── OLED/ # OLED Display
│ │ ├── LED/ # LED Control
│ │ ├── KEY/ # Key Processing
│ │ └── TIMER/ # Timer
│ └── SYSTEM/ # System Libraries
│ ├── delay/ # Delay Functions
│ ├── sys/ # System Configuration
│ └── usart/ # Serial Communication
└── Diagram/ # System Diagrams
├── IoT System Diagram.jpg # System Architecture Diagram
└── STC.Hardware.PDF # Hardware Design Diagram
- Real-time Acquisition: DS18B20 digital temperature sensor
- Accuracy: ±0.5°C
- Range: -55°C to +125°C
- Display: TFT LCD real-time temperature display
- WiFi Connection: ESP8266 module
- Protocol: TCP/IP
- Ports:
- 1011: Temperature data reception
- 1013: General data reception
- 1014: Data sending service
- Cloud Storage: Temperature data automatically saved to
CelsiusLog.bin - Log Recording: General data saved to
TcpLog.bin - Data Format: Binary file storage
- LED Control: Support for remote LED switching
- Command Format:
RED: Turn on red LEDREDOFF: Turn off red LEDGREEN: Turn on green LEDGREENOFF: Turn off green LED
# Compile cloud services
g++ -o TcpServer Send.Log.cpp -lws2_32
g++ -o RcvServer Rcv.Log.cpp -lws2_32
g++ -o CelsiusServer Celsius.Rcv.Log.cpp -lws2_32
# Run services
./TcpServer # Data sending service (Port 1014)
./RcvServer # Data reception service (Port 1013)
./CelsiusServer # Temperature data service (Port 1011)- Modify WiFi connection information:
// In main.c
SendString("AT+CWJAP=\"Your_WiFi_Name\",\"Your_WiFi_Password\"\r\n");- Configure server address:
// Modify server IP and port
SendString("AT+CIPSTART=\"TCP\",\"Your_Server_IP\",1011\r\n");- Configure WiFi connection:
// In main.c
printf("AT+CWJAP=\"Your_WiFi_Name\",\"Your_WiFi_Password\"\r\n");- Set server connection:
printf("AT+CIPSTART=\"TCP\",\"Your_Server_IP\",1014\r\n");-
Start Cloud Services
- Run three TCP servers
- Listen on corresponding ports
-
Device Connection
- 8051 device connects to temperature data port (1011)
- STM32 device connects to data sending port (1014)
-
Data Acquisition
- 8051 collects temperature every 30 seconds
- Send to cloud via WiFi
-
Data Storage
- Cloud automatically saves temperature data
- Support data query and forwarding
- MCU: STC12C5A60S2
- Sensor: DS18B20 temperature sensor
- Communication: ESP8266 WiFi module
- Display: TFT LCD screen
- Power: 5V supply
- MCU: STM32F103 series
- Communication: ESP8266 WiFi module
- Display: OLED display (SSD1306)
- Control: LED indicators, keys
- Power: 3.3V supply
Format: TXXXX
Example: T2345 (represents 23.45°C)
LED Control:
- RED: Turn on red LED
- REDOFF: Turn off red LED
- GREEN: Turn on green LED
- GREENOFF: Turn off green LED
- Compiler: GCC/G++
- Platform: Windows
- Library: WinSock2
- 8051: Keil C51
- STM32: Keil MDK-ARM
- Debugging: ST-Link debugger
- Temperature Accuracy: ±0.5°C
- Response Time: <1 second
- Communication Range: WiFi coverage area
- Data Update: 30-second intervals
- Storage Capacity: Unlimited (depends on server storage)
- Data Encryption: TCP protocol transmission
- Access Control: Port access restrictions
- Data Backup: Local file storage
- Error Handling: Automatic reconnection on connection exceptions
- v1.0: Initial version
- v1.4: Added dedicated temperature data service
- v1.0: STM32 device end completed
Welcome to submit Issues and Pull Requests to improve this project!
This project is licensed under the MIT License - see the LICENSE file for details.
💡 Tip: This is a complete IoT system implementation that demonstrates the full process from sensor data acquisition to cloud storage. Suitable for learning IoT development, embedded system design, and network programming.