Three ESP8266 boards - Page 1
Forum section: electronics / general

author: mojoe
author_rank: Frequent Contributor
timestamp: May 09, 2016, 04:01:07 am
content: I recently ordered three different ESP8266 12 boards. The first one arrived today. I thought I'd post about it and the other two boards. I'll post more when I have the other two and when I have had time to experiment with all of them. So far, I have only run the Arduino Blink example (the LED version of Hello World).By now, all of you have heard about the ESP8266 that gives you a 32-bit microcontroller and WiFi for very little money. You have probably also heard about the NodeMCU and the WeMos boards.Since the first ESP8266 module became available, several improved versions of the ESP8266 have come out. Also. the Open Source community has done a lot of software development, making it much easier to use the ESP8266 module directly. You see, the module has a 32-bit RISC microcontroller with GPIO, Flash, RAM, etc. The three boards that I ordered let you program the module directly, without any other microcontroller needed. You can still talk to them from a separate microcontroller if you want, but that defeats the purpose.For more information, Wikipedia has the story:https://en.wikipedia.org/wiki/ESP8266Also search Hack-a-Day, Google, YouTube and this forum for quite a lot on the ESP8266 and the boards listed below. In a nuthshell, these boards give you a 32-bit microcontroller and WiFi for just a few dollars. Lots of people are using them for remote sensors and such. The module can be put into a low power sleep mode to save battery power.Important Note: the ESP8266 is 3.3 V only! Use level shifters to interface to 5 V parts, or find a 3.3 V compatible part. This is becoming less of a problem with time. Most chips, displays and sensors can be had that work at 3.3 V.All three boards can be programmed at least three ways: using the old-style AT commands from a separate microcontroller; using a Lua interpreter flashed into the ESP8266; using the Arduino programming software (after additional support files are downloaded). It all depends on which firmware you flash into the ESP8266. Make that four ways. MicroPython is also available, but I don't know much about it. Five ways. I understand there is an API for programming bare metal.All three boards that I ordered use the ESP8266 12F variant(the NodeMCU uses the 12E). This variant has several GPIO's, 4 MB Flash, I2C, SPI, etc. and the module is FCC certified. Unlike the 8-bit AVR chips used on Arduino's, the ESP8266 only has one A/D input (10-bit). If you need more, you could either add an off-board A/D chip, or use a 4051 8-channel multiplexer chip with the single A/D input.The board that I have right now is this ($6.50 from AliExpress):http://www.wemos.cc/Products/d1_r2.htmlAlthough it uses an Arduino Uno form factor, it has no AVR chip on it. With the proper board definition addon, you program the 32-bit microcontroller directly, using the Arduino software. This video explains how to install the board definition addon:I had a problem with this. I kept getting an error when the Board Manager went to download the files. I solved it by both adding an entry in my hosts file and putting the IP address of the server in the Arduino Options. According to comments on the 'net, this is supposed to be due to DNS failures, but I find it hard to believe that they are having intermittant DNS issues for a couple of years. It may be something else, but what I did allowed me to install the package.In the Options:http://104.131.82.128/stable/package_esp8266com_index.jsonIn the hosts file: 104.131.82.128 arduino.esp8266.comNote that practically all Arduino software and libraries need to be modified to work, due to different pin mapping and slightly different capabilities. From the few simple examples I have looked at so far, it doesn't seem too hard. Many Arduino libraries have already been modified and new WiFi/network libraries have been created. Several libraries and examples come with the ESP8266 board addon that you install into the Arduino software.Note: as I said above, 3.3 V only! Don't stick a 5 V Arduino shield on this board, or you may blow it up!This board and the next one uses the CH340 serial-USB chip. Windows 7 automatically downloaded a driver from Microsoft and installed it when I plugged in the USB cable the first time. I hear that Linux has a built-in driver. I don't know the Mac situation.Note: if you order the above board from AliExpress or ebay, make sure you get the "D1 R2" version. The original "D1" version board has been obsoleted.The second board I ordered ($3.50 from AliExpress):http://www.wemos.cc/Products/d1_mini.htmlThis is from the same people as the board above. It has the same capabilities and is programmed the same way. It just is in a smaller form factor.Board number three ($3.50 from AliExpress):http://www.nodemcu.com/index_en.html#fr_54747661d775ef1a3600009eI think this board was one of the first Open Hardware projects to use the ESP 8266 module and make it more programmer friendly. This board uses thesame 12F12E moduleas the other two, but in yet another form factor. By default, this board has the Lua interpreter flashed into it. You can also program it using the Arduino software (which will overwrite the Lua firmware). The support for all three boards is in the boards support package that you install into the Arduino IDE.Be careful when ordering this board. There are three versions. The original v0.9, the v1.0 (also called v2.0) and a v3.0 from certain Chinese sellers (this one is usually marked LoLin). You want the v1.0/v.2.0 board. This is the only one of the three that will fit on a breadboard, leaving you one row of pins on each side. The other two leave you nothing to plug into. You can spot the correct board by the small, sideways lettering beside each pin. The wide board has the lettering readable as you hold the board with the WiFi antenna at the top. See here for further information:http://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/This board uses the Silicon Labs CP2102 serial-USB chip. I don't have the board yet, so can't comment on the driver situation, only to say that you can download drivers from Silicon Labs. UPDATE: The driver was automatically installed on Win7.As I mentioned above, Lua can be flashed to all three boards if you want to program using the Lua interpreter (or MicroPython). It's an either/or: if you flash the Lua firmware, you program in Lua. If you use the Arduino IDE, it will overwrite whatever is in Flash memory when you upload your Arduino program. BTW, if you want to go Old School, a BASIC interpreter is also available. I haven't tried it. FORTRAN anyone?

author: ez24
author_rank: Super Contributor
timestamp: May 09, 2016, 04:12:19 am
content: Thanks for the info, lots to chew over.Why do you say Aliexpress then link another site?

author: mojoe
author_rank: Frequent Contributor
timestamp: May 09, 2016, 06:06:24 am
content: The links are to the original designers of the hardware. I bought mine from AliExpress. Being Open Hardware, the Chinese are as free to make these boards and anyone else. I don't know who WeMos is, but the "buy" links on their page take you to a WeMos store on AliExpress. I didn't know this when I ordered my first samples, or I would have ordered from WeMos themselves.

author: mojoe
author_rank: Frequent Contributor
timestamp: May 13, 2016, 04:13:50 am
content: Today I received the D1 Mini boards. As a quick test, I downloaded the Blink example program, as I did with the D1 R2 board. The program blinked the LED, as expected, but I noticed a difference. When I programmed the D1 R2 board, the WiFi was off and stayed off. Not so with the D1 Mini's.As received, the D1 Mini's had the WiFi off. After programming the Blink example, the WiFi turned on. They showed up with an SSID beginning with "ESP_" and ending with the last half of their MAC address.I'm not sure why the WiFi would turn on with the D1 Mini's. I don't think it should have. The D1 R2 behaved as I would have expected. When I get a chance, I'll turn the WiFi off and see if it stays off. I hope to have more time to fool with these over the weekend.I did a quick test with a D1 Mini laying on my computer table and my phone running the WiFi Analyzer app. When they say 50 ft, they're not kidding. I was at the other end of the house (standard gypsum board constuction) and could have gone further. The module is stamped 25 dBm, which is 316 mW. That is quite a lot of power for such a tiny module. It does get warm, but not hot.

author: mojoe
author_rank: Frequent Contributor
timestamp: May 13, 2016, 07:04:42 pm
content: The NodeMCU boards finally arrived. I'd like to make a few observations about the three different boards. From looking at the schematics and documentation, I note a few differences.The Node MCU uses the ESP-12E. The two WeMos boards use the ESP-12F. Supposedly, the 12F is "new and improved" and has better range. I'll have to test this.Looking at the modules, I don't see any noticeable difference. I'll have to see if there is a way to query the module version via software.In addition to all the GPIO's that the WeMos boards have, the NodeMCU also has GPIO 9 & 10, along with four SDIO signals. These additional signals are on the 12E & 12F modules, but are not connected on the WeMos boards.The NodeMCU uses the AMS1117 voltage regulator, which has an LDO of 1 V and a quiescent current of 5 mA. This is a problem if you want to run the board from batteries. Even in Sleep Mode, you'd be drawing too much current.The WeMos boards use the RT9013 voltage regulator, which has an LDO of 250 mV and a quiescent current of 25 uA. This is much more suited for battery power and Sleep Mode.I understand that you can bypass the voltage regulator entirely if you are using something like 2 AA cells for power. You need to make sure not to exceed the maximum 3.6 V limit, but it seems that the modules will run below the stated 3.0 V minimum.Over the weekend, I'll make some measurements and report back. Depending on what your needs are, I think any of these boards could be suitable. For a small breadboard compatible package with (almost) full functionality, I like the D1 Mini. If you need even smaller, you can always buy the bare ESP-12 modules.

author: mojoe
author_rank: Frequent Contributor
timestamp: May 14, 2016, 04:32:39 am
content: More testing.The NodeMCU boards that I bought came flashed with Lua (which I expected). I was not able to make much progress with it, however. I tried two different serial terminal programs (including TeraTerm) and could not get an interactive session with the Lua interpreter. It seems that the NodeMCU boots up at a high baud rate and then changes to 9600 for the console. The best I was able to get was an "AI Thinker" banner and then whenever I tried to enter anything, I got "ERROR".Doing a web search led me to ESPlorer, which is an IDE of sorts for Lua. I don't want to install Java on my PC, so I couldn't test ESPlorer. I tried getting it to run with a portable Java, but that didn't work. Perhaps I'll fool with Lua another time, but for now, it was a fail for me.Using the Arduino IDE with the Node MCU, like I did with the other two boards produced better results. Programming the Blink example worked just fine. However, the LED that is blinked on the NodeMCU is not the one on the ESP-12E module. The example program uses the constant "LED_BUILTIN" to blink the LED. On the NodeMCU this is mapped to GPIO 16 in the Arduino pin mapping file. This corresponds to a different LED on the main board. On the two D1 boards, "LED_BUILTIN" is mapped to GPIO 2, which is the LED on the ESP-12F module. Why the difference, who knows?The NodeMCU came with the WiFi turned on (channel 1). When I programmed the Blink example, it stayed on. Like the D1 boards, the SSID was "ESP_" and ended with the last half of their MAC address. This naming scheme must come from the ESP8266 Arduino code. With the Lua firmware, the SSID was "AI-THINKER_", followed by the last half of the MAC address.As a test, I turned the WiFi off by including "ESP8266WiFi.h" and using the statement "WiFi.mode(WIFI_OFF);" Once turned off, I flashed the Blink example again and the WiFi stayed off.Using my phone and WiFi Analyzer again, I went around the house and did not notice any appreciable difference in signal strength between the NodeMCU with its ESP-12E module and the D1 Mini with its ESP-12F module. Perhaps at greater distances or with more obstructions, there would be a difference. More testing for another day.Next I want to try measuring the current consumption of the three boards in various modes.An addendum. For more on libraries, see this:http://esp8266.github.io/Arduino/versions/2.0.0/doc/libraries.html

author: mojoe
author_rank: Frequent Contributor
timestamp: May 14, 2016, 05:12:13 am
content: Just a quick note. Looking at the labling on the metal cans of the ESP-12E and ESP-12F, they are marked exactly the same. The only visible difference I see between the two modules is the antenna pattern etched on the board. See below. Unlike the posted picture of the 12E, both of mine have the same "AI" logo in a circle.

author: bitseeker
author_rank: Super Contributor
timestamp: May 14, 2016, 05:34:14 am
content: Hi Joe. Thanks for posting this. I have some 07 and 12 versions, but this was the first I've seen of a 12 on an Uno motherboard. I wondered when someone would do that. Ta da!

author: mojoe
author_rank: Frequent Contributor
timestamp: May 14, 2016, 06:32:31 pm
content: The ESP8266 being a 32-bit chip, I was curious to see if the Arduino ESP8266 addon software implemented floating point numbers to a greater precision than the default Float/Double on the Uno. Thankfully, those developers didn't miss this. A calculation of sqrt(2) gives the following:Uno = 1.414213562ESP-12 = 1.414213562373095I actually printed 20 digits to the serial console in each case, but the remaining digits were nonsense. I used two different calculators to verify the accuracy of the result.

author: Buriedcode
author_rank: Super Contributor
timestamp: May 15, 2016, 11:08:47 am
content: Thanks for the info. I have a 12F module sitting on my bench as a constant reminder that it should be doing something. Whilst I am often impressed by the little MCU, and the ease of which one can connect to a network (AT-commands, NodeMCU, think there's even a Java interpreter floating around based off the Espruino) I am struggling to think of an application! So it seems its a good time to learn node.js and socket.io and web dev.Have you noticed any reliability problems using NodeMCU or any other interpreter? I imagine many applications are remote sensors, and so would require stability as well as low duty between active and deep sleep modes.Whilst it is a very vague question that has been posted a number of times: do you think using NodeMCU or python would be better than say, developing directly in the arduino IDE? For quick testing I can see the appeal, but for actual applications, I would prefer a rather 'clean' dev setup.

author: mojoe
author_rank: Frequent Contributor
timestamp: May 15, 2016, 08:25:10 pm
content: Quote from: Buriedcode on May 15, 2016, 11:08:47 amAs I stated earlier, I couldn't get a working serial terminal connection, so could not test Lua on the NodeMCU. I haven't tried MicroPython. I've only been fooling with these boards for a few days, so I can't comment on reliability.Quote from: Buriedcode on May 15, 2016, 11:08:47 amI think it depends on your preferences. You either use an interactive interpreter or you compile code. I don't know what is not "clean" about the Arduino IDE, but if you want to do things your own way with the least bloat, use the ESP8266 API and program in C. Rather than asking me to make the decision for you, why don't you try them all and decide what you like?

author: mojoe
author_rank: Frequent Contributor
timestamp: May 15, 2016, 08:29:51 pm
content: I was going to do some measurements of current draw with the ESP-12 in different modes. I don't think I could do better than what is covered in these two videos.#47 Power Saving with ESP8266 (Sleep Mode) Tutorial with some Tricks:#58 ESP8266 Sensor runs 17 days on a coin cell:

author: mojoe
author_rank: Frequent Contributor
timestamp: May 15, 2016, 08:39:24 pm
content: Watching the above videos, I was prompted to look for the Holtek HT73xx LDO mentioned. I could not find them from either Digikey or Mouser and did not want to order them from ebay. Doing a parameter search on Mouser found the Microchip MCP1700T series, also in SOT-89 for $0.40 each.I'll be ordering some of the MCP1700T's in 2.8 V, 3.0 V and 3.3 V for later testing.

author: martinayotte
author_rank: Regular Contributor
timestamp: May 17, 2016, 12:41:59 pm
content: HT7xx can be easily found and purchased on eBay.

author: mojoe
author_rank: Frequent Contributor
timestamp: May 17, 2016, 04:28:27 pm
content: To quote my own post, "and did not want to order them from ebay".For many things, I will get the inexpensive Chinese version from ebay, AliExpress, etc. Some items I would rather get from a reputable supplier, where I know that I will be getting factory fresh parts and not salvaged or fake parts.The Microchip part that I found on Mouser has slightly better specs than the Holtek part, anyway.

author: martinayotte
author_rank: Regular Contributor
timestamp: May 18, 2016, 04:43:38 pm
content: Sorry about eBay !You can also look at the XC6203.