Arduino ESP8266 Tutorial: First look at the WeMos D1 Arduino compatible ESP8266 Wifi Board

Home/Arduino Projects/Arduino ESP8266 Tutorial: First look at the WeMos D1 Arduino compatible ESP8266 Wifi Board

Arduino ESP8266 Tutorial: First look at the WeMos D1 Arduino compatible ESP8266 Wifi Board

Arduino ESP8266 Tutorial: First look at the WeMos D1 Arduino compatible ESP8266 Wifi Board

In this video we take a look at the WeMos D1: a Wi-Fi enabled Arduino compatible board based on the ESP8266 chip. The price of it is so tempting, less than 9$. Without any second thoughts I ordered it a few days ago I received it and started working with it.

——————–
WHERE TO BUY
——————–

1. ESP8266 BOARD: http://bit.ly/WEMOS_D1

2. OLED Display: http://bit.ly/OLED_DISPLAY

3. Small Breadboard: http://bit.ly/SmallBreadboard

4. Wires: http://bit.ly/WiresArduino

The board looks like an ordinary Arduino board. The dimensions and the pin layouts are exactly the same. So, this board is compatible with all the existing shields for Arduino. But don’t expect them to work at once, since the libraries available for the ESP8266 chip are few so far. The board, instead of an ATMEGA chip that standard Arduino boards use, use the impressive ESP8266 WiFi chip!

The ESP8266EX chip that the WeMos D1 board uses offers:
• A 32 bit RISC CPU running at 80MHz
• 64Kb of instruction RAM and 96Kb of data RAM
• 4MB flash memory! Yes that’s correct, 4MB!
• Wi-Fi
• 16 GPIO pins
• I2C,SPI
• I2S
• 1 ADC

That’s a beast compared to a standard Arduino. It’s a 32bit processor that runs at a much higher frequency. The performance difference with a standard Arduino I expect to be huge! The Arduino Uno, offers 2KB of RAM memory and this chip has 160Kbs. The Flash memory of the device is also 100 times bigger than Arduino. Of course, the main reason that everyone is using this chip, is that it has embedded Wi-Fi! All that for less than 10$. The hardware looks fantastic. Now let’s see the software of it.
In order to use the board, you have to download an add-on for the Arduino IDE. Go to File -> Preferences and enter this link here. I copied this link from the WeMos website. Then go to Tools -> Board and load the Boards Manager. The all you have to do is to download the file for the ESP8266 boards. After that you can select the WeMos D1 board and you are ready to use it. Let’s try the board. Let’s upload the standard blink program. We have to go to File -> Examples -> ESP866 -> Blink in order to load the program and then press the upload button. After a while the LED on the ESP8266 chip will start flashing. Note, that this is not the standard Blink sketch we were using so far. It is a similar one developed for the ESP8266. Due to the different hardware architecture of the ESP8266 most programs will not work without modifications. Also most of the libraries need to be re written in order to work as well. That’s a lot of work that needs to be done.
The first thing I wanted to find out was if it is easy to connect to the internet with this board. So I developed a simple program that connects to my home Wi-Fi network, and then visits my website educ8s.tv to download some text that it is stored in a .txt file at this URL educ8s.tv/test.txt. As you can see, in the little OLED display, after a while the text “It works fine” appears. That’s the text from the .txt file on the server! The board works flawlessly! Our Arduino projects can now access the Internet with ease. The OLED display I was using in the past with Arduino works fine as well with the use of the appropriate library developed for the ESP8266.

——————–

CODE OF THE PROJECT
——————–

Download

 

 

 

SUBSCRIBE ON YOUTUBE
——————–

Never miss a video: Subscribe to educ8s.tv

2017-03-31T12:02:13+00:00

12 Comments

  1. ALI May 8, 2016 at 11:19 am

    that is amazing …. thank you for this great effort

  2. Alojamiento May 27, 2016 at 11:11 pm

    If your application requires maximum battery life, you ll likely need to make liberal use of the ESP8266 s deep sleep functionality. That ll be covered later in this tutorial.

  3. Mekaci June 26, 2016 at 10:11 am

    I am getting this error while trying to compile the wifitest file on arduino:

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp: In member function ‘virtual void ESP_SSD1306::drawPixel(int16_t, int16_t, uint16_t)’:

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp:130:14: error: ‘swap’ was not declared in this scope

    swap(x, y);

    ^

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp: In member function ‘virtual void ESP_SSD1306::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)’:

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp:594:16: error: ‘swap’ was not declared in this scope

    swap(x, y);

    ^

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp: In member function ‘virtual void ESP_SSD1306::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)’:

    C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp:662:16: error: ‘swap’ was not declared in this scope

    swap(x, y);

    ^

    exit status 1
    Error compiling for board WeMos D1 R2 & mini.

    Would you help how to fix this please ? I use Arduino 1.6.9 version too, thank you.

    • Ryan April 26, 2017 at 3:21 pm

      Had a similar problem.

      C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp: In member function ‘virtual void ESP_SSD1306::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)’:

      C:\Arduino\libraries\OLEDESP\ESP_SSD1306.cpp:594:16: error: ‘swap’ was not declared in this scope

      swap(x, y);

      If you have an older version of the ESP_SSD1306.h in your project import the below library and be sure to pick ESP8266 SSD1306 from the library dropdown.

      https://github.com/somhi/ESP_SSD1306

  4. David Clapp July 2, 2016 at 6:47 pm

    Have you measured current draw in deep sleep? The RT9013 they use seems to have a low Iq – unlike the 1117-3.3 often used in other ESP8266 boards. It looks like one could feed in a LiPo directly to the “+5V” Arduino pin.

    The only other low Iq I’ve found is the SPX6819 that Adafruit used on their Huzzah. I’ve rolled my own boards using 1825S that seem to be running off 1W solar panels driving the cheap TP4056 chargers into 1800 mA-Hr LiPos. They wake up every 30 minutes, reconnect to wifi and upload to Thingspeak.
    Working well in summertime. When winter comes I may need a slightly larger solar panel.

    I’m hopeful these Wemos boards can work as well. Nice to have the schematic available!

    The other loads would seem to be the USB chip on the power LED, but the schematic shows a 10K on the LED.

    This seems like a nice platform with mounting holes, 4-pin connectors for UART and I2C.

    • David Clapp July 3, 2016 at 1:05 am

      My comments were based on the R2 version. It will be interesting to so the differences between that one and the original.

  5. David L Jenkins July 14, 2016 at 6:44 pm

    Can you give us a schematic on how this is wired? Especially the OLED. Thanks

  6. anilkumar September 2, 2016 at 11:53 am

    where i found rtc library for wemos D1 R2 mini can u plese tell me who may known

  7. Mikeey01nzl September 29, 2016 at 7:02 pm

    Excellent, please do more. I’ve purchased a couple of these and learn a lot from what you do, please do more on the D1

  8. J B March 21, 2017 at 4:45 am
  9. Lewis Karambwe April 4, 2017 at 4:42 pm

    How do you interface an arduino mega board to the esp8266 development board

  10. Swapnil Patil April 14, 2017 at 9:40 pm

    how do i operate my esp8266 d1 mini by android phone by sending data to firebase
    (firebase as a inerface between phone and esp).
    please give me code.i am new learner .

Comments are closed.

Close