Language: EN

arduino-mega-esp8266-en-un-unico-dispositivo

Arduino Mega + ESP8266 in a single device

Today we are going to see an interesting device, a Mega R3 ATmega2560 and WiFi ESP8266 with 32Mb memory, in a single development board.

The ESP8266 is one of the most popular processors and the simplest option for obtaining WiFi connectivity in our projects. Since its appearance, both it and its big brother, the ESP32, have become very popular.

The ESP8266 includes an 80Mhz processor and 4MB of Flash. However, its major flaw is the shortage of pins. If we take into account those that are not usable because they are committed to other uses, we are left with only 5 pins really available for use.

In contrast, the Mega has a huge number of pins, providing 54 GPIO, 16 analog inputs, 14 PWM outputs, 4 UART, and 256kB of memory.

Having these two MCUs on the same board allows us to have available the large number of pins provided by an Arduino mega, as well as the WiFi connectivity and computing power of the ESP8266.

arduino-mega-esp8266-view

On this board, both processors can work together or separately. They can communicate with each other or with the USB. For this purpose, the CH340G USB serial converter is on board.

The configuration of the UART communication of both processors is very simple. For this, there are some DIP switches integrated on the board, according to the following table.

Connection1234567
ATmega2560 <-> ESP8266ONONOFFOFFOFFOFFOFF
USB <-> ATmega2560OFFOFFONONOFFOFFOFF
USB <-> ESP8266 (Firmware update)OFFOFFOFFOFFONONON
USB <-> ESP8266 (Communication)OFFOFFOFFOFFONONOFF
All independentOFFOFFOFFOFFOFFOFFOFF

Plus, an additional mode in which a switch on the board is involved.

Connection1234567Switch2
USB <-> ATmega2560 <-> ESP8266ONONONONOFFOFFOFFA RXD3 / TXD3

In conclusion, a very interesting board that allows us to bring together the best of two worlds, and that we can find from eBay or AliExpress sellers for about €11.