ESP8266 + Arduino Uno. It works...sometimes!

Hello!
I’ve been using my Arduino UNO + ESP8266 + Blynk for 2-3 weeks and I’m experiencing a lot of troubles…
My Blynk works… sometimes! After many tries, I would say about 30% of the times, not more.
When it works, OK, I can do everything.
When it does not work, I got different errors: (in the serial monitor)
Failed to disable Echo
or Unable to Connect Wi-Fi.
Or often I got the [3780] Connected to WiFi message, but then it hangs there, without other messages.
Argh!

After many tries, I think the problem is not in the blynk libraries, but it’s in the hardware and/or the firmware.
Because when it is unstable, also other libraries (like WiFiEsp) don’t work.
It doesn’t depend on the overheating or so. Normally it becomes very unstable when I do a lot of changing/uploading.
I have 2 ESP-01, one with AT SDK v. 1.0.0 and one with 1.4… but I got the same problems with both.
About the hardware connection, I use this:


I tried also direct connection to 3V of Arduino UNO, with the same results/problem.
About the software, I use the shield_SoftSer example. Speed at 9600 baud

Any suggestions?.. Does someone have similar problems? Perhaps is there a better hardware connection?
Thanks from Italy!!! (and sorry for my bad english)

Not direct a help, but with ths “sometimes work sometimes not” and “unexpected result” or “reset” errors I have a lot of experience from my beginning time.

At my setup it was the power supply. I changed to powersupplies which delivers 1A. Less amps results in strange results.

Do you supply your ESP from the Arduino? In my setup did this not work reliable. To less amps.

Greetz, Bernd

Hello Bernd!

I supply the ESP using the 5V of Arduino using this adapter
http://www.ebay.it/itm/ADP-01-Adattatore-per-ESP-01-ESP8266-Breadboard-Adapter-Level-Converter-3-3V-5V-/1315646052301

Which 3V battery provides 1A? I used the AA battery without success…

Greetz

A few things I recommend:

  1. Always use a dedicated power supply for the ESP. Any ESP can use about 300mA when it is driving the WiFi radios. Your Uno ports can’t supply anything close to this. A GPIO pin should not go over 20mA and even the 3.3V out pin can only deliver 50mA. The total power draw for the entire Uno board cannot exceed 200mA. Bottom line is you can’t use the Uno to power the ESP. for a Uno/ESP combination I typically use a 7-12v power supply connected directly to the Uno Vin pin and also to a 3.3V linear voltage regulator and associated capacitors (see the data sheet for any voltage regulator like an LM1117-T-3.3 for how to build one of these or use a commercial supply). It’s generally recommended to power the ESP with a supply that can deliver 0.5A to be safe.
    [Note: pighixxx.com has great pinout diagrams, such as this one for the Uno: http://www.pighixxx.com/test/portfolio-items/uno]

  2. DON"T USE 5V TO POWER YOUR ESP8266. You see all kinds of instructions on the web that say you can power the ESP with 5V. BAD IDEA. The ESP data sheet says the max voltage is about 4V so plan on breaking your ESP in mysterious and hard to debug ways if you do this.

  3. Similarly, DO NOT use 5V I/O with the ESP. Level shifters are easy to find and are very inexpensive. Here’s a bidirectional shifter from China that I use at less than $1US: http://www.electrodragon.com/product/logic-level-converter-bi-directional-v2. Or, make your own like this: http://www.hobbytronics.co.uk/mosfet-voltage-level-converter.

  4. @vshymanskyy recommends you use hardware serial for the ESP, not software serial. This means you cannot use the TX and RX ports for serial I/O (e.g. debugging) and be careful to remove the RX/TX lines to the ESP when downloading code to the Uno or you’ll mess up your ESP. You can use SoftwareSerial for the sketch (and Blynk) debug output if you need to. Basically: use the TX/RX lines to download the sketch, plug in the ESP, and then reset the board.

  5. @vshymanskyy also recommends using v.1.0.0 AT 0.22 firmware when using the ESP as a WiFi adapter.

There many other things that can be wrong, including insufficient memory on your Uno. I now prefer to run the code on the ESP (using an ESP-12E or 12F) instead of using the ESP as a WiFi adapter to the Uno. You are limited on GPIO ports and analog ports among other things, but it’s easy to add a shift register for more GPIO and an ADC for more analog ports.You’ll have 8M of SRAM to work with on the ESP vs 2K(!!) on the Uno. Now that you can program the ESP directly using virtually the same code and the Arduino ISE, I may sell my stock of Uno boards. See https://github.com/esp8266/Arduino.

Good luck.

RD7

3 Likes