Elektroda.com
Elektroda.com
X

Search our partners

Find the latest content on electronic components. Datasheets.com
Elektroda.com

Arduino Mega + WiFi ESP8266 module, opinion, applications

TechEkspert 5949 18
This content has been translated » The original version can be found here
  • Arduino Mega + WiFi ESP8266 module, opinion, applications
    The Arduino Mega (ATmega2560) + ESP8266 module on one board contains Arduino Mega and a WiFi module based on ESP8266 with a printed antenna and an external uFL antenna connector. The cost of the module on auction portals is ~ $ 12 Link . The module can be powered from a micro USB socket or DC 7-16V connector, there is a DC / DC converter (MP2307) on the board. Communication with the modules takes place via the USB UART converter based on the CH340 chip. Arduino Mega works with a voltage of 5V, while the ESP8266 is 3.3V. ESP8266 pins are available on an additional connector with a description on the other side of the PCB. ISP connector allows for ATmega2560 programming without bootloader.
    Arduino Mega + WiFi ESP8266 module, opinion, applications

    In the previous material, Fr. ESP8266 + Arduino UNO You have developed a very interesting discussion about whether such a combination of modules on one board makes sense.

    Could ESP8266 and ATmega2560 find better applications?

    We have more I / O, 16 ADC inputs 10b, 4xUART and 2xtimer 8bit and 4xtimer 16bit.
    There is no SMD capacitor on the board, you can see the impact of price on quality, similar to the previously tested ESP8266 + Arduino UNO module:
    Arduino Mega + WiFi ESP8266 module, opinion, applications

    When connecting the ESP8266 and UNO pins, remember about different voltage levels, similarly when connecting the peripherals.
    After the appropriate setting of the ESP8266 and ATmega2560 switches, they can communicate using the UART, another jumper setting allows you to connect the UART USB converter with the selected module for programming.
    Arduino Mega + WiFi ESP8266 module, opinion, applications

    Connection of modules via UART - DIP 1 and 2 ON
    USB UART connection with ATmega2560 - DIP 3 and 4 ON
    USB UART connection with ESP8266 - DIP 5 and 6 ON
    USB UART connection with ESP8266 in programming mode (GPIO0-GND) - DIP 5 and 6 and 7 ON

    The additional switch RXD0 TXD0 - RXD3 TXD3 allows you to select the UART after which the ATmega2560 will communicate with the ESP8266.
    Setting the switch to the RXD3 TXD3 position and DIP 1, 2, 3, 4 - enables communication via the USB UART converter with the ATmega2560 on the UART0 port, and the ESP8266 communication with the ATmega2560 on the UART3 port.

    Do you think such a combination of ATmega2560 with ESP8266 on one board makes sense?

    Arduino MEGA can significantly expand the ESP8266 capabilities in terms of the number of general-purpose I / O, and the number of ADC inputs, PWM outputs, it is possible to offload / buffer ESP for measurements or communication with peripherals.

    It is inconvenient to switch miniature switches to change modes. When connecting the pins, the ESP and Arduino modules should be remembered about the difference in voltage levels between the modules.

    Below is information on how to integrate with the Arduino environment part of the module with ESP8266 and connect to the Blynk environment:
    ESP8266 WIFI boot, start from IoT, Blynk, Thingspeak

    The number of available PWM and I / O tempted to perform some RGB controller or multi-channel driver / recorder connected to Blynk or Thingspeak as a practical test, but it was already in the previous material. Let's try something else.

    As a practical test of the module, this time I tested the MEGA dedicated to Arduino RFLINK GATEWAY . The RFLink project allows the decoding of transmissions from very many wireless devices type weather station sensors, remote controls operating in ISM bands. I connected the data output of a very simple and cheap 433MHz OOK receiver to the D19 pin. The authors have prepared hints on which modules to use: http://www.rflink.nl/blog2/wiring I checked the operation of the cheap 5V 433MHz CZS-A receiver, and a slightly more complex 3.3V RFM210L receiver. The software for download on the project website http://www.rflink.nl/blog2/download uses the Arduino bootloader to upload the firmware, which simplifies the testing process. It turned out that two accidentally owned remotes are properly decoded and information about the number of the button I pressed on the remote appeared on the serial console (57600b / s). After attaching a better antenna, control commands sent by remote controls working for one of the neighbors on the estate began to appear. Maybe there will be data from recently popular weather station sensors? After connecting the transmitter, the design also allows you to send commands to wireless devices.
    Having the ESP8266 board, we can forward the information using WiFi.
    Arduino Mega + WiFi ESP8266 module, opinion, applications

    Cool! Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    TechEkspert
    Editor
    Offline 
    TechEkspert wrote 3355 posts with rating 2682, helped 11 times. Been with us since 2014 year.
  • #2
    xn_tec
    Level 10  
    In my opinion, the connection is very sensible, because simple modules on ESP8266 do not have an antenna output and the ones that have are relatively expensive. Here, for a few dozen zlotys, we have the whole thing with convenient ESP8266 programming.

    But from what I read somewhere, this module causes a lot of problems and many users have not managed to get it to work.
  • #3
    TechEkspert
    Editor
    @xn_tec thanks for the info, do you know what are the problems with this module? I have this module on the table, maybe I will be able to check these problems in practice?
  • #4
    xn_tec
    Level 10  
    From what I found people had problems with communication between Atmega and ESP8266. There were also a lot of questions like "why doesn't it work for me" and somehow no answer. Someone wrote there that this tile is rubbish and that every now and then someone writes about some problems. I can't find a link to this discussion in the forum as I found it a few weeks ago.

    I'll get it tomorrow, so we'll see how true that is.
  • #5
    khoam
    Level 40  
    xn_tec wrote:
    From what I found people had problems with communication between Atmega and ESP8266.

    A large number of cases concerned problems with finding (guessing) the "factory" speed at which ESP communicates over RX / TX. Permanently setting this speed in ESP (i.e. so that it is as we wish after the reset) is also not so banal and there are contradictory information on the Internet on this subject. I am curious how fast ESP communicates with Atmega over RTX / TX in this particular copy.
  • #6
    miszczo997
    Level 28  
    khoam wrote:
    Permanently setting this speed in ESP (i.e. so that it is as we wish after the reset) is also not so banal and there are contradictory information on the Internet on this subject.

    After all, on the espressif site there is a pdf signed as ESP8266 AT Instruction Set, where it says how to do it (AT + UART_DEF == XX).
    I had little fun esp, but there were no problems with setting the baud rate.
    BTW, the maximum baud speed I was able to get from ESP8266 was 4mb / s. Perhaps more can be done, but my usb uart converter simply did not do the job anymore.
  • #7
    khoam
    Level 40  
    miszczo997 wrote:
    After all, on the espressif site there is a pdf signed as ESP8266 AT Instruction Set, where it says how to do it (AT + UART_DEF == XX).

    Assuming there is the original firmware in ESP, and this is quite a rare case where the merchandise comes from ali.
  • #8
    pier
    Level 23  
    TechEkspert wrote:

    As a practical test of the module, this time I tested the MEGA RFLINK GATEWAY dedicated to Arduino. The RFLink project allows to decode transmissions from many wireless devices, such as weather station sensors, remote controls operating in ISM bands. I connected the data output of a very simple and cheap 433MHz OOK receiver to the D19 pin. The authors have prepared hints on which modules to use: http://www.rflink.nl/blog2/wiring The software to be downloaded on the project website http://www.rflink.nl/blog2/download uses the Arduino bootloader to upload the firmware, which simplifies the testing process. It turned out that two accidentally owned remotes are correctly decoded and information about the number of the button I pressed on the remote appeared on the serial console. After attaching a better antenna, control commands sent by remote controls working for one of the neighbors on the estate began to appear. Maybe there will be data from recently popular weather station sensors? After connecting the transmitter, the design also allows you to send commands to wireless devices.


    Put together such a little thing and you can move someone quite nervously.

    As for the tile itself, it doesn't make much sense in my opinion. It will confuse the user more than it will benefit. The combination of ESP8266 and AVR can only be useful to save energy and this board is rather power-hungry.
    When it comes to increasing the amount of ESP I / O there are nice little I2C expanders.
  • #9
    TechEkspert
    Editor
    @pir In the assumption of the authors of RFlink, it was supposed to be used not so much as a joke, but to use remotely controlled sockets as actuators, remote controls as entry points to the control system, as well as weather station sensors as data sources.

    Considering the number of supported devices, the RFlink team had to work hard on it ...
  • #10
    LChucki
    Level 31  
    TechEkspert wrote:
    Could ESP8266 and ATmega2560 find better applications?

    ESP8266 has a lot of limitations, ESP32 is definitely better at a slightly higher price. And that unfortunate AVR. ArduinoIDE supports ARM, so why not e.g. STM32F107 + ESP32? The price is probably similar. Maybe cheaper, with F103 64 or 100pin, but probably better F4xx?
    ESP + AVR is such a strange marriage, a Mercedes that is transported on a tow truck by the F126p. Mercedes is for air conditioning.
  • #11
    xn_tec
    Level 10  
    LChucki wrote:
    ESP + AVR is such a strange marriage, a Mercedes that is transported on a tow truck by the F126p. Mercedes is for air conditioning.


    I do not understand your complaint. After all, it is a cheap board for simple things based on all the benefits of Arduino. For more serious games, there are many more powerful solutions based on ARM + WiFi.
  • #12
    LChucki
    Level 31  
    xn_tec wrote:
    LChucki wrote:
    ESP + AVR is such a strange marriage, a Mercedes that is transported on a tow truck by the F126p. Mercedes is for air conditioning.


    I do not understand your complaint. After all, it is a cheap board for simple things based on all the benefits of Arduino. For more serious games, there are many more powerful solutions based on ARM + WiFi.

    I don't really understand AVR + ESP like the 8051 + DigiConnect.
    However, I did not like ESP8266 as a platform and I use it as a UART-WiFI bridge (why not I2C or SPI - WiFI, that's another topic, although it would be better), often the ESP alone is enough. If not, you need to save not AVR, but ARM.
    Really weird, having a lot of RAM, FLASH etc to use alongside the archaic AVR. In the case of modifying the project, ok, I add ESP, but how do I build something from scratch and a powerful (compared to AVR) ESP, which gets bored, is only supposed to be "pushed" or "robotic"? All in all, it's like in a "normal" world, a president, director with zero education and an employee with a university degree who deserves it knows each other and will never be anything more than a manager.
  • #13
    xn_tec
    Level 10  
    LChucki wrote:
    Really weird, having a lot of RAM, FLASH etc to use alongside the archaic AVR.


    You are looking for hardware. For me personally, it is a very nice module, because I have a lot of projects that are based on Mega and there is no point in converting them into anything else, because what is quite enough. At the same time, it would be good to upgrade the radio because here it is of better quality than on ESP boards for PLN 12.

    As for me, the matter is obvious: you need something simple and you want to do it on arduino (because you are a beginner, because you have made something before etc.) - you choose this album. You need something stronger, you choose ESP32 or something even better.

    LChucki wrote:
    All in all, it's like in a "normal" world, a president, director with zero education and an employee with a university degree who deserves it knows each other and will never be anything more than a manager.


    In a normal world, "what you know" thinks he can replace the president or the director because he is stupid. But when you make him a president or director, it turns out that he cannot cope and makes stupid mistakes because technical knowledge is not everything, and outside his field, this specialist knows nothing.
  • #14
    LChucki
    Level 31  
    xn_tec wrote:
    You are looking for hardware. For me personally, it is a very nice module, because I have a lot of projects that are based on Mega and there is no point in converting them into anything else, because what is quite enough. At the same time, it would be good to upgrade the radio because here it is of better quality than on ESP boards for PLN 12.

    Tusie, I completely agree. Modernization ok, new design no.

    xn_tec wrote:
    But when you make him a president or director, it turns out that he cannot cope and makes stupid mistakes because technical knowledge is not everything, and outside his field, this specialist knows nothing.

    I mean CEOs, who start their governments with "cleanup - why this cardboard is here, etc, that is nothing meroteric". I will not divulge the fact that there must be some reasonable order, but the "president" has been gone for 5 years, and the one who "threw" the boxes is still working (soon - retirement). The cleaner, what the "president" wanted to lay off on the first day, is working, and so is the security guard. I mean such "presidents" and "directors".
  • #15
    db8811
    Level 10  
    Hello.
    at the beginning I would like to point out that I am not a specialist in the field and I am just exploring and learning about "topics" related to Arduino etc. For a few days I am the owner of the ATMega 2560 + ESP 8266 board ATMega 2560 + ESP 8266 i have some problems. The problem is the lack of communication between the ATMega ESP.
    I currently have a working project: Arduino Uno controls 6-7 relays from the lighting communication with the Raspberry Pi home automation management system Domoticz + wireless Wemos D1 (espEasy) 2 thermometers (DS18b20 / BMP280) and it works! The Raspberry Pi is connected to the Arduino via USB and they are side by side and that is what I would like to change.
    I bought an ATMega + ESP 8266 in order to be able to use it to control these 6 or 7 relays instead of Arduino Uno (I have a program loaded for ATMega and it works)
    [syntax=c]

    // Enable debug prints to serial monitor
    #define MY_DEBUG


    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69

    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    //#define MY_RF24_PA_LEVEL RF24_PA_LOW

    // Enable serial gateway
    #define MY_GATEWAY_SERIAL

    // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 38400
    #endif

    // Flash leds on rx/tx/err
    // #define MY_LEDS_BLINKING_FEATURE
    // Set blinking period
    // #define MY_DEFAULT_LED_BLINK_PERIOD 300

    // Inverses the behavior of leds
    // #define MY_WITH_LEDS_BLINKING_INVERSE

    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    #define MY_INCLUSION_BUTTON_FEATURE

    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP

    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    #define MY_INCLUSION_MODE_BUTTON_PIN 3

    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN 5 // the PCB, on board LED

    #include
    #include
    #include

    // Enable repeater functionality for this node
    #define MY_REPEATER_FEATURE


    #define RELAY_1 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_2 5
    #define RELAY_3 6
    #define RELAY_4 7
    #define RELAY_5 8
    #define RELAY_6 9


    #define NUMBER_OF_RELAYS 6 // Total number of attached relays
    #define RELAY_ON 1 // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay

    #define BUTTON1_PIN A1
    #define BUTTON2_PIN A2
    #define BUTTON3_PIN A3
    #define BUTTON4_PIN A4
    #define BUTTON5_PIN A5
    #define BUTTON6_PIN A0


    void before() {
    for (int sensor=1, pin=RELAY_1; sensor
  • #16
    TechEkspert
    Editor
    The Mega communicates with the ESP over UART when jumpers 1 and 2 are turned ON, the RXD0-TXD0 / RXD3-RXD3 switch allows you to select the UART (0 or 3) on the Mega which will be used to communicate with the ESP.

    For the test, I would run a simple program that sends something on the UART with a certain bandwidth on one module, and the other module tries to receive it and perform some action. Connecting to USB may allow you to listen in on the transmission.

    You may need a code from the material about UNO + ESP: https://www.elektroda.pl/rtvforum/topic3513269.html

    This will be the first step to check the reason for the lack of communication.
    Make trials and let us know what you have established.

    If you already have a working code on the Arduino UNO that controls the relays, then translating it into the Mega + ESP module is a nice idea, giving up the connection with RPi via UART via USB towards TCPIP.

    When you unplug UNO from RPi and connect to PC, what messages do you need to send from console to UNO to activate certain relays?
  • #17
    xn_tec
    Level 10  
    If you do not have communication between Atmega and ESP, it is 99% due to the lack of a suitable software in ESP. Program it using a standard tool and it should start working. For me, it was like that and from what I can see, these boards are usually sent without an ESP program.
  • #18
    MarekMOL
    Level 1  
    After two years, I will stick to this discussion.
    In 2018 I started my first Arduino project. In the second version, I used this board because of easy programming. As a beginner, I must say that it helped me get started with the task at all.
    Briefly, my solution works in the warehouse to indicate the pallet locations where the worker puts the containers with the products.
    The employee reads the barcode from the container to the tablet, the tablet saves the information in the database and sends the information to the arduino using WIFI, which palette to highlight to avoid storage errors. Up to 32 different products can be stored at the same time. And here the multitude of exits from this tile came in handy.
    Two years of flawless operation, probably thanks to the simplicity of the whole.
    In my opinion, it was worth choosing this plate.
    Greetings. Marek.
  • #19
    TechEkspert
    Editor
    Thank you for your opinion and congratulations on a successful project.
    You will probably raise the pressure for everyone who thinks that arduino is not suitable for more serious things :)
    While in automation, where there is a risk of danger, it is better to use solutions dedicated to the industry,
    this, as you can see, is used in solutions supporting arduino.