ESP8266 and Arduino UNO - issues with wiring/power and AT

Hi guys,

I am moving this topic from this thread.

I am going to summarise it:

I was using these connections from an instructables:

Following the advice of an user on the original thread, I swapped TX with RX.
He also advised about a sufficient power source for the module.

I had a look online but all things are getting a bit more confusing/complicated for my electronic knowledge...

What I understood is that:

  • The 3.3 V from the Arduino UNO are NOT enough for the module
  • I need a bidirectional voltage regulator in order to protect the RX/TX pins from the 5V (If I do not use the 3.3V)
  • I need an external source of power.

Reading a tutorial stating that "If you have a 3.3V FTDI Serial to USB board you can get started without fear of destroying your new
ESP8266 WiFi module. Do note that many FTDI boards have a solder jumper to convert from 3.3V to
5V operation so ensure it is set to enable 3.3V operation."

So I tried the following connections, using a RS232 Serial Port To TTL Converter Module:

I have uploaded the BareMinimum skecth for all my trial to see if sending "AT" will sort any effect, but
Nothing, nothing, nothing

I tried different baudrate (9600 til 115200)
I tried end line, CR and both..

I am really stuck ATM :frowning:

I believe that I need to understand what to buy as an external power source for the Wi-Fi module. This might sort out the problem :confused:

Any advice for something not too complicated just to plug it in guys, please?
Or if it is something that it is complicated at least we could start with some advices/directions/something to read further, please?

Really appreciated.

Mario

I also have this one, that might make thing easier?

ESP8266 shield

And I think the specs are here:

ESP8266 shield specs

My concern is that I would like to use ALSO the LCD screen:

LCD shield

The LCD screen uses pins: D4-D9 and A0.

I would like to use both if it is simpler otherwise LET'S STICK to learn how to make it works the ESP8266 module.

I am trying to look to all the tutorials on Instructables and on thread in Arduino forum but it is getting very confusing now. I did not find a straight easy solution.

Any help please guys?

It's possible that the module is bad, or maybe the correct firmware isn't present.

Do you have an LED connected to GPIO2? It should blink when turning on the power.

My Beginner's guide to the ESP8266 might be useful to check your connections.

Pieter

LordKelvin:
Following the advice of an user on the original thread, I swapped TX with RX.

The reason you will sometimes see instructions to connect RX-RX, TX-TX between an ESP8266 and Arduino is they are just using the Arduino for the a USB-serial adapter chip to communicate directly from the Serial Monitor to the ESP8266. Since you want the Uno to communicate with the ESP8266 RX-TX, TX-RX is correct.

LordKelvin:
Reading a tutorial stating that "If you have a 3.3V FTDI Serial to USB board you can get started without fear of destroying your new
ESP8266 WiFi module. Do note that many FTDI boards have a solder jumper to convert from 3.3V to
5V operation so ensure it is set to enable 3.3V operation."

The problem is you are still going to encounter the same issue with the 3.3 V pin on the adapter not being able to supply enough current for the ESP8266 to run reliably.

LordKelvin:
So I tried the following connections, using a RS232 Serial Port To TTL Converter Module:

Not a very accurate fritzer if you're really using that serial port adapter at the link. Are you actually using a genuine serial port? I thought I was the last one who even had one on their computer and that computer just died. Are you certain that thing is putting out 3.3 V on Vcc? I'd expect it to be 5 V, which will most likely destroy your ESP8266 if you power it at 5 V (you can probably get away with giving it 5 V logic but definitely not a 5 V power supply).

LordKelvin:
I also have this one, that might make thing easier?

ESP8266 shield

Yes, that will be more simple because it has a 3.3 V regulator so you can power the shield at 5 V. I have some of those shields:

  • AT firmware installed
  • Communication at 115200 baud
  • ESP8266 connected on pins 0 and 1
  • Switch 1 is connected between pin 0 on the shield and TX on the ESP8266. It must be turned off when uploading to the Uno if you have the shield plugged into the Uno
  • Switch 2 is connected between pin 1 on the shield and RX on the ESP8266
  • Switch 3 is connected between ESP8266 GPIO0 and ground. This is used when you want to manually update the firmware on the ESP8266. Otherwise leave it in the off position.
  • Switch 3 controls the LED used as an indicator during firmware updates. Leave it in the off position otherwise.

The tricky thing you need to remember with these shields is if you plug them directly into an Uno they connect the ESP8266 to pins 0 and 1 of the Uno. Those pins are also used for uploading sketches to the Uno and communication with the computer (e.g. Serial Monitor). So the different uses of the pins can conflict with each other. Some people will instead connect the shield to other pins on the Uno and use the SoftwareSerial library to communicate with the ESP8266 via those pins. The problem with this is you can't reliably use SoftwareSerial at 115200 so you need to send an AT command to the shield to change the baud rate to 57600 or lower.

LordKelvin:
And I think the specs are here:

ESP8266 shield specs

No, that's a different shield, the "DOIT shield", also sold as "duinotech" by Jaycar. Yours is the "elecshop.ml shield". The DOIT shield comes with a proprietary firmware, not the AT firmware installed on your shield so the instructions at that link are not useful to you.

I like to use the WiFiEsp library with my shields:

Unfortunately the author assumes you have a different configuration of the ESP8266 so you need to make some minor modifications to the library and example code to make it work with your shield. I've just been over all this in another thread so I'll refer you to that one instead of going through it all over again here:
http://forum.arduino.cc/index.php?topic=466167

LordKelvin:
My concern is that I would like to use ALSO the LCD screen:

LCD shield

The LCD screen uses pins: D4-D9 and A0.

That doesn't interfere with the pins the shield uses. I'm not sure how much of an issue the blockage of the WiFi signal from a shield on top of the ESP8266 shield might be, it definitely won't cause complete shielding. The other concern is you will no longer have access to the switch that needs to be turned off before each upload to the Uno and then back on to enable communication with the ESP8266. If you connected the ESP8266 shield to different pins that wouldn't be a problem as you could leave the switch on always. Definitely focus on getting the ESP8266 working before you start writing code for the LCD.

PieterP:
It's possible that the module is bad, or maybe the correct firmware isn't present.

Do you have an LED connected to GPIO2? It should blink when turning on the power.

My Beginner's guide to the ESP8266 might be useful to check your connections.

Pieter

Pieter, thanks a lot for your tutorial, I am reading it.

I am thinking to buy this
Voltage Regulator - 3.3V COM-00526 RoHS

Re the advice to buy a serial to USB adaptor, I am not sure about it. I mean, I am TRUSTING you but for what I understood I could use my Arduino UNO to program the ESP8266 (I could use the UNO as a serial to USB adaptor) without spending more money right?

I am saying this because it is not my intention to use the ESP8266 STAND-ALONE but to use it connected to the Arduino. All the sensors of my project (and the LCD) will be connected to the Arduino too!

I would like to hear your thought about it. I might have misunderstood your post.

I just want the ESP8266 giving the UNO a WI-Fi capability.

P.S. Sorry I do not have an LED connected to GPIO2.

pert:
....

Dear pert, thanks so much for taking your time to write such a long post/explanation!

I understood now the RX-RX, TX-TX reasons.
Re using that adaptor, please let's forget about it. Just a crazy idea sorry :frowning:
Re the shield, if the only advantage is that I have the 5V - 3.3V regulator I can just buy it for 1-2£ and do not use the shield, is it correct?

Guys what I really really want is to have the easiest solution possible (even if I need to spend more money) to connect my Arduino UNo that will read data from one sensor (T/RH or Oxygen) and transmit them ONLINE to ThingSpeak for example. Now my focus is to make the hardware works...

If you think I can just plug in the shield (without anything else needed) and is going to be LOT easier then I will go for that solution, otherwise If not using the shield option means that I need just to add a 3.3V regulator from my link (Sparkfun), I would not mind to learn how to wire it up.

I am looking for the easest solution possible, I am really a newbie of all thess things :frowning:

thanks a lot for any futher answer :slight_smile:

LordKelvin:
Re the shield, if the only advantage is that I have the 5V - 3.3V regulator I can just buy it for 1-2£ and do not use the shield, is it correct?

I believe the shield also has level shifters on the serial lines. There's definitely a lot of evidence that this is not necessary but I do prefer not to subject the ESP8266's IO pins to 5 V, maybe I'm just being overly cautious. See the comment here from "Teo Swee Ann", supposedly the CEO of Espressif, the manufacturer of ESP8266:
(Teo Swee Ann

The shield also has the switch to allow you to still easily upload to your Uno.

I'm not sure exactly how much flash memory that ESP8266 module has but some of the ESP-01 modules only have 0.5 MB (megabyte) of flash memory, which doesn't allow you to install the AT firmware which allows OTA firmware upgrades of the Espressif firmware. The modules usually come with the AI-Thinker firmware installed and I don't know whether that firmware has OTA capability or whether it has the same flash requirements. I always just install the latest Espressif firmware on mine.

So it's really up to you whether you want to use the shield or module. If you continue to have troubles with the module it could be a good idea to do a quick test of the shield just as a sanity check to make sure you don't have a bad module.

pert,

so the ONLY advantage I will have is that I could avoid to add the 2£ 3.3V regulator and all its wiring up with caps right?

OR the shield is REALLY the plug-and-play solution I am looking for In your opinion guys?

The shield has some disadvantages, you can't swap the pins to use SoftwareSerial, for instance. However, it's nice to have a 3.3V regulator + a level shifter + dip switches + ... all on a single board.
I usually use the AI-thinker modules: I can tell you, that's a lot of wires going between my breadboard, the Arduino and the ESP ... But it's easier to customize, that's why I prefer these modules over a shield.

If you want an easy solution, without having to worry about external components and loose wires, a shield is probably the best way to do it.

But you're limited to using AT-commands, so you can't use all features of the ESP. It's much better to program the ESP directly.
In most cases, you'll find that you don't even need an Arduino, so the shield format is pretty useless in these scenarios, and a simple ESP8266 board (e.g. nodeMCU) or module (e.g. AI-thinker modules + FTDI + 3.3V LDO) would do the job just fine ...
You can find more information in my guide.

Pieter

LordKelvin:
so the ONLY advantage I will have is that I could avoid to add the 2£ 3.3V regulator and all its wiring up with caps right?

That and the switch. Easy enough to just plug/unplug the wire from the Uno instead when you want to upload though.

I agree with PieterP that if you want to program the ESP8266 directly instead of controlling it via AT commands from the Uno the shield is not a good choice. It can be used for that purpose but that's not what it was designed for and there are cheaper, smaller, breadboard friendly boards with all the components necessary if you wanted to do that. It sounds like you are wanting to go the route of using the AT firmware instead though. You actually can connect the shield to pins other than 0 and 1 by carefully bending those pins out so they don't go into the female headers on the Uno and connecting them to any pins you like with jumper wires.

Hi guys, hope you had a great weekend!

Now stuff are getting lot clearer :slight_smile:

I was thinking to buy the following items to try to use the ESP8266 without the shield:

FT232 USB to Serial Port / TTL FT232R FT232RL Board VCC Output Level Selection Jumper

10μF capacitors

10k Ohm resistors

Axial Fixed Resistor 470Ω ±5% 2W

Please guys help me to understand if I am ordering the right things :slight_smile:

I already bought this:

ld1117v33 regulator

Thanks a lot guys!

M.

The FTDI board looks alright, I'd also buy some male header pins to solder onto the board, to get access to the DTR pin. This means that you can upload programs without having to press a physical button each time, it's a great feature.
This is the schematic:


You can use pretty much any type of small signal transistor, like a BC547 or a 2N2222 for example. You may find that 12kΩ is too high for the base resistors. I'm using 8.2kΩ and 2N2222A's.

I also like to add a smaller bypass capacitor to the supply, close to the ESP, mostly just 0.1µF. It's not critical, but it's recommended, and I've never run into instability issues.

A 470Ω resistor of 2 Watts is definitely overkill, ¼W is more than enough.
I'd recommend to get an assortment of E12 resistors to get started, this is way cheaper than buying individual resistors, and you'll need them anyway.

You'll also need some jumper wires, to connect the ESP to your breadboard (you'll need one) and to the FT232.

Pieter

Edit: the advantage of an FTDI board with a jumper (over ones with a switch) is that you can just connect a (female) jumper wire to the 5V pin of the jumper to get the 5V USB. The FT232's 3.3V regulator is not powerful enough to run the ESP, and you'll need to get that 5V somewhere to power your 1117v33.
I'm using this board, because it also breaks out the 5V and ground pins to the headers at the bottom.

LordKelvin:
FT232 USB to Serial Port / TTL FT232R FT232RL Board VCC Output Level Selection Jumper

I strongly recommend getting an FTDI board that has the standard FTDI header pinout (that one does not). You want:
DTR, RX, TX, VCC, CTS, GND
I think some have the DTR and CTS swapped but that doesn't matter. Although it's not necessary for this project, an FT232 breakout board is a very useful tool for all sorts of things and having a standard pinout will make it so you can just plug it right in to things like a Pro Mini. It's just generally a good idea to use standardized pinouts in the rare cases when people have had enough sense to settle on a standard. I don't know why some companies have to do something different.

I like the super cheap ones you find on Aliexpress (~$1.55 USD w/ free shipping) or eBay(~$1.81 USD w/ free shipping). They have counterfeit chips but I'm sure that one from Gearbest is counterfeit also. There was a Windows driver that FTDI released a while ago that caused problems with the counterfeit chips but it's Windows only, I think it's no longer an issue, and if it still is there are many well documented workarounds. I've been using them for years with Windows and they work fine.

By the way, gearbest is one of the websites that people have been getting redirected from forum links to because this forum is currently hacked. I'm not sure how much they're involved with the scum who are responsible but I would tend to avoid doing business with them if at all possible because they are financially supporting this attack.

pert:
I strongly recommend getting an FTDI board that has the standard FTDI header pinout (that one does not). You want:
DTR, RX, TX, VCC, CTS, GND
I think some have the DTR and CTS swapped but that doesn't matter. Although it's not necessary for this project, an FT232 breakout board is a very useful tool for all sorts of things and having a standard pinout will make it so you can just plug it right in to things like a Pro Mini. It's just generally a good idea to use standardized pinouts in the rare cases when people have had enough sense to settle on a standard. I don't know why some companies have to do something different.

I like the super cheap ones you find on Aliexpress (~$1.55 USD w/ free shipping) or eBay(~$1.81 USD w/ free shipping). They have counterfeit chips but I'm sure that one from Gearbest is counterfeit also. There was a Windows driver that FTDI released a while ago that caused problems with the counterfeit chips but it's Windows only, I think it's no longer an issue, and if it still is there are many well documented workarounds. I've been using them for years with Windows and they work fine.

By the way, gearbest is one of the websites that people have been getting redirected from forum links to because this forum is currently hacked. I'm not sure how much they're involved with the scum who are responsible but I would tend to avoid doing business with them if at all possible because they are financially supporting this attack.

I did not know about Gearbest. I will follow your suggestion then.

I found this list but I do not have the capability to understand what to pick. May you point towards one of them please? Please not from China because I cannot wait too long to get the item :frowning:

Thanks a lot.

I'm sure the one at your link will work fine. I'm just saying that if you have your choice of one with a random pinout and one with a standard pinout, definitely get the standard one. You'll definitely thank yourself later, especially if you're like me and end up buying a handful of them to be sure of always having one on hand if one goes missing or I let out the magic smoke. The other tricky thing I've noticed is some companies put the female headers on them, some put the male headers. Sparkfun and Adafruit both went with female but every cheap one I've seen is male. So I put the female headers on any board that I want to plug an FTDI into and I would find working with an FTDI adapter with female pins quite annoying (less breadboard friendly too).

From the link it looks like you might be in the UK so I wouldn't know where to tell you to look for one that doesn't come from China. I do sympathize with the wait. It seems like whenever I'm looking forward to something it takes two months and when I don't care it's 4 days. I've actually had shipments from China beat orders placed from domestic sellers on the same day. I try to anticipate anything I might need for a project I'm planning and get it ordered right away. Usually everything arrives by the time I've gotten caught up enough on work to do the project but sometimes it causes long delays.

list

From here I am not able to understand what has the standard pin and what not :frowning: bit confused now, really sorry :frowning:

This is the one I like:
www.ebay.co.uk/itm/272461523239
You can change it from 5 V to 3.3 V using the shorting jumper.
I notice the seller takes 15 days to ship so I guess that means they are just ordering them from China for you and adding a markup. So that's not much help.

This one is a little different but same pinout:
www.ebay.co.uk/itm/132142072567
The price is higher but the shipping time is more reasonable. It has the standard pinout. The voltage switch is kind of handy but I don't change the voltage often enough to really need that on mine.

Here's another like the ones I use:
www.ebay.co.uk/itm/191986437574
with a reasonably fast shipping time. Getting pretty pricey though.

It turns out that Gearbest ships from China:

Goods are sent from China by courier

so the price they're charging for that adapter is pretty high and the shipping would be slow.

Really thanks!

Once I have all the items I will play a bit with them and come back here for an update if you guys are still so kind to help :slight_smile:

I have got an idea.

I reflected a lot during this Easter break about it.

I would like to hear some thoughts from you guys. I do not want to take a route that will make me waste lot of time in wrong directions.

First of all thanks a lot for all the information. I will keep all of them as a valuable options.

But, what If I could just use this NodeMCU LINK HERE

Program it through the IDE of Arduino

And connect the Oxygen sensor, DHT22 T/RH sensor and Serial to USB scale to this NodeMCU alone without using the Arduino board AT ALL?

I would just like to know if it is possible, I would not like to mess it up...

For what I understood the NODEMCU has the 3.3 regulator and USB/serial converter so if is acually indipendent!

There is something wrong in this idea?

Might I have issue connecting all my sensors to the pins perhaps?

Thanks a lot guys.

P.S> in the meanwhile I am still waiting for some CONs and resistors to try your options...

That's definitely going to be easier. The only thing to keep in mind is that there might not be ESP-compatible libraries for your sensors.

Pieter