Hello! I am still really new to arduino, and I have got a project that requires the MEGA2560 and ESP8266 to both send and receive data, my MEGA2560 can receive data from ESP8266, but my ESP8266 does not receive data from the MEGA2560.
From what I have researched, the MEGA2560 outputs 5V and ESP8266 can only handle up to 3.3V, and the way to solve this is to do voltage divide or use a logic level converter, I am currently trying out the voltage divide method as I have never done soldering to setup the logic level converter and I'm scared to mess it up.
I have read some threads in this forum and some people had the same problem and they fixed it by doing the voltage divide method.
the purple cable is from the TX of MEGA2560 (pin 21 on breadboard)
the white cable (which is plugged in to the end of - on breadboard) is from GND on MEGA2560
the resistors are 1k ohm and 2k ohm
Here is my MEGA2560 code: #include <ArduinoJson.h>
I am using json because I need to send multiple types of data and put them in variables.
Please let me know if there is anything that you need, I need your help!.
Also, the esp8266 has been operating without resistors for at least 6 months, could the rx pins have fried already?
If the 8266 is transmitting at 3.3v the mega will be able to read that , even tho it’s 5v .
Just be careful not to set that Rx pin as an output !
As the mega is not going to transmit , don’t connect it Tx pin to the 8266 Rx pin and all will be fine
Do it the proper way, especially if you build more then one, use a level translator. The resistor solution puts you on the edge of sometimes maybe it works. Remember parts have tolerances and power supplies do as well.
My project involves rfid scanner and line follower scanner that are connected to the MEGA2560, the objective is to be able to send the scanned rfid tag data to firebase via ESP8266
That's where you use a (one or more; you can easily use four) "port expander".
Not only is a Mega 2560 a very expensive version of a port expander, it is also a very clumsy one!
This is a project that has been worked on by previous team before me and I got the robot built already when i got the task, and the task that I got from my lecturer is to make it so that the robot can be controlled via firebase and can send its whereabout to firebase.
As for the used pin on the mega, it is connected to rfid scanner, line follower sensor and 4 dc motor that are used to operate 4 mechanum wheels.
I managed to make the esp8266 to receive data from Mega2560 by using the logic level converter, and the wiring is really simple using the level converter.
Now the esp can receive and send data from and to Mega2560, vice versa