Where do you live?
Do you have quick and easy access to FTDI’s, ESP’s, resistors and capacitors?
@psoro’s Robot project has a nice schematic and shows the parts you need to connect an ESP to an Arduino.
Don’t forget the voltage divider between ESP and Mega when you connect up the rx and tx lines as ESP can only take 3.3V on the rx line. tx is ok to end 3.3V to the rx of the Mega.
How many digital and how many Analogue ports are you using on the Mega for your project?
I think I once saw that you can flash an ESP with an Arduino and I have certainly flashed one Arduino from another so I don’t see why it can’t be done but I haven’t actually done it. You would need to ask Google if you didn’t want to wait for parts to arrive.
@Costas I’m in the US and could easily use amazon/sparkfun/adafruit for parts. My project uses 22 digital pins for outputs / inputs. No analog (using a few ds18b20’s so I only need 1 digital pin for all of them).
I have Mega’s, Leonardo, Nano’s and lots of different ESP’s here.
Based on your requirement of no analogue ports, which ESP’s don’t do too well without bolt on boards then I would go with ESP’s. With Blynk you can bridge ESP’s so 2 or 3 would give you the 22 digital pins. If you didn’t want to bridge the ESP’s there are probably bolt on boards with extra digital pins.
With the 128 virtual pins on an ESP do you need 22 digital pins?
Your Mega has 256KB of memory whereas the ESP’s (excluding the old ESP01’s) have 1MB and up to 15MB of further data storage capacity.
@Costas Honestly, I’d rather not have to restart this project with new controllers and new code. I was hoping to be able to just integrate Blynk into the system. Would a Bluetooth module be a better solution?
EDIT: Actually, I’d rather not use Bluetooth because of limited range capabilities. Wifi would be ideal so that I could monitor the system from anywhere in the house.
If you want to go the Mega route then fine. I have a Mega with a $3 ethernet board and even though it doesn’t give you the freedom of WiFi I prefer it for Blynking.
Pick up an FTDI then and see how you go with the ESP WiFi shield for the Mega. It can be done but I don’t like it, but then again I don’t need 22 digital pins.
So do I need to buy a full on shield for the mega to get wifi capabilities? Or can I in fact use the esp8266-01 that I have now? Sorry if my questions are coming off as stupid, but I really am new to this side of microcontrollers. And thank you for the info so far @Costas. You’ve been more than helpful.
Yes an FTDI and then connect the ESP to the Mega (as per @psoro’s schematic). Then you use the ESP8266_Shield sketch and you are up and running. At least the Mega has plenty of serial ports so you can flash the ESP and still have Serial Monitor available for debugging etc.
I think its clear thar a I´m having hardware problem, so I[m using a ESP8266 -ESP01 cause a don´t have many space in my project. It is plugged in my arduiino… So what can I do now?
Try reducing the baud rate and if that doesn’t help it might be the way you have set up your hardware i.e. you can’t flash a new sketch if the rx / tx pins are currently tied to something else.