Arduino Mega 2560 and Wemos D1 Mini Serial Communication System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino Mega 2560 and a Wemos D1 Mini. The Arduino Mega 2560 is responsible for sending messages to the Wemos D1 Mini via serial communication. The two microcontrollers are interconnected through their respective power, ground, and serial communication pins.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2 PWM, D3 PWM, D4 PWM, D5 PWM, D6 PWM, D7 PWM, D8 PWM, D9 PWM, D10 PWM, D11 PWM, D12 PWM, D13 PWM, AREF, SDA, SCL, D52, D50, D48, D46, D44, D42, D40, D38, D36, D34, D32, D30, D28, D26, D24, D22, D53, D51, D49, D47, D45, D43, D41, D39, D37, D35, D33, D31, D29, D27, D25, D23
Wemos D1 Mini
- Description: A mini WiFi board based on the ESP8266.
- Pins: RST, A0, D0, D5, D6, D7, D8, 3V3, 5V, G, D4, D3, D2, D1, RX, TX
Wiring Details
Arduino Mega 2560
- 5V: Connected to Wemos D1 Mini 5V
- GND: Connected to Wemos D1 Mini G
- D19/RX1: Connected to Wemos D1 Mini RX
- D18/TX1: Connected to Wemos D1 Mini TX
Wemos D1 Mini
- 5V: Connected to Arduino Mega 2560 5V
- G: Connected to Arduino Mega 2560 GND
- RX: Connected to Arduino Mega 2560 D19/RX1
- TX: Connected to Arduino Mega 2560 D18/TX1
Code Documentation
Arduino Mega 2560 Code
/*
* This Arduino Sketch sets up serial communication between an Arduino Mega 2560
* and a Wemos D1 Mini. The Arduino Mega 2560 sends a message to the Wemos D1
* Mini via Serial1 (pins D18/TX1 and D19/RX1).
*/
void setup() {
// Initialize Serial communication at 9600 baud rate
Serial.begin(9600);
// Initialize Serial1 communication at 9600 baud rate
Serial1.begin(9600);
// Print a message to the Serial Monitor
Serial.println("Arduino Mega 2560 is ready.");
}
void loop() {
// Send a message to the Wemos D1 Mini
Serial1.println("Hello from Arduino Mega 2560!");
// Wait for a second
delay(1000);
}
- File Name: sketch.ino
- Description: This code initializes serial communication on the Arduino Mega 2560 and sends a message to the Wemos D1 Mini every second. The message "Hello from Arduino Mega 2560!" is sent via Serial1, which is connected to the Wemos D1 Mini's RX pin.