Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: wellnesscookie on Jan 14, 2020, 04:03 pm

Title: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: wellnesscookie on Jan 14, 2020, 04:03 pm
Greetings,

I am very new at arduino, and not long ago, we started teaching it in school. We already got to work on some project, and we would like too make our arduino control a few output pins via wifi.

To be more exact, we would like to create a mobile app that will with a press of a specific button tell arduino to do something (Simple turning on the wired cooler to it or so). I have seen some wifi modules over the internet like  ESP8266 ESP-01 ESP01 and some WIFI shields as well.

What I would like to ask, is that even possible and if it is, which one should I get? I would like either the first module or wifi shield to act as a router for mobile devices. They connect to it and I am able to send some requests from my phone to my arduino, and vice versa. If it's not possible for those modules to act as routers, am I able to connect them to the real router of mine and then make a connection:

1. Mobile  <-> Router <-> Wifi module ESP8826 (or shield)
2. Mobile <-> Wifi module (or shield)

I am okay with any. I would also be very thankful if someone could also recommend me a few modules/ shields I could use for this.

Thanks in advance!
Title: Re: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: Robin2 on Jan 14, 2020, 04:33 pm
The ESP8266 is a combination of a microprocessor and WiFi. You can program it with the Arduino IDE and if you do not need very many I/O pins you would not need to use a regular Arduino board with it. The ESP8266 microprocessor is a lot faster and has a lot more memory than an Uno or Mega.

You can buy the ESP8266 as a bare module in a few different configurations but it would probably be more convenient to buy something like the Wemos D1 board or a similar device.

If you want more info have a look on the ESP8266 Forum.

If you do want to use an ESP8266 in conjunction with an Arduino board then the usual arrangement is to establish a serial connection between them.


...R
Title: Re: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: wellnesscookie on Jan 14, 2020, 04:43 pm
The ESP8266 is a combination of a microprocessor and WiFi. You can program it with the Arduino IDE and if you do not need very many I/O pins you would not need to use a regular Arduino board with it. The ESP8266 microprocessor is a lot faster and has a lot more memory than an Uno or Mega.

You can buy the ESP8266 as a bare module in a few different configurations but it would probably be more convenient to buy something like the Wemos D1 board or a similar device.

If you want more info have a look on the ESP8266 Forum.

If you do want to use an ESP8266 in conjunction with an Arduino board then the usual arrangement is to establish a serial connection between them.


...R
Okay, thanks, I partially understood. But I would like to know if I connect the module to my Arduino UNO, will I be able to somehow set it up to act as a router access point for my mobile phone to control it? Or even better, if they could talk via a 3rd router?
Title: Re: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: zoomkat on Jan 14, 2020, 06:06 pm
I've got two WeMOS D1 boards (~$4 china, ~$7 USA) with the 8266 wifi chip, and they are very simple to use. They have the basic functionality of an UNO board, but maybe fewer I/O pins. The below link shows some typical stuff. I'm not sure they can function as a router, but can act as an access point and connect easily to an existing wireless router.

https://randomnerdtutorials.com/?s=web+server (https://randomnerdtutorials.com/?s=web+server)
 
Title: Re: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: Robin2 on Jan 14, 2020, 06:31 pm
But I would like to know if I connect the module to my Arduino UNO, will I be able to somehow set it up to act as a router access point for my mobile phone to control it? Or even better, if they could talk via a 3rd router?
In general, yes. The ESP8266-01 comes with a program installed that allows the Arduino to control the WiFi by sending (and receiving) messages using a serial connection. There should be plenty of information on the ESP8266 Forum and the Forum has links to a book about the ESP8266 that you can download for a small fee.

However if you want to develop a complex web application it may be easier to do it on the ESP8266 itself, and the ESP8266-01 is probably the least convenient for that as it has very few I/O pins.

Also, follow up what is in Reply #3

...R
Title: Re: Controlling arduino pins via ESP8266 ESP-01 ESP01 wifi module
Post by: noiasca on Jan 15, 2020, 05:31 am
Code: [Select]

I would like either the first module or wifi shield to act as a router for mobile devices.


The ESP8266 can either be connected to a wifi provided by your router or
the ESP8266 can span its own wifi/providing a network for your mobile. In that case the mobile will get an IP via DHCP from the ESP8266 and you connect directly to the ESP.

As mentioned already, the ESP8266 can be programmed in the Arduino IDE, very similar to the UNO.
There are Beginner-Friendly variants with more Pins and built in USB like Wemos D1 or NodeMCU.
If you still need more pins, you can use I2C PIN Port expanders, or even another UNO as slave on the I2C Bus.