ESP8266 powering

Hi all. So My ESP8266 board has just arrived. Now I can link to Blynk via wifi… hopefully.

I’m trying to work out and have looked but can’t find a definitive answer with regards to powering it.

It says it’s a 3.3v input (which I didn’t know from the start as previously used Arduinos) my dosing pump takes 12v which I was hoping to run into the enclosure and use a 12v-5v reducer which I have to run the board. But can I run it with 5v at all??

Exactly what type of ESP8266 board are you using?

Pete.

Hi Pete. Hope you’re having a nice weekend.

God I don’t know. Didn’t realise there was different ones. One sec. this one. Is this enough info?

Yes, this is a NodeMCU, which has an ESP8266 processor on it.

This is actually more powerful than your Arduino, and could replace it entirely, provided you don’t need more than one analogue input and around half a dozen digital pins.

If you want to use it as a WiFi modem for your Arduino then you must not upload a sketch to it, as this will overwrite the factory firmware.
You should connect it to your PC using a USB cable, select the port and set your serial monitor to 74880 then press the RST button. Hopefully you’ll see some data that mentions “AT” firmware. If you do then you should be able to use it as a WiFi modem.

The “Vin” pin (bottom left) accepts 5v to power the board.

Pete.

This explains a bit about the various boards you might come across…

Pete.

That’s great then. I only plan on using 4 of the outputs to control 4x relays. I assume you would recommend using Blynk timer over an RTC?

Yes, provided you have a good internet connection.

Pete.

So I assume that I code in exactly the same way as the Arduino?

Yes. You’ll need to install the ESP core into the Arduino IDE…

You’ll also need to ensure that you understand the relationship between GPIOs and the numbers printed on the board…

And know which pins are ‘safe’…

You’ll also need to include the correct libraries…

Give us a shout if you get stuck.

Pete.

Install there ESP core?!?!? Oh god I think I have bitten off more than I can chew here. I’m a very very basic coder so no doubt I’ll have to ask.

I need just four I/O pins to link to my relay to switch them… Which would you recommend?

The ESP core bit is easy, just follow the instructions about adding the url into preferences then downloading the latest version in boards manager.
This just tells the IDE how to compile code for the ESP boards.

GPIO’s 4 (D2), 5 (D1), 12 (D6) & 13 (D7)

Pete.

Thank you Pete. I didn’t scroll down far enough to find the instructions… I thought it was just a folder of files of which I had no idea what they were. Ill do this after my tea. Thank you.

Which would my board be from these? From he amazon link above I could potentially pick several. Not sure how much difference it will make.

https://i.ibb.co/CtjXKyK/Screenshot-2021-01-10-at-00-16-57.png

NodeMCU 1.0 (ESP-12E)

Pete.

Superstar thank you.

And in the App, choose NodeMCU as well

Pete.

Hi Pete.

I’m getting on quite well. One thing though, when I tried to use the above pins as you suggested, my Blynk app will only let me select D1 through D10, nothing higher??

I have done some testing and pins D1, D2, D5 and D6 seem to work for basic HIGH/LOW output. Is this ok or not?

Also, I used to use EEPROM on my Arduino to store all the data that I input in case of a power cut etc. Is it safe to assume (as I do not know how to use it on the NodeMCU) that adding the following will call all data from the cloud and reload it into the Arduino in case of a power cut?

BLYNK_CONNECTED()
{
rtc.begin();
Blynk.syncAll();
}

What device type and connection type did you choose in the app?

You’d actually be better using virtual pins rather than digital pins in the app.

Yes, it will, provided that you have an Internet connection.

You can use SPIFFS or LittleFS instead of storing data in EEPROM if you prefer.

Pete.

Great, ill do some reading on SPIFFS and Little FS whatever they are. lol

I chose NodeMCU and WiFi.

Basically for my dosing pump (a pump unit that supplies chemicals into a fish tank) I need to ‘prime’ the tubes with the liquid so I have a push button on the app that just turns the pin HIGH/turns the pump on so that it primes the tube. I will rarely use it so thought that using a simple digital pin on/off would suffice.