Sending data from ESP32 to Arduino Uno

Hey Guys,

i want so use my Arduino Uno to collect data from sensors and controll some water pumps. Some of the data i want to have access via my Home Assistant system.
Therefore, my first step was to send some data from my Arduino Uno to the ESP32, but that didn't work well.

For the sending Arduino, i have the Code:

void setup() 
{
  Serial.begin(9600);  
}

void loop() 
{
  Serial.println("132");
  delay(1500);
}

On my Receiving ESP32 (i have the ESP32 D1 Mini NodeMCU WiFi + Bluetooth Board) i have the code:

#define RXD0 1
#define TXD0 3

void setup() {
  Serial.begin(115200);
  Serial2.begin(9600,SERIAL_8N1,RXD0,TXD0);

}

void loop() {
 Serial.println("Data Receifed");
 Serial.println(Serial2.readString());
delay(1000);
}

The library and settings you can see in the attached picture.

When i open the Serial Monitor, i almost always get:
Data Receifed ⸮⸮⸮
So instead of the data i get the ⸮⸮⸮.

Interestingly, sometime when i connect/unplug the TX/RX connections between ESP32 and Arduino, the value "132" appears in the plotter, so sending works, but receiving/interpreting doesn't.
I think it has something to do with the power supply, but i dont know how to supply both boards right at the same time.

The ESP32 is supplied by the PC via an micro USB B cable and sends the data via this usb cable to the serial monitor.
If i connect the Arduino Uno to the PC via USB B cable, the ESP32 stops working. The ESP32 also stops working if i use any external power supply for the Arduiono Uno, regardless if it is the USB port or the Power jack of the Arduino.

So the only way i can supply the UNO is via the 3.3V or the VCC from the ESP32, and input it in the 3.3V or 5V pins of the Arduino. The ESP32 doesn't stop working by doing that, but i still don't get the message to display on the Serial Monitor. I also tried with an without a ground connection between the two boards.

Has someone a solution now to connect the two?

Arduino D1 ESP32 Settings.png

Arduino D1 ESP32 Settings.png

send some data from my Arduino Uno to the ESP32

the UNO is a 5V device, so it's Tx pin will send 1 (HIGH) as 5V

Your ESP is a 3.3V device. Are you sure the pins can support 5V as input

I would suggest to study Serial Input Basics to handle the Serial port on the receiving side

1 Like

In regards to the ESP32 and 5V. ESPRESSIF has removed all references to the ESP32 being 5Volt tolerant from its documentation.

I found the problem,
i used the instruction and Code from this Video: ESP32 UART TUTORIAL AND BASIC DEMO - How to connect ESP32 to Arduino Uno Step by Step - YouTube

He uses another board where it was more clear, that there are more than one TX/RX connection.
I just used the TX/RX on pin 1 and 3, but i should have used 16/17 since in the Code it is written:

Serial2.begin(9600,SERIAL_8N1,RXD0,TXD0);

The Serial2.begin sets Pin 16 and 17 as TX/RX input/output.

About the voltage: I use the 3.3V from the ESP32 for Powering the Arduino Uno, so the Signal i get back from the arduino should be also fine.

I use the 3.3V from the ESP32 for Powering the Arduino Uno

:o :o
how well does your UNO work?

so the Signal i get back from the arduino should be also fine

interesting expectation...

Tooth:
About the voltage: I use the 3.3V from the ESP32 for Powering the Arduino Uno

When you use a component or device outside the operating range specified in its data sheet, you become an Unpaid Test Pilot

Uno is a 16MHz processor, it needs at least 3.8V on the 328P VCC pins to run fully within spec.
You may notice odd behavior running it at 3.3V, most likely to be seen first on the Serial lines.

CrossRoads:
Uno is a 16MHz processor, it needs at least 3.8V on the 328P VCC pins to run fully within spec.
You may notice odd behavior running it at 3.3V, most likely to be seen first on the Serial lines.

What does the following mean?

ATmega328P Vcc.png

ATmega328P Vcc.png

What does the following mean?

That AT328P can run at lower frequencies at lower voltage.

In my data sheet there is a section in Electrical Characteristics called "Speed Grade"

The operating curve is linear between 2.7V >10MHz and 4.5V >20MHz

cattledog:
That AT328P can must run at lower frequencies at lower voltage.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.