logo elektroda
logo elektroda
X
logo elektroda

Arduino UNO + WiFi ESP8266 module, opinion, commissioning, test

TechEkspert 
Arduino UNO + ESP8266 module on one board contains UNO based on ATmega328 and WiFi module based on ESP8266. The cost of the module on auction portals is ~ $ 7 Link . The module can be powered from a micro USB socket or DC 7-12V connector. Communication with the modules takes place via the USB UART converter based on the CH340 chip. Arduino UNO works with 5V, while ESP8266 is 3.3V. The ESP8266 pins are available on an additional connector, similarly the ISP connector allows you to program ATmega328 without bootloader:


Looking at the PCB, you can see some assembly inaccuracies, e.g. the uFL connector of an external WiFi antenna. As standard, we can use a WiFi antenna in the form of a path on a printed circuit board.


Description of the ESP8266 pins is on the other side of the board:


When connecting the ESP8266 and UNO pins, remember about different voltage levels, similarly when connecting the peripherals.
After setting the switches ESP8266 and ATmega328 can communicate using UART, similarly setting the jumpers allows you to connect the UART USB converter with the selected module for programming.


Connection of modules via UART - DIP 1 and 2 ON
USB UART connection with ATmega328 - 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

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

Arduino UNO can extend the capabilities of ESP8266, e.g. in terms of the number of I / O, ADC, PWM,
offload / buffering for ESP during measurements or communication with peripherals, increasing the energy efficiency of ESP8266 similar to here: Link

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

Below is information on how to integrate both parts of the module with Arduino, and send data to Thingspeak:
ESP8266 WIFI boot, start from IoT, Blynk, Thingspeak
Arduino Uno first run. DHT22, BMP180, FFT LED RGB.

A practical example of using the module ,
data transmission from 6 ADC Arduno Uno channels to Thingspeak via WiFi ESP8266:

Code for Arduino UNO ,
for the duration of programming, switch to the "ON" position USB + MCU (switches 3 and 4),
for the time of cooperation between Arduino UNO and ESP8266, select the MCU + ESP (1,2) option.

Code: C / C++
Log in, to see the code


Code for ESP8266 ,
for the programming time, set the switches 5,6,7 in the "ON" position,
for the duration of operation, set the switches 1,2 in the "ON" position,
if we want to observe messages on the serial terminal, in the "ON" position, set the switches 5,6 or 1,2,5,6.
In the code, as described, we put the SSID of our WiFi network and password,
and also thingspeak api key and our channel number.

[syntax=c]//programing USB+ESP GND-GPIO0 on (5,6,7)
//runing MCU+ESP (1,2)
//debug ESP+USB on (5,6) or (1,2+5,6)
//serial 9600bps
//send data from ADC to thingpseak

#include
#include

#define UART_SPEED 9600
#define ADC_CH 5

//Credential and parameters for WiFi
const char* ssid = "SSID WiFi";
const char* password = "WiFipassword";
//Parameters for thingspeak
const char * apiKey = "apiKeyForYourthingspeak";
unsigned long myChannelNumber = 123456;

// api.thingspeak.com
const char* server = "api.thingspeak.com";

WiFiClient client;

void setup() {
byte n = 0;
byte mac[6];

Serial.begin(UART_SPEED);

//Connecting to WiFi
Serial.print("Connecting to WiFi SSID: ");
Serial.print(ssid);
Serial.println("");
WiFi.begin(ssid, password);

WiFi.macAddress(mac);
for (n; n < 6; n++) {
Serial.print(mac[n], HEX);
if (n < 5)
Serial.print(":");
else
Serial.println("");
}
n = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
if (n > 60) {
ESP.restart();
Serial.println("restart ");
}
n++;
}
Serial.println("");
Serial.println("WiFi connection OK");
ThingSpeak.begin(client);
delay(10000);

}



void loop() {
String in_buff;
int adc_val;
float voltage;
#define ADC_MAX 1023
#define V_REF 5.0
for (byte n = 0; n

About Author
TechEkspert
TechEkspert wrote 6253 posts with rating 4910 , helped 16 times. Been with us since 2014 year.

Comments

krisRaba 28 Oct 2018 19:46

It is interesting that they put ESP on their PCB, and not, as is often the case, in the form of an additional module, e.g. here https://www.elektroda.pl/rtvforum/topic3512709.html (here just ESP32, but... [Read more]

tmf 28 Oct 2018 20:03

IMHO such a combination does not make much sense. First, the different voltage domains. Super inconvenient 5V in this case, they could already power the AVR from 3.3V which would have saved the trouble.... [Read more]

TechEkspert 28 Oct 2018 20:22

There is also a combination of ESP8266 and Arduino MEGA (ATmega2560) Link ~ $ 10, do you see applications for such a module? I will also have the opportunity to test it. [Read more]

khoam 28 Oct 2018 20:25

Tensilica Xtensa lx106 MCU is not an ARM, I agree with the rest. [Read more]

Szyszkownik Kilkujadek 29 Oct 2018 08:17

Stupid question: Isn't it better to use "LoLin ESP8266 CH340 NodeMcu V3 Lua module"? [Read more]

tronics 29 Oct 2018 08:40

As a colleague noted above, tensilica is not an arm, and such a combination is, for example, to use deep sleep well. ESP itself can wake up from deep sleep, but we are limited by the maximum deep sleep... [Read more]

tmf 29 Oct 2018 09:56

It's hard to agree with that. The wifi protocol itself and working in this mode is so power-consuming that the saved microamps do not matter much. It would be better to use the ESP32, which has radio... [Read more]

khoam 29 Oct 2018 12:25

Or maybe Arduino Due ? "Successor" to Uno, but already under process by ARM. It also has support from the standard Arduino framework. It is available on but slowly priced at $ 15-16 with shipp... [Read more]

pier 29 Oct 2018 13:20

If esp8266 and low power consumption in deep sleep is shallow TrigBoard . I just don't know where to buy it. [Read more]

tronics 29 Oct 2018 13:49

SAMD21 could be a good option, interfaces more than mega328, there is DMA, there is 3.3V, there is an event system, some timers, quite good ADC and DAC, there is also USB. You can write firmware that will... [Read more]

TechEkspert 29 Oct 2018 18:56

@krisRaba Unfortunately, you can see savings in the quality of assembly, but the low price has to come from something. @khoam Due to this it could be a good duo with esp8266, but for the test I... [Read more]

khoam 29 Oct 2018 19:39

Well, generally wherever the combination of AVR + ESP8266 is insufficient due to memory or processor resources. In particular, in my case, I see Due as an internet Youtube radio receiver, with a nice... [Read more]

tronics 29 Oct 2018 20:01

@khoam - the thing is that you can do it cheaper on ESP32 (mouser - version with 2MB flash 2.7 euro) than ATSAM3X8E 7 euro + ESP885 1MB 1.5 euro. The only real problem is that the ESP32 arduino framework... [Read more]

khoam 29 Oct 2018 20:13

But ESP32 is not ARM either. Moreover, the support of the GNU or Clang development environment for ARM is much better. Also, IMHO doesn't bode well for ESP32, I think it will be the same as AVR32.... [Read more]

tronics 29 Oct 2018 20:31

It doesn't matter if you are using a framework. If you don't use it, doing it on 2 different chips is even more painful. Okay, if not ESP then what? Well, we have WiFi, a few realtecs, texas... [Read more]

krisRaba 29 Oct 2018 20:54

hmm ... is there an option to download music from YT without a picture? Did you plan to download the whole thing and only play audio? I ask because I often play YT as background music and I feel sorry... [Read more]

khoam 29 Oct 2018 20:59

Exactly. [Read more]

TechEkspert 29 Oct 2018 21:14

Is there an example project of this type "YT music"? [Read more]

khoam 29 Oct 2018 21:28

This framework just uses the GNU compiler and linker. I would like to settle for adding a WiFi adapter to the USB port for PLN 13 with delivery. Added after 6 [minutes]: Source code analysis... [Read more]

%}