A brief look at the ESP-03 Module and more

ESP-03ESP-03 ModuleToday I put together a short video about my initial work with the ESP-03 module.  The small module brings out more pins than the ESP-01 but realistically instead of 2 I/O pins (one with limits) you get 5 I/O pins (1 with limits). Is it worth it? Of should we be concentration on developing libraries to use the modules as slave boards to, say, an Arduino?  At this point my money is still on the little ESP-01 – it’s cheap and there’s a good argument for using these instead of internal radio boards in a network (I’ve previously used the NRF24L01 boards which come in at only just over £1 but their limited range and abilities are a constant headache).

In the photo top left you see the ESP-03 module mounted on a prototyping board to give me LED outputs for testing (LEDS I might add which don’t look that clever at 3v3), a 3v3 supply and level conversion. Why oh WHY didn’t they make these boards work at 5v…

esp03The ceramic aerial works I would say ALMOST as well as the PCB aerials on the ESP-01 (I pick up more access points on the latter) and the pin spacing is a pain – maybe they had something against simple 0.1” spacing! There’s an additional surprise for those of you used to the ESP-01 board, one of the potential I/O pins has to be tied to ground – I found that out the hard way. So I have no idea what GPIO18 is about but the LUA interpreter does not support it so that one ended up unused. I have an Android APP happily polling this board at high speed when needed to monitor they states of the pins and I’m sure with just a little effort I could have done much more. Will I rush out and buy more?

ESP-01 baseboardRight now I’m having good vibes about the ESPRESSIF AT software which now seems to work well on the simple ESP-01 boards and with the addition of control over the reset on those boards I reckon it’s possible to make a pretty reliable set of kit though I’ve yet to start considering what happens if the router dies temporarily. I would like to see some decent webserver software for the AT control set, written perhaps for Arduino so that for those installations where a WIFI access point is not practical, the board can act as a relay for several others in some kind of piconet. No doubt that will come (Update Dec 29, it looks like MQTT might do the network function – see later blog).

The pins available on the ESP-03 include VCC and ground, Antenna output, CH_PD, RX and TX  and the following GPIO pins – 00,02,12,13,14,15 and 16 but see the image above right concerning GPIO0, GPIO15. GPIO16 is used for deep sleep/wakeup,  If anyone has a more definitive list of what these pins are for – please do write in as there is a lot of confusing info on the web.

Update 20/12/2014: As you can see on the left I’ve also made a little baseboard for the (several) ESP-01 boards that have now arrived from China. PCB still on the way from the manufacturer  – so many things to test: latest Lua, the Frankenstein code  (which at the time of this update seems to have stalled a little), the Espressif AT code (new SDK as of yesterday) and this weekend I’ll be having a play with these as well as considering the options for tying this into my home controller.  I’ve followed a few blind alleys here but I think I’ve some ideas as to how best to make use of these boards which with luck might event soon have handshaking (unfeasible on the ESP-01s due to lack of pins). This and the ESP-12 offer great possibilities.

Thanks to JOHN and others for the reminder about GPIO16 which I originally had marked down incorrectly as GPIO18)


34 thoughts on “A brief look at the ESP-03 Module and more

  1. Hi Pete,

    a note on GPIO2 on that board. It cannot be low at power up. If it is, the board goes into a different kind of mode (I haven’t explored what, but it doesn’t seem to be the same as GPIO0 reflash mode).

    I found out the hard way, after soldering the board into my raingauge project. The configuration was such that the input was held low most of the time. Moved the input to GPIO13 and everything was fine.

    My experience is that the PCB aerial was much better, but that is one of each comparison and who knows. I suspect the ceramic will be better with a lot of nearby stuff that would detune the PCB antenna, but may be wrong if the RF engineering in the chip adapts the antenna matching (and the specs seem to indicate it might).


  2. Thank you and yes I’m aware of that.. so the solution (though I did not use it on this board as I had that pretty little multi-led display) is to +base the LEDS.. ie resistor from + to the led, from the led to the ESP-03 – that way if anything at powerup the tendency is for the pin to be + rather than ground – if that makes sense. I think the PCB aerial is better – yes. Thanks for the reply.

    • Ah yes, I remember seeing that post – forgot it was yours.

      In my case that didn’t work as the output from an optoisolator was the input and it was going to stay low regardless of any capacitors… The other side of the opto is on a different power supply.

      The ESP-03 has an antenna pin. It would be interesting to see what could be done with some wire on there. One of my planned projects is to do some range comparisons. In general, I am really impressed. My well pump monitor is at a -85db spot according to WiFi Analyser and my other devices won’t connect from there, but the ESP-01 in loco has not missed a connection in a week.

      Also, the connection times are impressive. Average 1.3 seconds on my desk!

      Just received 5 more boards and I have uses planned for all of them around the house. IoT, here we come!


  3. Hi Peter

    The problem with the ESP-03 is the stupid 2mm SMD form factor.

    I have just found the ESP-12 which looks as if it is on the normal 2.54mm pcb header grid.

    It has the on board pcb antenna and 9 GPIO pins,

    It also has a TOUT pin which is labelled ADC, and another pin labelled RTC. I have no clue as to how to use these!

    They are listed, at $3.45 with free shipping, here :- http://www.aliexpress.com/item/new-esp8266-ESP-12-wifi-module-ESP8266-serial-WIFI-coexistence-module-AP-STA-AP-STA-WIFI/32239125397.html

    The pinout is listed here :- http://esp8266.ru/wp-content/uploads/ESP8266_ESP-12_pinouts.png

    • Hi Peter

      I see where you are coming from.

      However “Package Size:1cm x 1cm x 1cm” as given does not tie up with the 22.9mm x 14.9mm size given on the pinout diagram.

  4. Peter, THANK YOU very much for this post. My ESP-03 must have arrived with no firmware at all. It responded to nothing at any baud rate. I tried following other wiring and were unsuccessful until I followed yours. The diagram with the asterisks is gold! Thank you for this and all your other posts on the ESP!

    • Check out the update concerning GPIO-18 which is actually GPIO-16 – and if I recall correctly there is a new mapping for the LUA interpreter so anyone using that will need to make changes anyway.

  5. Peter,

    Many thanks for documenting your experiences with the esp8266 modules; an
    educational and entertaining read.

    The ESP03 module:- Pin 12 on the -03 module is actually GPIO16, not
    GPIO18. The confusion seems to have originated with the blurry photographs on
    most of the eBay supplier pages. The Espressif datasheet for the chip (not the module)
    says specifically that there are “up to 16 GPIO pins”, but only 7 of them are identified on
    the included schematic. To confuse things even further, those that are identified
    include GPIO0 and GPIO16, implying more than 16 GPIOs. However, GPIO16 is
    clearly shown on the schematic as connecting to pin 8 of the chip, as well as to “R2”,
    a 0-Ohm resistor (yup, a jumper). A quick continuity check with a meter on an actual
    -03 module confirms that (module) pin-12 is connected directly to (chip) pin-8 and also
    to one side of the “R2” jumper (situated between (module) pins 1 & 2, with the
    antenna on one side and the ESP8266 chip on the other). That “R2” jumper is the elusive
    “deep sleep” enable, BTW.

    And, as with Hari, my -03 modules didn’t have any workable firmware loaded when they
    arrived (no response to AT commands, even though I did get and echo back on every
    character typed at the terminal). The Lua firmware load was simple and resulted in immediate
    functionality. Thanks!


    • Many thanks for that clarification John, you’ll see I have in fact now updated the page and it has the correct pin-out (had to do the drawing from scratch as I’d not kept the original… duhh..) An interesting weekend coming up with new Lua code and new AT SDK and I’ve some ideas of my own which is why I’m up at ridiculous o’clock in the morning.

    • Can you, please, elaborate on the jumper and its deep sleep relation?
      Does it mean the esp-03 variant works correctly with deep sleep without additional soldering?

      • I hope someone else in here can answer this as I’ve not looked into that yet. You know what, we could do with a short guide to each pin and what it is good for.

  6. Btw, I think there is a slight problem with the paragraph
    “The pins available on the ESP-03 include VCC and ground, Antenna output, RESET (low), CH_PD, RX and RX and the following GPIO pins – 00,02,12,13,14,15 and 16 but see the image above right concerning GPIO0, GPIO15.”
    I can’t see the RESET pin and there is a typo for one RX (should be TX). Should there be reset on one pin and GPIO16, we could just hard-wire it for deep sleep – that’s why I am interested 😉

  7. Hi Sancho – I’ve updated the blog but I must say I’m unhappy with the pin definitions out there. Someone needs to come up with a chart relating the chip pins and their functions – to the pins on the increasing number of boards out there. Thanks for checking,

    • Thanks a LOT for this blog!
      Thanks to you, I digged my ESP-03 (came by mail 4 days ago), wired it, programmed lua interpreter into it, soldered an ugly “jumper” over the pins for deep sleep and gues what?
      Including deep sleep 🙂
      Now I have few more GPIO – exactly as I needed, for both the i2c and the 1-wire 🙂
      Thanks again.

    • I soldered a bit of solder over the 2 pins inbetween the VCC and GPIO14.
      Next, I used my old deep sleep lua script. This is done in 2 stages:
      1. make init.lua, which will do some action – e.g. mine is calling dofile(“ds.lua”)
      2. this ds.lua measures temperatore on DS18S20s, sends it to server port
      3. as soon as the connection is closed, the lua script executes node.dsleep(60*1000*1000), which causes the unit to power down to deep sleep
      Stage 2 is basically the reset after the 60-second time period – the unit will wake up and run the init.lua again and again 😉
      I had to compensate for minor things – e.g. I have to wait with the communication until the wifi.sta.getip is not nil (means I have IP address), but it works beautifully.
      And, thanks to missing LEDs on ESP-03, the power consumption is minimal – I cannot measure it as my ampermeter has the lowest settings on 200mA and shows 0mA when the unit sleeps 😉

  8. Don’t quite follow the “2 pins between the VCC and GPIO14” – you mean on the chip itself? If you’re a little more specific I think quite a few people might want to do this for remote sensors. With the current work I’m doing on MQTT it would make sense to have an outside temperature/humidity sensor occasionally waking up (solar charge lithium) and sending a package. Sadly right now we don’t have MQTT and LUA on the same chip – but that might change.

    • Exactly – on the chip, you can see 2 small solder-dots. You should use 0-ohm resistor and correctly solder it in place. I am just a barbarian with terrible soldering skills, no magnifying glass and terrible solder iron, so the best I could do was to put a dot of solder to connect the pads – and it works 😉

      • Hi there – Ok, on my ESP8266EX pinout there is no VCC as such – GPIO-14 is on the bottom right – you know the more I look at this – these diagrams are rubbish – we really do need a definitive diagram….

        According to this source there are not 2 pins “in between” GPIO-14 and VCC.. just one..

        So based on THIS definition (assuming this is right for the moment), which 2 pins need shorting together.

        1 VDDA Analog Power (LNA) 3.0 ~ 3.3V
        2 LNA 50 Ohm RF Output ; recommended to retain π-type matching network
        3 VDD3P3 Power Amplifier (PA_BALUN) 3.0~3.3V
        4 VDD3P3 Power Amplifier (PA_STG1) 3.0~3.3V
        5 VDD_RTC NC(1.1V)
        6 TOUT adc pin
        7 CHIP_EN Chip Enable – Active High /Chip Disable (very low power consumption) – Low
        8 XPD_DCDC Deep-Sleep Wakeup/GPIO16
        10 MTDI GPIO12/HSPIQ
        11 VDDPST Digital and IO Power(1.8V~3.3V)
        12 MTCK GPIO13/HSPID
        13 MTDO GPIO15/HSPICS
        14 GPIO2 GPIO2/ UART_Tx (when used to programm Flash)/UART1_TX(when used as debug output);
        15 GPIO0 GPIO0/SPICS2
        16 GPIO4 GPIO4
        17 VDDPST Digital and IO power(1.8V~3.3V)
        18 SDIO_DATA_2 SD_D2 (serial 200Ω)/SPIHD/HSPIHD
        19 SDIO_DATA_3 SD_D3 (serial 200Ω)/SPIWP/ HSPIWP
        20 SDIO_CMD SD_CMD(serial 200Ω)/ SPICS0
        21 SDIO_CLK SD_CLK (serial 200Ω)/SPICLK
        22 SDIO_DATA_0 SD_D0 (serial 200Ω)/SPIQ
        23 SDIO_DATA_1 SD_D1 (serial 200Ω)/SPID
        24 GPIO5 GPIO5
        25 U0RXD GPIO3/UART_Rx(when used to program Flash)/UART0_RX(when used to receive data packet’s)
        26 U0TXD GPIO1/ UART0_TX(when used to receive data packet’s)/SPICS1
        27 XTAL_OUT Crystal output terminal
        28 XTAL_IN Crystal input terminal
        29 VDDD Analog Power (XTAL;PLL) 3.0~3.3V
        30 VDDA Analog Power 3.0~3.3V
        31 RES12K Serial 12kΩ Resistor to Ground
        32 EXT_RSTB External reset signal (active low)

  9. RIGHT- physical pins 8 and 32 – i.e. GPIO16 and EXTERNAL RESET. This does indeed come to a pair of “do-able” pads on the ESP-03 and ZILCH on the ESP-01 – one of the pins is connected to something – but the other one seems to be abandoned on the ESP-01.. what WERE the designers thinking about.

    So by the LOOK of it, the ESP-12 seems to be the one to watch because it has pins for both GPIO16 and RESET coming out to the edge of the board!

    Of course having said that I’ve not tested my ESP-12 for RANGE (the ESP-01 are pretty damned good and I’d hate to lose that).

    There’s another advantage to having the pins on the ESP-12 – a minor mod to the AT, LUA and other codes would allow for some status indicators – for example it would make a lot of sense to have a LED that flashes only intermittently when there is no connection and comes on solid when there IS a connection (and clearly OFF when asleep).

    • What I do not get is the question why the designers left unconnected output pad (NC) on the ESP03.
      I do not realy get the idea of yours with the led – the GPIO16 is connected to the pad on the ESP03 and when shortened to the reset, you can somehow use it, I assume, I just do not get how…

  10. Oh, I think because maybe GPIO16 when you go to sleep mode forces the unit into some special reset mode? I have been asking ESPRESSIF for a proper modern API guide – so much mis-information out there hampering progress.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s