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?