Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino and ESP32-CAM UART Communication System

View and Edit Project In Cirkit DesignerImage of Arduino and ESP32-CAM UART Communication System

Circuit Documentation

Summary

This circuit involves an Arduino UNO and an ESP32-CAM module. The Arduino UNO is responsible for receiving messages via UART communication, while the ESP32-CAM sends messages to the Arduino UNO. The two microcontrollers are interconnected to facilitate this communication.

Component List

Arduino UNO

ESP32-CAM

Wiring Details

Arduino UNO

ESP32-CAM

Code Documentation

Arduino UNO Code

void setup() {
  // Initialize Serial communication
  Serial.begin(9600); // Debugging
  Serial.println("Arduino UART Communication Initialized");
}

void loop() {
  // Check if data is available to read
  if (Serial.available() > 0) {
    // Read the incoming message
    String receivedMessage = Serial.readString();
    // Print the received message to Serial Monitor
    Serial.println("Message Received: " + receivedMessage);
  }
}

ESP32-CAM Code

#define RXp2 14  // RX pin for UART2
#define TXp2 15  // TX pin for UART2

void setup() {
  // Initialize Serial for debugging
  Serial.begin(115200);
  // Initialize UART2
  Serial2.begin(9600, SERIAL_8N1, RXp2, TXp2);
  Serial.println("ESP32 UART Communication Initialized");
}

void loop() {
  // Send a message to Arduino via Serial2
  String message = "Hello from ESP32";
  Serial2.println(message);
  
  // Print the sent message to Serial Monitor for debugging
  Serial.println("Message Sent: " + message);
  
  delay(1000); // Wait for 1 second before sending the next message
}

This documentation provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code running on each microcontroller.