ESP Wireless Modules

Introduction

There are many ESP wireless modules and development boards that feature them, such as those based on the ESP8266 and ESP32 microcontrollers from Espressif Systems, which give the hobbyist a cheap way to build wireless projects involving Wi-Fi or Bluetooth. The ESP8266 modules first came on to the scene, or at least in the Western world, around 2014, and since had proved popular thanks to the lost cost and powerful features. The dual core ESP32 superseded the ESP8266 in 2016 but as of 2023 there hasn't been a successor as such to the ESP32, which is not without competition, such as from the Raspberry Pi Pico W, as a recent example.

On this page you can learn about the various ESP wireless modules as you begin your journey into wireless projects.

Images can be downloaded from the bottom of this page if you wish to view them in better detail.

ESP32

Introduction

There are a variety of ESP32 based boards, some of which will be dealt with in this section, but first you may like to watch this video as an introduction to the ESP32:

ESP32-DevKitC V4

My first encounter with ESP32 was a ESP32-DevKitC V4 development board which I got as part of an eBay job lot, the board uses an Espressif ESP32-WROOM-32U module. A getting started guide can be found at:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html

The bottom of the page includes links for the ESP32 datasheet, board schematics, and so on.

My board doesn't have the antenna shown sticking out one end of the board as in the featured photo. This is called the 'keepout zone', which can be seen on page 8 of the datasheet:

https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32d_esp32-wroom-32u_datasheet_en.pdf

The page mentions that the ESP32-WROOM-32U doesn't have the keepout zone. It seems the keepout zone is so called because when designing boards featuring the module you shouldn't have anything in that area but the antenna otherwise wireless performance may be bad.

To summarise some of the board features:

32-bit Xtensa dual-core 240MHz

WiFi 2.4GHz 802.11 b/g/n 150Mbps

Bluetooth 4.2 classic and BLE, client/server

520KB SRAM

448KB ROM

34 GPIO broken out on x2 19-way male headers either side of the board. Some of the GPIO can be configured as digital input or output (some input only), and the following are also available:

x4 SPI

x3 UARTs

x2 i2C

x2 i2S

The board has an on-board micro USB port for powering, programming, and serial connection. On the underside of the board it has written: 'ESP32_DevKitC_V4'.

In order to test the board I followed the instructions to set up the Arduino IDE, from 10:24 in the video linked in the Introduction section; please note: I used Arduino V2.1.1. After installing ESP32 support in the Arduino IDE I couldn't find my board (ESP32-DevKitC V4) listed so I selected 'ESP32 Dev Module', as recommended by a YouTuber. I opened up the Blink example (File->Examples->01.Basics->Blink) and plugged the ESP32 module to the USB of my PC. The on-board red LED illuminated and Windows detected the board as 'CP2102 USB to UART Bridge Controller' but despite claiming to install the driver, Device manager said there were no compatible drivers. This is a downside of boards using some particular USB to serial chips. I found this page with help:

https://techexplorations.com/guides/esp32/begin/cp21xxx/

On the linked Silicon Labs page I downloaded this driver:

CP210x Windows Drivers

After extracting the downloaded file and then installing by running the CP210xVCPInstaller_x64.exe file and then the board showed up in Device manager as 'Silicon Labs CP210x USB to UART Bridge'. In the Arduino IDE I could then set the port (Tools->Port) but the sketch wouldn't compile, I got 'LED_BUILTIN' was not declared in this scope error since LED_BUILTIN isn't defined for the ESP32 Dev Module and looking at the schematic I could see there was no on-board LED. This means we have to connect an external LED and resistor to the board and swap LED_BUILTIN with the GPIO pin that we've connected the LED to. So I connected an LED and resistor to pin 0 (note: not the same as D0) and GND and in the sketch changed LED_BUILTIN to 0. I then clicked upload and it went though the motions (no need to press any buttons on the board), listing some useful information. Of particular note we can see that the chip is an ESP32-D0WDQ6, which is the chip used in the ESP32-WROOM-32U module.

However, at the end it appears to get stuck on:

Leaving...

Hard resetting via RTS pin...

But it's not actually stuck, as the attached LED was flashing and I could upload other sketches.

Blinking an LED is one thing but of course it's the wireless capabilities that we're really interested in, so I tried out the WiFi Scanner example (File->Examples->WiFi->WiFiScan), covered at 21:05 in the introduction video. After uploading the sketch I opened the serial monitor, changed the baud setting to 115200 and then a few WiFi networks appeared in the serial monitor. Perhaps because the board doesn't have an external antenna it only detected 3 networks whereas my desktop, which was very closely located to the ESP32, picked up 8 networks.

Following on I next tried the WiFi Access Point example (File->Examples->WiFi->WiFiAccessPoint), 24:23 in the video. I kept the LED_BUILTIN definition as 2, and set the SSID and password. Remember that these are your chosen SSID and password for the ESP32 acting as a WiFi access point. After uploading the sketch you can then connect to the ESP32 with the SSID and password you set in the sketch and then go to 192.168.4.1 and click the buttons to turn the LED attached to pin 2 on and off.

Since the ESP32 supports Bluetooth as well as WiFi, I continued with the introduction video and tried the SerialToSerialBT example in the video from 31:20 (File->Examples->BluetoothSerial->SerialToSerialBT). Whereas in the video a Bluetooth serial app on Android was used, on Windows 10 we can add a Bluetooth serial COM port, just follow these instructions:

https://community.element14.com/technologies/internet-of-things/b/blog/posts/standard-serial-over-bluetooth-on-windows-10

We can then add the ESP32 to Windows as a Bluetooth device: on Windows open Bluetooth settings, click 'Add Bluetooth or other device', click 'Bluetooth' and select 'ESP32-BT-Slave' or whatever 'device_name' has been set to in the sketch. Open the serial monitor in the Arduino IDE, make sure the baud is set to 115200, and press the En button on the ESP32 to reset it and then you will see the boot output text in the serial monitor.

Next, I opened PuTTY and started a serial connection with the Bluetooth COM port - I found in Device manual three 'Standard Serial over Bluetooth link' devices had appeared so I selected each one until it worked, which you will only know when you try to type. I didn't change the baud setting in PuTTY and left it at 9600.

When I entered text into the Arduino serial monitor the text appeared into PuTTY although oddly the cursor then moves to the next line but several characters to the right. I noticed a slight delay from entering text into the serial monitor and receiving in PuTTY, but that's to be expected. Typing into PuTTY causes the characters to appear almost immediately in the Arduino serial monitor but pressing return doesn't cause a newline. There are perhaps settings in PuTTY to fix these issues.

Next I tried the Hall Sensor example at 39:17 in the introduction video and accessible from File->Examples->ESP32->HallSensor in the Arduino IDE. This worked fine for me, when I brought the magnet close to the wireless modules the values in the serial monitor become negative, as expected. I found that the magnet only needed to be close to the module for the values to change and it's important which way the magnet is positioned compared to the module for it to have an affect.

A neat thing about the ESP32 board is that it has 10 touch switch inputs on various GPIO and we can see an example in the introduction video at 43:40. In the Arduino IDE it's accessed from File->Examples->ESP32->Touch->TouchRead. Strangely, the comments in the sketch mention T0 but in the loop() T1 is read but of course that can be changed. This example worked flawlessly for me, using just a piece of wire connected to the GPIO pin to act as the touch point.

I hope this has been a good introduction to using the ESP32-DevKitC V4 and ESP32 modules in general, be sure to try out the other examples available in the Arduino IDE to get more familiar with your board.

ESP32-C3-DevKitC-02

The ESP32-C3-DevKitC-02 was my second ESP32 development board (ESP32-DevKitC V4 being my first, covered in its own section on this page) and I was especially attracted to it because of it featuring a RISC-V processor and appears to be a fairly recently released device (the GitHub entry was added in 2021). I bought the board from Mouser, since it was the cheapest option at the time, costing me just under £8 but I didn't get it quite as quick as I had hoped due to export restrictions requiring me to fill in a form and inform Mouser exactly was I planned to do with the board. The board came in a small box with the QR code printed on it to quickly access the user guide. The top side of the board features the ESP32-C3-WROOM-02 module with rectangular antenna sticking out one end of the PCB, along with an on-board RGB LED, micro USB port, and boot and reset switches. Along the two long edges are 15-way male headers for GPIO and power, the pinout for the pins are labelled on both sides of the board. On the underside of the board it has written 'esp32-c3-devkitc-02 v1.1'.

I plugged the board into the USB of my PC and the red power LED came on as well as the RGB LED (which is very bright) which lit up blue, I didn't have the need to install any drivers, probably because I had already installed them for the ESP32-DevKitC V4, which uses the same CP210X USB to UART bridge. So I could easily test out the board I opened up the Arduino IDE (I was using V2.1.1) and since I already had the ESP32 boards installed it was just a matter of choosing 'ESP32C3 Dev Module' as the board. I started with the classic Blink example and that worked, it flashed the on-board RGB LED white. Note that, unlike the ESP32-DevKitC V4, LED_BUILTIN has been defined so there were no changes I had to make to the Blink sketch.

As the sketch is being uploaded we get some useful text in the Arduino output window, including identifying that the board's chip is 'ESP32-C3 (revision v0.3)'. As with other ESP32 boards, after uploading (which took about 7 seconds) we get this message:

Leaving...

Hard resetting via RTS pin...

Which shows all is good, the program is running on the board.

Another example sketch I tried was the BlinkRGB sketch (File->Examples->ESP32->GPIO->BlinkRGB), which was especially designed for the on-board RGB LED, so no surprises it worked with no problems. The sketch lights the RGB led white, red, green, and, blue. As mentioned in the sketch, using digitalWrite(RGB_BUILTIN, HIGH); turns the LED on white, in fact, we can use LED_BUILTIN instead of RGB_BUILTIN, as seen in the blink sketch.

Next I tried SimpleTime (File->Examples->ESP32->Time->SimpleTime), which uses a WiFi internet connection to get the current date and time, outputting it to the serial port. You need to change ssid and password in the sketch to that of your WiFi network. When you open  the Arduino serial monitor (make sure baud is set to 115200) it will (hopefully) say that it's connected to the Internet (provided you supplied the correct info) and then it will print the date and time every 5 seconds. As pointed out in sketch's comments, it doesn't handle daylight savings, so it was an hour ahead for me. Fortunately, we can set the time_zone variable, which is normally set for Rome (CET-1CEST,M3.5.0,M10.5.0/3). So I looked online and found this page listing time zones:

https://sites.google.com/a/usapiens.com/opnode/time-zones

Then I set time_zone to:

GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00

Which is for London, Great Britain.

Then I commented out configTime() on line 54 of the sketch and uncommented configTzTime() on line 61. After uploading to the board and opening the serial monitor again I now had the right time.

Because the ESP32-C3-DevKitC-02 only has Bluetooth LE support we cannot run sketches that use Bluetooth classic. For an introduction to Bluetooth LE and associated examples have a look at:

https://randomnerdtutorials.com/esp32-bluetooth-low-energy-ble-arduino-ide/

I tried (File->Examples->ESP32 BLE Arduino->BLE_scan) and when uploaded I opened the serial monitor and it printed out information about the devices it's found though all of them had the name part blank so it wasn't clear what devices it actually found.

Since the board has an on-board RGB LED I wanted to make a more advanced version of the WiFIAccessPoint example (File->Examples->WiFi->WiFiAccessPoint), which turns an LED on/off using a webpage hosted by the ESP32, and having not found online a ready to use example I loaded up the example sketch (WiFiAccessPoint) to modify. The resulting sketch is called WiFiAccessPointRGB.ino and can be downloaded from the bottom of this page, don't forget to set ssid and password in the script to something more appropriate as that is what you will use to connect to the ESP32. After uploading the sketch to the ESP32, connect your computer's WiFi to the ESP32 using the SSID and password you set in the sketch and then open the Arduino IDE serial monitor and copy the stated IP address into your browser. You should see the various prompts to change the colour of the RGB LED and clicking on any of the links should change the LED colour immediately.

Going over how I modified the WiFIAccessPoint sketch: I had commented out the LED_BUILTIN define on line 18 but that wasn't necessary as neopixelWrite() is used to operate the on-board RGB LED, which uses RGB_BUILTIN macro. I also commented out using pinMode() to set LED_BUILTIN to output on line 28 as it's not needed when using neopixelWrite(). In loop() I used x4 client.print() to provide links for changing the RGB LED to red, green, blue, or off, represented by 'R', 'G', 'B', and 'O', respectively. Later in the function where we respond to the links it's just a matter of checking each request (R/G/B/O) and changing the RGB LED colour using neopixelWrite(), passing the appropriate colour values. Note that RGB_BRIGHTNESS is defined as 64, providing a convenient constant for LED brightness.

This has been just a brief look at the ESP32-C3-DevKitC-02 and while it lacks some features compared to older ESP32 development boards it remains very good value for money and I'm already thinking of what project to incorporate it into.

ESP8266

Introduction

Please see the following video to get an overview of the ESP8266 and the various boards based around the chip:

ESP-01/S

The original ESP-01 Wi-Fi module was made by Ai-Thinker, available August 2014, but was surpassed by the upgraded version, the ESP-01S.

You can find a wealth of information about the ESP-01 at:

https://www.microchip.ua/wireless/esp01.pdf

The schematic can be found toward the end of the PDF, although it seems somewhat incomplete compared to typical ESP-01 modules.

Both the ESP-01 and ESP-01S have on-board flash memory to store user programs, but while the ESP-01 features 0.5MB or 1MB flash memory, the ESP-01S has 1MB or 4MB flash. Another difference between the two boards is that the ESP-01 has two on board user LEDs - power LED and an LED connected to TX, but the ESP-01S has a single on board LED connected to GPIO2, and three 12K resistor pull-ups on RST, GPIO0, and EN (a.k.a. CH_PD).

For a more detailed breakdown see:

https://www.best-microcontroller-projects.com/esp-01-vs-esp-01s.html

This section will focus on the ESP-01S but some of it will still be applicable to the ESP-01.

The tiny PCB, measuring just 14.3 × 24.8mm, is home to an ESP8266EX 32-bit Wi-Fi SoC, on board antenna, one or more LEDs, 26 MHz crystal, and 4x2 male header for interfacing, typically with a programmer at least initially. On my particular ESP-01S there is no Ai-Thinker marking on it (thus possibly a clone), has a P25Q80H 8Mb SPI flash chip, pin 1 of the header is signified with a square outline, and the pinout is written on the PCB underside. Always check your particular ESP-01/S in case of any differences to the norm.

For testing the ESP-01S I found a getting started guide at:

https://www.instructables.com/Getting-Started-With-the-ESP8266-ESP-01/

As can be seen from the site linked above, the ESP-01/S is supposed to come with AT firmware, which accepts a range of commands sent to the module serially, which should makes it easier to test the board.

Note that on the site linked above no level converter has been used despite ESP modules limited to, at least according to the ESP8266EX datasheet, no more than 3.6V on it's I/O; while some people claim the ESP modules are 5V compliant I would advise to limit to 3.3V. Since I didn't have an ESP-01 programmer I thought about using a D1 Mini V4, which funny enough has the same chip as the ESP-01, but seemed suitable due to using 3.3V logic as I wanted to avoid using voltage level converters, and I could program it with the Arduino IDE, for convenience.

You are supposed to load the bare minimum sketch (which is an empty program) on to (in my case) the D1 Mini, which is effectively behaving like a USB to serial converter. Note that when uploading sketches to the D1 Mini, or any board connected to the ESP-01/S, you must disconnect the ESP-01/S's TX and RX pins from the other board otherwise the upload will fail.

I had the D1 Mini power the ESP-01S and when I plugged it into my PC, the ESP-01s' LED lit a few times. I opened the Serial monitor in the Arduino IDE (it's advised to set to 115200 baud) and sent the AT command but there was no response. I tried setting the Serial monitor to 'Both NL & CR' as advised by online posts, and I also tied RST to 3.3V but neither resulted in a response. Since I got my ESP-01S second hand it may not even have had the AT firmware, however, using my oscilloscope I could see that upon power on the ESP-01S was transmitting data on its TX pin so the board at least wasn't dead.

I did also write a simple sketch just the following in setup to simulate sending an AT command:

Serial.begin(115200);

Serial.print("AT\r\n");

Although I could see activity on the D1 Mini's TX pin there was no response from the ESP-01S but oddly pressing reset on the D1 Mini caused garbage to appear in the Serial monitor. I found reports online that 115200 can be unstable for the Arduino serial, so that.

So the next step was to try to put the AT firmware back on to the ESP-01S, I used a Waveshare USB to UART adapter that has shunt to put it into 3.3V mode. I followed a tutorial at:

https://www.allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/

Since the ESP-01S has on board pull-ups there is no need to connect anything to the EN pinout, however, I connected a 220R resistor between GPIO0 and GND to enable programming mode rather than a straight connection in case something was setting it as an output. With GPIO0 floating I opened a PuTTY serial connection and when I resetted the ESP-01S by taking RST low, the LED flashed and some corrupted text followed by 'ready' appeared, although issuing an AT command got no response. Just to see what would happen, I tried enabling 'Implicit LF in every CR' in PuTTY but that didn't help, another recommendation was to use CTRL+J instead of enter to ensure the correct line feed characters are given, that responded with ERROR, same with using CTRL+M followed by CTRL+J.

I downloaded the Flash Download Tool v3.4.4 and ESP_SDK_v2.0.0 as instructed in the tutorial. When you run the Flash Download Tool it is very basic:

There is also a 'terminal' window (not shown) that gives useful information and should be consulted if there are any errors.

After clicking the 'ESP8266 Download Tool' button another window will appear:

Oddly, various fields were already filled with paths that didn't exist on my PC but the tutorial says to uncheck them anyway. Here is a screenshot after clicking the Start button to read ESP-01S information:

When selecting the files and typing in the addresses be careful as the addresses listed in the tutorial previously linked to are cut off at the end by one character (or at least they were for me), and if you enter them wrong the boxes will be red and you won't be able to proceed. Best to copy and paste the text from the site into notepad to see the full addresses. After clicking the START button a progress bar will show:

The downloading took about 40 seconds. If you have any problems it's recommended to uncheck SpiAutoSet but for me it worked having it checked.

As mentioned in the tutorial you can confirm succesful flash using Termite but I used Putty. Resetting the ESP-01S caused the same message as before but this time when I typed AT followed by CTRL+M CTRL+J I got an OK response (just using CTRL+J resulted in ERROR). Issuing AT+GMR gave AT and SDK versions. Below you can see the Putty output:

I then continued testing by following from step 4 in the following guide:

https://www.instructables.com/Getting-Started-With-the-ESP8266-ESP-01/

It instructs that we can install alternate firmware, such as NodeMCU, but I didn't get round to trying that - I had at least confirmed the ESP-01S was working and had a try out of the AT firmware. The tutorial links to the full list of AT commands, here is the link:

https://www.pridopia.co.uk/pi-doc/ESP8266ATCommandsSet.pdf

Don't forget the module can only connect to 2.4G Wi-Fi APs.

Interestingly, when I issued AT+RST, which restarts the module, it displayed the same boot message before but in addition it also reported:

WIFI CONNECTED

WIFI GOT IP

Oddly when I tried AT+CIOBAUD? to get the current baud rate as a matter of curiosity I was met with an ERROR response. Looking online it seems we can use AT+IPR=115200 to temporary change baud rate but AT+IPR? doesn't return the current baud rate. Even though I used 115200, that is, the current baud rate so I didn't mess things up, somehow after using AT+IPR=115200 the ESP-01S wouldn't boot completely after reset, I had to reflash the board to get it responsive again. Looking online it appears others have had the same issue:

https://www.esp8266.com/viewtopic.php?t=1997

It seems you can use AT+UART_DEF and AT+UART instead, with the examples given:

AT+UART_DEF=9600,8,1,0,0

AT+UART=9600,8,1,0,0

Installing a different version of the AT firmware may also be a solution.

Tips

When an ESP-01/ESP-01S powers up it sends a boot message over serial (uart0), this feature is built into the ESP8266EX's internal firmware.

WeMos D1 Mini V4.0

The D1 Mini V4 is the latest (as of 2024) in the D1 Mini ESP8266 powered Wi-Fi small form factor development boards series, featuring an ESP-8266EX microcontroller, 4MB flash memory, and USB-C (USB 2 speed) connectivity (previous versions used micro USB), and can be picked up for as little as £5 ($6). The board measures 34.2 x 25.6mm, weighs 3g, and features 11 digital I/O pins (3.3V maximum) with various hardware interfaces (I2C, SPI, etc.), and one analog input (3.2V maximum).

The particular version I have is made by Lolin, WeMos is the original manufacturer from what I can tell. Usually the board is sold with two short male headers, two short female headers, and two long female headers, giving you plenty of choice how you want to make connections to it.

The product page for the D1 mini can be found at:

https://www.wemos.cc/en/latest/d1/d1_mini.html

The page has a link to the schematic for V4 and tutorials for using the board with MicroPython and Arduino although they are very brief. The Nodemcu firmware is also supported by the board.

For a summary of changes that V4 brings please see:

https://www.reddit.com/r/esp8266/comments/yxsmk1/wemos_d1_mini_v4_first_look_differences/

Like the Arduino, many add-on boards called Shields are available for the D1 Mini with the ability for them to be stacked. Please see this site to get an idea of some of the Shields that can be bought:

https://www.wemos.cc/en/latest/d1_mini_shield/index.html

Don't forget you can also make your own Shields.

Please note that all of the D1 Mini's I/O pins run at 3.3V, do not expose them to higher voltages.

The D1 Mini can be programmed through the Arduino IDE, please see this guide:

https://www.instructables.com/Wemos-ESP8266-Getting-Started-Guide-Wemos-101/

When I tried it myself I already had the CH340G drivers installed, as well as support for the ESP8266 in the Arduino IDE since I had previously used the IDE to program similar boards. I used Arduino IDE V2.1.1 and for the board selection I used ESP8266->LOLIN(WEMOS) D1 ESP-WROOM-02, although that worked for me I later found someone using LOLIN(WEMOS) D1 R2 & mini, which makes sense as the Flash size (Tools->) is 4MB, whereas LOLIN(WEMOS) D1 ESP-WROOM-02 is limited to 2MB. As for installing libraries I didn't need to, the only other thing to do was select the port (Tools->Port->). Under Tools in the Arduino IDE there are a lot of board specific options for the D1 Mini, such as for debugging, flash, and CPU frequency.

As a first test I opened the Blink example (File->Examples->ESP8266->Blink), while programming the board's LED flashed a few times before it blinks continually as expected. The sketch says that the on board LED is connected to GPIO1 yet the schematic says GPIO2, but LED_BUILTIN worked either way. If it doesn't for you try a different GPIO number but keep in mind when using with Arduino IDE the GPIO numbering is different for the D1 Mini, see this site which is for a different but similar board:

https://cyaninfinite.com/getting-started-with-the-wemos-d1-esp8266-wifi-board/

In the Pinouts section you can see the Pin names that can be used in an Arduino sketch and how they relate to the pinout on the ESP board. For example, if you wanted to use GPIO13, you would use D7 in your sketch.

The next example I tried was WiFiScan (File->Examples->ESP8266WiFi), after uploading, you open the serial monitor (set to 115200 baud), and a list of Wi-Fi networks will be regularly listed. Note that only 2.4G networks will show.

I also tried the HelloServer (File->Examples->ESP8266WebServer) example. Toward the start of the sketch you will need to replace your-ssid and your-password with your Wi-Fi's SSID and password respectively. After uploading, open the Serial monitor (set to 115200 baud) and it should report that it's connected to the specified Wi-Fi access point, and the IP address. Put the IP address into your browser and you should see the following displayed:

hello from esp8266!

WeMos D1 R2

The WeMos D1 R2 development board is a so-called Arduino Uno compatible board with the same form factor (68.6mm x 53.4mm, 25g) and headers but powered by an ESP-8266 Wi-Fi module with 4MB flash rather than an ATmega328P microcontroller with 32KB flash that is the heart of an Uno, giving the D1 a big advantage in processing power, memory, and connectivity. I picked up a D1 from eBay for just £3.49, V2.1.0, which seems to be the common revision.

The board features a reset button, micro USB port for programming/serial access and powering the board, DC jack (9-24V) for alternative power input, and four female headers arranged in the same way as an Arduino Uno, carrying GPIO and power. The headers are labelled and to the side of each header are holes, which you could solder wires to, or male headers (although you might have difficulty plugging in wires), a feature not present on an Uno. There is also an arrangement of 4x2 holes which carry 3.3V, GND, serial and I2C, which you can solder header/wires to.

There are ON and SCK LEDs, both blue, and the ESP-8266 module has its own blue LED.

Some of the notable chips on the board are:

16 pin chip with no part number visible (don't know why it's rubbed off on mine), likely a USB to serial chip, possibly CH340.
MCP60021 1MHz low-power op amp.
ESP-8266 Wi-Fi module supporting 2.4GHz 802.11b/g/n.

Whereas the D1 has 11 digital input/output pins (supporting interrupt/PWM/I2C/one-wire except for D0), an Arduino Uno has 14 (with only a few supporting PWM, etc.). Another overall advantage of an Uno is that it has six analog pins that can safely take 0-5V but the D1 has just one analog input which is limited to 0-3.2V. Also be aware that Uno I/O operates on 5V as mentioned but D1 digital pins are supposedly not 5V tolerant (the ESP datasheet claims they are not) so it would be best to not expose the pins to more than 3.3V.

A wiki for the D1 can be found at:

https://wiki.geekworm.com/WEMOS_ESP8266_D1_R2_V2.1

The site has a link to the user manual but the link is dead, there is also a link to the schematic. Note that on the schematic the ESP module  isn't labelled (it's the large rectangle) and the unknown 16 pin chip isn't labelled either. On the schematic for a slightly different version of the board we can see the ESP module and a CH340G chip that likely is the mystery chip on my board:

https://www.elkim.no/wp-content/uploads/2021/06/Schematic0G-00005444WIFI-D1R2-ESP8266.pdf

There is discussion online whether the D1's DC input can tolerate as much as 24V or anything near that, although the regulator connected to the DC input isn't marked on the original schematic I found that my board has a 2359, likely an MP2359, which has an absolute VIN of 26V and considering there is a series SS24 diode on the board, the claimed 9 to 24V seems correct. However, it's always best to keep to the lower end if possible to keep the regulator cool and minimize risk of damage and be sure to check your particular board as there appears to be different manufacturers.

When I plugged the board into my Surface Pro using a micro USB cable the ON and SCK LEDs came on and in Device manager the board showed up as USB-SERIAL CH340, confirming the mystery chip is indeed a CH340. I already had ESP set up in the Arduino IDE so I just had to select the board: Tools->Board->esp8266->LOLIN(WEMOS) D1 R2 & mini. However, although the board's COM port showed up in Device manager it wasn't selectable in the Arduino IDE.

I tested the COM Port by opening a serial connection in PuTTY, set to 115200, and I could see the board was scanning for and listing Wi-Fi networks, so perhaps the previous owner had loaded the WiFiScan example sketch or something similar. Returning to the Arduino IDE, I closed all instances and opened the IDE again, now I could select the COM port.

I tried out a number of examples but before doing so I set the upload speed to 115200 (Tools->Upload Speed), as recommended to do so online. I then upload the classic Blink example, which took about 17 seconds to upload after compiling, the ESP module LED blinked while this happened. After upload, the LED on the ESP module steadily flashed, showing that we can use LED_BUILTIN to control it. LED_BUILTIN for this board is 2, that is, the ESP module LED is connected to GPIO2. Note that HIGH turns the led off, LOW on. However, to use the SCK LED, which is connected to GPIO14, replace LED_BUILTIN with 14. The SCK LED is equivalent to the 'L' LED on Arduino Uno, although on that board the LED's connected to IO pin 13.

I also tried out the WiFiClient example sketch (File->Examples->ESP8266WiFi->WiFiClient); had to set STASSID and STAPSK in the sketch to my Wi-Fi's SSID and password respectively. After uploading, I open the serial monitor set to 115200 baud and saw a connecting message and various information was displayed including IP address, and a quote of the day, which is fetched from the djxmmx.net host, every 5 mins.

Witty cloud

The Witty cloud is a small (32x32x17mm) Wi-Fi board containing an ESP8266MOD by AI-THINKER, supporting IEEE 802.11 b/g/n Wi-Fi, on the board is also an LDR light sensor, RGB LED, blue LED, a push button, micro-B USB, and an 8-way male header on both sides for interfacing and power. Although with the headers fitted the board is breadboard friendly you will need to utilize wide breadboard. On the PCB underside is home to a single AMS1117 LDO voltage regulator chip.

Along with the main processor, the board has 4MB flash memory for user programs, 11 digital I/O with PWM and interrupt support, 1 analog in (connected to the LDR), and there is support for serial, SPI, I2C, and 1-Wire protocols. Although the ESP8266MOD runs on 3.3V it has been claimed the I/O is 5V tolerant but the analog input is reportedly limited to 3.2V.

A rundown of how the on board devices are connected is as follows:

Blue LED is connected to pin 2 (GPIO2).
The RGB LED is common cathode and so lights when driven HIGH.
Pin 15 (GPIO15) = RGB Red LED
Pin 12 (GPIO12) = RGB Green LED
Pin 13 (GPIO13) = RGB Blue LED
Push button attached to pin 4 (GPIO4).

You can view much more information at:

https://protosupplies.com/product/esp8266-witty-cloud-esp-12f-wifi-module/

It should be made clear that I will be dealing with the main board (a.k.a. top board), an adapter board (bottom board) is used to program it; the micro USB on the main board is only for powering it, although alternatively you can supply 5V via the VCC and GND pins to power the board. It isn't absolutely necessary, however, to use a dedicated adapter board for programming the main board, as we shall see later on.

Supposedly the main Witty board comes preloaded with the NodeMCU software that accepts the standard AT command set but since I got my board second hand I would have to test it to see what it does. I powered the board with a micro USB cable and connected a USB to UART converter with common ground to the Witty, and TX of Witty connected to RX of UART board, and Witty RX to TX UART. I powered the Witty first and saw the RGB LED and blue LED come on, regularly the RGB LED blinked red as the blue LED came on, perhaps running the program the previous user had put on. I then plugged the UART board into my Surface Pro and opened a PuTTY serial session set to 115200 baud, I now saw that in time with the LEDs blinking it was outputting information to the serial port, showing that the board was continually performing a soft reset, while trying to run ESP RFID, trying to set up the RFID hardware (likely an add-on board). So indeed, that is what the previous owner had set it up for and it at least showed the board wasn't dead.

I looked into using the Witty with the Arduino IDE but using the previously mentioned UART adapter to program it. I found a guide at:

https://www.faranux.com/product/witty-cloud-board/

When it came to installing the board in the Arduino IDE I already had it installed from other ESP boards I've used so I only needed to select NodeMCU v1.0 as the board type. I downloaded the provided WittyBlink sketch from the site, making sure in the Arduino IDE to set the upload speed to 115200 and the port to the UART adapter COM port. I later found a page showing how to program a Witty with a USB adapter so I continued with that as it was more appropriate for what I wanted to do:

https://circuitjournal.com/esp8266-with-arduino-ide

Because my UART adapter doesn't have the additional pins I went with the manual approach as detailed on the site.

I connected the Witty's RESET, GPIO0, and GPIO15 to VCC via 10K resistors.

What I found out through testing is that GPIO15 can actually be left floating (which is just as well as the red LED is connected to that pin). This is what I did:

To put in programming mode I took GPIO0 to GND and briefly connected RESET to GND, the board's blue LED briefly lit.

I uploaded the WittyBlink sketch previously mentioned by clicking the Upload button in the Arduino IDE, after compiling it uploaded (taking about 20 seconds).

To get the program to run:

Remove GPIO0 from GND, briefly take RESET to GND.

In the serial monitor I could see various information:

The state of the button (=1 button not pressed, =0 button pressed).

LDR light level (1024 when illuminated with bright light, toward 0 when covered up).

Additionally, the RGB LED lit random colours. The RGB LED isn't very good in that you can see the individual colours rather than them being mixed (perhaps better to view from a distance) and green is much brighter than red and blue which are about the same intensity, which I confirmed by writing a sketch which turns each primary colour on and off in turn at maximum intensity. Although keep in mind our eyes are most responsive to green so perhaps that makes green appear somewhat brighter.

Troubleshooting

If you see in the Arduino Serial monitor (or any of software showing the serial output) 'Soft WDT Reset' and possibly garbage characters too then possibly the board is resetting due to its watchdog timer triggering:

https://forum.arduino.cc/t/soft-wdt-reset-nodemcu/425567

Rather than have blocking code (waiting for an event to happen and not running any other code until) or a long blocking delay, rewrite your code to avoid such situations, which will stop the constant resets.

All content of this and related pages is copyright (c) James S. 2023-2024