- UNO R3 + WIFI ESP8266 + CH340G Arduino and WIFI single board
- Arduino UNO + WiFi ESP8266 (micro usb)
- Рекомендуемые товары
- MEGA Sensor Shield v2.0
- Proto Shield для Arduino Mega
- Корпус для Arduino Mega прозрачный акриловый
- Черный ABS корпус для Arduino Mega
- Адаптер питания 6В 1А, штекер 5.5 х 2.5
- UNO+WiFi R3 ATmega328P+ESP8266, 8Mb flash, USB-TTL CH340G, Micro-USB
UNO R3 + WIFI ESP8266 + CH340G Arduino and WIFI single board
This specific development board has numerous advantages (which will be covered later) but lacks comprehensive documentation. This surprising because it would seem the ideal development platform for WiFi enabled Arduino projects. Hopefully this project can help with providing more details.
The Arduino ESP8266 WIFI development board
A search for the following text “UNO R3 WIFI ESP8266 ATMEGA328 CH340G” will yield numerous results of sites that sell this particular development board. It can be found on eBay, AliExpress, Banggood and other sites. Cost is approximately 10 to 14 USD before shipping. Before purchasing, make sure that the photograph in this article matches the picture on the selling site.
High level specifications of the board as follows:
- Model Number: UNO+WiFi-R3-AT328-ESP8266-32MB-CH340G
- Supply Voltage: 6 to 9V
- CPU: ATmega328
- WiFi: ESP8266
- USB- TTL converter: CH340G
- Header PinOut: Uno R3
A description of the components on the board in the image below:
Some notes on the components:
- The board includes a 5V and 3.3 V Voltage regulator to allow for the differing voltage requirements for the ESP8266 and ATMega328
- Instead of the large USB connector used on a standard Arduino, this board uses a micro USB connector for serial communication and programming
- The Reset button rests both the ESP 8266 and ATMega328
- The header pin out is standard Arduino; this allows any Arduino compatible shield to be connected to this development board
- The board includes a small WiFi antenna. If greater range is required, provision is made for connecting an external antenna
Advantages of The Arduino ESP8266 WIFI development board
It seems that this specific board has several advantages over similar solutions (specifically the WeMos D1 board)
The Arduino pin out allows for connection of many of the Arduino shields available
The different voltage levels are built into the board and become transparent to the User
It allows for easy implementation of WiFi communication in Arduino projects
As there are two processors incorporated on the board, a greater range of processing power is available
Communication between the ATMega328 and the ESP8266 is via the serial lines and utilizes the well known Serial library
Crucial to the operation of the board is the Mode Selection switch, consisting of a 8 switch DIP mounted in the center of the board.
The mode switch allows for four possible settings
Mode 1 – USB Serial connected to ATMega328 for both programming and serial communication
Mode 2 – USB Serial connected to ESP8266 for programming
Mode 3 – USB Serial connected to ESP8266 for serial communication
Mode 4 – ATMega328 and ESP8266 serial connected together, allowing for serial communication between the two devices. The voltage difference between the Arduino and ESP8266 is taken care of in the board.
The ESP8266 requires that GPIO0 is pulled to ground while programming, a requirement not applicable to the ATMega328. Hence there are two separate modes for the ESP8266; switching SW7 on grounds GPIO0.
The DIP switch settings for these modes in the following table:
DIP Switch settings for various modes. X = Switch On Blank = Switch Off
The board has a legend showing the switch settings.
Programming the ATMega328
As a first demonstration, we can program the ATMega328 with the Blink Sketch. Steps as follows:
- Disconnect the board from power
- Using a paper clip or pencil point (or any other sharp end device), set the switches to Mode 1. This means that SW3 and SW4 are On, all other switches are off.
- Call up the Blink Sketch in the Arduino IDE from Examples → Basic
- Connect the Micro USB port to your computer with a USB to Micro USB cable
- Upload the Sketch
The ATMega328 will automatically reset and the LED labeled “L” will start blinking.
Success, the ATMega328 is working and can be programmed. Simple.
This part is a little more complicated.
Before programming the ESP8266, you have to ensure that the Arduino IDE you are using is configured to do this type of programming. There are numerous articles on the Internet explaining how to do this. A search of “program ESP8266 from Arduino IDE” will provide many results.
The basic steps are as follows:
- In File → Preferences, add a url to the Additional Boards Manager: http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Under Tools → Boards → Boards Manager, Search for ESP8266 and install latest version of “ESP8266 by ESP8266 Community”
- Once this is done, you should have an option under Tools→ Board for a ESP8266 Boards. Choose Generic ESP8266 Module.
After all that you are ready to get a Blink program working on the board. There appears to be no built in LED for the ESP8266 on this board, so you have to connect an LED to demonstrate the blink program.
The ESP header on the board allows access to GPIO12 from the ESP8266, this will be used for connecting the LED. The pin functions are given on the rear of the board. Connect a 330 Ohm (or similar) and LED wired in series between GPIO12 and the GND pin on the Arduino header.
Follow the following steps:
- Make sure the Arduino IDE is set for the Generic ESP8266 Module
- Remove power from the board. Set the switches to Mode 2. This means that SW5, SW6, SW7 are On. all other switches are Off.
- Connect the Micro USB port to your computer with a USB to Micro USB cable
- Upload the Sketch Blink ESP8266
/*
ESP8266 Blink
Blink the LED on the ESP8266 module
This example code is in the public domain
The external LED on the ESP8266 module is connected to GPIO12
*/
void setup()
pinMode(12, OUTPUT); // Initialize pin 12 which is GPIO12 as an output
>
// the loop function runs over and over again forever
void loop()
digitalWrite(12, LOW); // Turn the LED off
// low is off on the ESP8266-12
delay(1000); // Wait for a second
digitalWrite(12, HIGH); // Turn the LED on by making the voltage HIGH
delay(2000); // Wait for two seconds (to distinguish between low and high)
>
bool toggle;
String incomingString;
void setup()
pinMode(12, OUTPUT); // Initialize pin 12 which is GPIO12 as an output
toggle = false;
Serial.begin(115200); //All serial communication with ESP8266 at 115200 baud
>
void loop()
if (Serial.available() > 0)
// read the incoming string from the Arduino
incomingString = Serial.readString();
// If the incoming string from the Arduino equals "change" then we toggle the LED
if (incomingString.equals("change"))
digitalWrite(12, toggle); // Turn the LED off or on
toggle = !toggle;
>
>
delay(50); // Wait for half second
>
If successful, the Arduino IDE will produce the following message – “Hard resetting via the RTS pin”
Remove power from the board and toggle SW7 to off. This takes the ESP8266 out of programming mode.
Restore power to the board and the LED connected to GPIO12 should start blinking. Success!
Communicating between the ATMega328and ESP8266
The ATMega328 and ESP8266 can communicate via the serial bus include in both chips. This communication is bilateral; ATMega826 can send information to the ESP8266 and vice versa.
To demonstrate this, a simple circuit connected to the ATMega328 can activate an LED connected to the ESP8266. Circuit diagram below.
The programming steps as follows.
- Set the DIP switch to Mode 1 (SW3 and SW4 are On )with power removed. Restore power and upload the Arduino Sketch “ArduinoESPCommunication
- Remove power and set the DIP switch to Mode 2 (SW5, SW6, SW7 are On)
- Change Arduino IDE to ESP8266 programming mode and upload the sketch “ESPRecieveCommunication”
- Remove power and set the dip switch to Mode 4 (SW1 and SW2 are On)
- Restore power
const int buttonPin = 2; // the number of the pushbutton pin
int buttonState = 0;
void setup()
// Initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200); //All ESP8266 serial communication at 115200 baud
>
void loop()
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH)
// Send a message to the ESP8266
Serial.write("change");
// Flash the built in LED to confirm that button push was registered
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500);
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(250);
>
else
delay(25);
>
>
Pressing the push button will cause the ATMega328 built in LED to flash and the LED connected to the ESP8266 will come on.
Pressing the push button again will flash the built in LED and turn off the LED connected to the ESP8266
Communication between the ATMega328 and the ESP8266 uses the Serial.write(“change”) and Serial.readString() commands. See the sketches for more details.
It is uncertain why this specific development board is not more popular (based on the number of articles and documentation available on line). It has several advantages over trying to implement an Arduino with a separate ESP8266 board and provides dual processing power.
Good luck using this board!
Arduino UNO + WiFi ESP8266 (micro usb)
Представляет собой модернизированную версию платы Arduino UNO. Полная интеграция на одной плате микропроцессора ATmega328 и чипа Wi-Fi ESP8266. Все модули могут работать вместе или каждый в отдельности. и у каждого своя распиновка подключения. Удобное решение для разработки новых проектов, требующих Wi-Fi. Через USB вы можете обновлять скетчи и прошивки как для ATmega328 так и для ESP8266. Для этого на борту имеется USB-serial конвертер CH340G. На плате имеется DIP-переключатель, для подключения модулей.
- Напряжение питания: 5 В
- Входное напряжение (рекомендуемое): 7-12 В
- Входное напряжение (предельное): 6-20 В
- Цифровой ввод-вывод: 14 линий (6 из них — ШИМ)
- Аналоговые входы: 8
- Постоянный ток на линиях ввода-вывода: 40 мА
- Постоянный ток на линии 3.3В: 50 мА
- Flash-память: 32 кб, 0.5 кб из них используются для загрузчика
- SRAM-память: 2 кб
- EEPROM-память: 1 кб
- Тактовая частота: 16 МГц
- 80 MHz 32-bit процессор Tensilica Xtensa L106
- IEEE 802.11 b/g/n Wi-Fi.
- Поддержка: WEP и WPA/WPA2.
- Порты: 14 ввода-вывода(из них возможно использовать 11), SPI, I²S, UART, 10-bit АЦП. I²C возможен только через bit-banging.
- Питание: 2,2-3,6 В
- Потребление: до 215 мА в режиме передачи, 100 мА в режиме приема, 70 мА в режиме ожидания.
Рекомендуемые товары
MEGA Sensor Shield v2.0
Плата расширения для Arduino Mega, позволяющая подключить одновременно боль..
Proto Shield для Arduino Mega
Плата расширения для Arduino Mega, идеально подходит для прототипирования у..
Корпус для Arduino Mega прозрачный акриловый
Прозрачный акриловый корпус для Arduino Mega. имеет отверстия под сило..
Черный ABS корпус для Arduino Mega
Черный пластиковый для Arduino Mega. имеет отверстия под силовой разъе..
Адаптер питания 6В 1А, штекер 5.5 х 2.5
Адаптер питания 6В 1А штекер 5.5 х 2.5 мм. Длина кабеля 90 см.
UNO+WiFi R3 ATmega328P+ESP8266, 8Mb flash, USB-TTL CH340G, Micro-USB
Это версия классической платы ARDUINO UNO R3. Полная интеграция микроконтроллера Atmel ATmega328 и IC Wi-Fi ESP8266 с флэш-памятью 8 МБ и конвертером USB-TTL CH340G на одной плате. Все модули могут работать вместе или независимо.
На плате есть переключатель режима работы с 8-ю позициями
Состояние переключателя и выбор режима:
CH340 connect to ESP8266 (upload sketch)
CH340 connect to ESP8266 (connect)
CH340 connect to ATmega328 (upload sketch)
All modules work independed
После выбора режима платы можно перейти к настройке IDE
Важно, чтобы при программировании модуля ESP8266 необходимо нажать кнопку «Режим»,
Чтобы начать открывать среду программирования Arduino IDE и перейти к настройкам
Затем в окне, появляющемся в URL-адресах дополнительных досок (в красном) добавьте ссылку http://arduino.esp8266.com/stable/package_esp8266com_index.json для установки в дополнительных скриптах Arduino IDE, которые будут работать с модулями ESP8266, И нажмите «ОК».
Затем перейдите в раздел «Инструменты»> «Совет»> «Менеджер плат»
В появившемся окне прокрутите список до скрипта esp8266 от сообщества ESP8266 и нажмите.
В правом нижнем углу вы сможете выбрать версию программного обеспечения, выбрать версию 2.1.0 (самая новая) и нажать кнопку «Установить»
После установки закройте окно и откройте «Инструменты»> «Совет» и посмотрите список доступных устройств на чип-программировании ESP8266
Затем вам нужно выбрать карту, как показано на рисунке (общий модуль ESP8266)
Выберите скорость загрузки — 115200