Search code examples
arduinoarduino-esp8266

Can I use the ESP8266 Module on its own?


I am trying to wirelessly control an Arduino Uno R3 from a website. I plan on receiving sensor data and then displaying it on a Website. Alongside this, the website will be able to control certain functions of the Arduino.

So far most of the tutorials and similar projects I have been studying from tend to do things very differently. One of the biggest differences is where they used the ESP8266 module as a standalone module, or they connect it to the Arduino Uno.

So my question is, what is the difference? When should I use the ESP8266 module without the Arduino Uno and when should I connect the two?

Thanks!


Solution

  • It depends on the complexity of the firmware and the amount of data you need to load/parse/cache on the ESP8266.

    If it's a basic REST API you can GET and POST some data with minimal payloads it should work on the ESP8266 directly. I haven't used this module in a few years, but from what I recall there are multiple firmware options each with supporting different languages (e.g. c++ / Lua / MicroPython), each with more or less features.

    My assumption is that if you need to use an Arduino depending on the type and number of sensors required. One other scenario might be projects where the majority of the code is Arduino already (possibly even assembly) and the ESP is simply used to allow the Arduino Uno to connect to WiFi. (There are official Arduino boards with Wifi support now though).

    Bare in mind ESP8266 comes in quite a few flavours. The minimal version(ESP-01) supporting up to 4 digital pins (if you re-use RX/TX pins). If you need to use analog pins or more digital pins you'd need a different model (e.g. ESP8266-12 or higher). Personally I've found the ESP-01 model a bit annoying to program on it's own and had to use a basic improvised circuit to make it easier to switch between flashing modes so I could re-program the board.

    If funds allow it I recommend saving yourself the headaches and getting at least an ESP8266-12 or higher or even an ESP-32 which has even more features.

    Bottom line is to see what specs you'd need to connect/send/receive/parse web data and find the closest matching WiFi enabled micro controller (ideally with a bit of extra grunt just in case the web requirements change in the future). This may be an ESP model or a completely different web enabled micro controller. The decision is yours based on the factors mentioned above as well as availability / pricing / budget / etc.

    Slightly off-topic, if the REST data you're using is using JSON payloads it's worth checking and ArduinoJson and it's Assistant tool: it makes serialising/deserialising JSON much easier.