Arduino wants to send sensor data to PC using Wi-Fi module

Asked 2 years ago, Updated 2 years ago, 67 views

[Arduino] Use ESP-WROOM-02 (ESP8266) to communicate wirelessly over Wifi

Using the above URL, I am trying to wirelessly send sensor data from Arduino to my PC using a Wifi module called ESP-WROOM-02 (ESP8266).
However, if you connect it in the same way as the URL destination circuit diagram to execute the code during initial setup, Arduino will turn off without permission.
If I connect with 5V, the power will drop, so if I connect with 3.3V, the power will not drop, but the initial program does not work well.
Perhaps the wifi module and Arduino are not working well due to insufficient power supply.

If it's 5V, the power goes down and if it's 3V, it doesn't work, I don't know the cause of either.
Please let me know if there is anyone familiar with Arduino or circuits.
It is located at the URL, but I will attach the code of the initial setting just in case.
When connected at 3.3V, only Goodnight moon! will be displayed on the serial monitor.
Even if I enter the AT command from my side, I don't get an OK, so I think I can't connect.

#include<SoftwareSerial.h>

SoftwareSerial mySerial(2,3); // RX,TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin (115200);
  while(!Serial){
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin (115200);
  mySerial.println("Hello, world?");
}

void loop() {//run over and over
  if(mySerial.available()){
    Serial.write(mySerial.read());
  }
  if(Serial.available()) {
    mySerial.write(Serial.read());
  }
}

Additional information

Thank you for your kind reply

When I re-wired and re-inserted the regulator and capacitor, the power supply did not turn off even when connecting 5V, so I think the power supply problem was solved.
However, the results of the program above remain the same.
Only Goodnightmoon! is displayed, and Helloworld, which is supposed to come out later, does not return the response after sending the UART command.
Is there a problem with serial communication?
I'm not sure if it's an Arduino problem or a Wifi module problem.

arduino

2022-09-30 14:37

1 Answers

As for the part of the question "Only Goodnightmoon! is displayed, and Helloworld, which is supposed to come out after, is displayed", the code for the part is as follows, so "Goodnightmoon!" is printed on Serial and "Hello, world?" is printed on mySerial.

Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin (115200);
  mySerial.println("Hello, world?");

I don't know what serial and mySerial are connected to, but if only serial is displayed and mySerial is not displayed, I think the softwareSerial speed setting "mySerial.begin(115200);" may not match the speed of the equipment connected to SoftwareSerial.

==


2022-09-30 14:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.