logo elektroda
logo elektroda
X
logo elektroda

How do I configure the ESP-01S with the Arduino to control the central heating cooker via WiFi?

patryk-84a 1917 12
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18038310
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    Hi. I have an arduino based central heating furnace controller. It controls the furnace, boiler and ball valves. I am now adding BT control from my phone so that I can read the current temperature or change the settings. When writing the code, however, I thought that BT has a lot of limitations, such as distance. I came up with the idea of buying a Wifi module. The question is how to configure it, what to upload etc to make the ESP module communicate with the Arduino via UART like a BT module. The module has the symbol ESP-01S.
  • ADVERTISEMENT
  • Helpful post
    #2 18038367
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    You need a 5<>3.3V logic level converter and a 3.3V supply to esp. As for the connection, rx->tx and tx>rx. Do you have the atmega as clocked ?

    Greetings
  • ADVERTISEMENT
  • #3 18038444
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    Thanks for the feedback. Yes about the converter I know. The Arduino is a UNO R3 clocked from an external 16MHz resonator. But I'll tell you that I didn't even know it was important. When playing with e.g. HC05 I set only in bt and arduino the same baudrate and everything works. To write software for the phone I will probably use App Inventor, I have a lot of experience with it, the worst thing is to program the ESP, here I am a complete layman. I probably need some software for ESP?
  • Helpful post
    #4 18038537
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    You program in the same way as the Arduino UNO, in the same environment, you just need to download the ESP board definitions to the Arduino IDE, you will find plenty of descriptions on the web on how to do this.

    Greetings
  • #5 18038874
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    So it will be something like communication between two processors? In both arduino and esp I have to write programs to send and receive data over uart? In addition, in esp there is also a part of the code for wi-fi communication?
  • ADVERTISEMENT
  • #6 18038944
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    Exactly right. Same baud on both sides.

    Greetings
  • #7 18039013
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    Ok. I will order a converter, connect everything and if I have problems finding resources I will ask further. Greetings
  • ADVERTISEMENT
  • Helpful post
    #8 18039303
    kaczakat
    Level 34  
    Posts: 1748
    Help: 317
    Rate: 230
    Once your ESP module arrives it is ready to use as they brought it - in AT command mode, which is exactly like the BT module. What Slawek K. described is an optional solution, giving you many more options and possibilities, but optional. You can issue a few commands to the already existing software in ESP - set it to station mode, connect to the WIFI AP, set the server and wait for connections, then what arrives will pass between the server client and UNO. So that as a start, check what options are supported in this App Inventor for the phone, maybe nothing needs to be changed in the ESP.
    Helpful post? Buy me a coffee.
  • #9 18039665
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    I don't need much. Just a few bytes back and forth. So esp will work on uart as standard? I have e.g. data to receive of type a=45,34,0,0,1.
  • #10 18039800
    kaczakat
    Level 34  
    Posts: 1748
    Help: 317
    Rate: 230
    As usual, there are many roads to the destination. When you get the module, you check what soft you have, the version and decide what to do next. The description of the AT soft upgrade is certainly in this section because I recently wrote in such a topic. There is also the option of uploading the virtual COM software from ESP-LINK. Because if you set up a server with AT commands, not only your commands will arrive, but lots of other information, that someone has connected, that they sent a message, from which IP, the message itself, etc. This can be useful or disruptive. With ESP-link ESP starts up with a web server at all, you do all the configuration by clicking on the options, and then the communication looks just like with UNO connected to a PC. From the PC side, you can also install the software and add such a COM port to the system, do the software upload in the Arduino UNO via WIFI. I use Tibbo Monitor:

    How do I configure the ESP-01S with the Arduino to control the central heating cooker via WiFi? .
    From the Android application side you would simply connect to the ESP according to the selected ESP configuration link to a TCP or UDP server, to a specific IP and port.
    Helpful post? Buy me a coffee.
  • #11 18039934
    patryk-84a
    Level 28  
    Posts: 1433
    Help: 40
    Rate: 211
    I have very little to do with networks and zero idea about it. I'd rather not need internet access. The most important thing is that it should work on a home network or even something like wifi direct? As simple as possible for a layman. After bt communication is no big deal, but unfortunately the range is poor through walls. But with these software updates via the internet it's an interesting thing. I could remotely update the controller without taking it apart :) .
  • Helpful post
    #12 18039991
    Slawek K.
    Level 35  
    Posts: 3020
    Help: 259
    Rate: 1301
    In my proposal, it is simple and just the way you want it, without any of the rubbish that esp spills quite heavily. You can also upload ESPEasy and then communication with an external application on any device is trivial as it is based on URL syntax and on ESPEasy you just need to run a virtual COM and send data to atmega, and the other way round. If you need help in this area, please contact me on PW.
    Here you will find a lot of information on ESPEasy https://www.letscontrolit.com/wiki/index.php/ESPEasy and there are plenty of tutorials on how to connect it to Android. I also use APP Inventor to write apps for android.

    Best regards
  • Helpful post
    #13 18040001
    kaczakat
    Level 34  
    Posts: 1748
    Help: 317
    Rate: 230
    Uploading software via UART and bootloader is possible, but you would still have to push reset at the right moment. With the BT module it is easier, at least the HC-05 has one pin that can do a reset at the moment of connection (after a little reconfiguration of the firmware settings - one AT command), via a capacitor analogous to the autoreset in the UNO/NANO board.
    There is a stk500v1 programmer built into the 2.2.3 version of esp-link, something like USBASP, except that communication is via a COM port, in this case a virtual COM port over LAN/WIFI, but this requires the UNO ICSP connector to be connected, so permanently it is taking a few pins from UNO, and the ESP8266 version, which has more IO pins available - NODE MCU or WEMOS.
    As for this bridge over WIFI, start with your App Inventor and see what it requires, what it can offer. On the ESP side you have 3 routes to choose from, and in the version with your own software written in Arduino you are only limited by your imagination and your skills. Both ESP-LINK and AT firmware allow you to work in AP mode, i.e. without a router, the WIFI router/AP is the ESP and you connect e.g. your phone to its network, as a station, i.e. you connect to a WIFI router, or a mix of STA+AP. In the AP version, the range does not necessarily have to be greater than BT. Much more reliably connect the ESP to the router, better antennas and the range will match what you already know.
    Of course, if you don't mind 3.3V logic, there are enough pins on the ESP8266 or ESP32, the same controller can be done bypassing UNO, directly on a board that has WIFI built in.
    Helpful post? Buy me a coffee.

Topic summary

✨ To configure the ESP-01S WiFi module with an Arduino UNO R3 for controlling a central heating cooker, a 5V to 3.3V logic level converter is required, along with a 3.3V power supply for the ESP. The communication between the ESP and Arduino should be established via UART, ensuring both devices operate at the same baud rate. The ESP-01S can initially be used in AT command mode, similar to Bluetooth modules, allowing basic commands for WiFi connectivity. For more advanced functionality, users can upload custom firmware like ESPEasy, which simplifies communication through URL syntax and allows for easy integration with mobile applications developed using platforms like App Inventor. Users are encouraged to explore various software options and configurations to optimize their setup.
Generated by the language model.

FAQ

TL;DR: "As usual, there are many roads to the destination." Use ESP‑01S as a UART‑to‑Wi‑Fi bridge, or flash ESP‑LINK v2.2.3 for virtual COM. Configure AP/STA, open a server, and pass bytes to Arduino at a matched baud. [Elektroda, kaczakat, post #18039800]

Why it matters: This FAQ helps Arduino heating‑controller builders add reliable Wi‑Fi phone control without internet setup hassles.

Quick Facts

What’s the simplest way to make ESP‑01S talk to my Arduino like an HC‑05?

Keep the stock AT firmware. Set station mode, join your Wi‑Fi, and start a TCP server. Data from the client flows over UART to the UNO. “Ready to use … in AT command mode.” How‑To: 1. Set STA mode. 2. Join AP. 3. Start server and test with your phone. [Elektroda, kaczakat, post #18039303]

Do I need code on both Arduino and ESP‑01S?

Yes, if you choose custom firmware on the ESP. You then implement UART parsing on both sides. Match baud rates. “Exactly right. Same baud on both sides.” [Elektroda, Slawek K., post #18038944]

How should I wire ESP‑01S to an Arduino UNO safely?

Use a 5V↔3.3V logic level converter on the UNO TX line. Power ESP‑01S from a clean 3.3 V regulator. Connect RX↔TX and TX↔RX between the modules. [Elektroda, Slawek K., post #18038367]

What is ESP‑LINK and why choose it over AT commands?

ESP‑LINK gives a web UI, a transparent UART bridge, and a virtual COM port over Wi‑Fi. It feels like the UNO is cabled to your PC. You can also perform Arduino uploads over the network through this bridge. [Elektroda, kaczakat, post #18039800]

Should I use TCP or UDP from my Android app (e.g., App Inventor)?

Both are supported. Configure ESP as a TCP or UDP server, then connect by IP and port from your app. Choose based on your app’s needs and test for reliability. [Elektroda, kaczakat, post #18039800]

What is ESPEasy and how does it simplify phone integration?

ESPEasy exposes simple URL‑style endpoints and a virtual COM bridge to the AVR. That makes sending data to and from ATmega trivial. “I also use APP Inventor to write apps for android.” [Elektroda, Slawek K., post #18039991]

Can I upload Arduino UNO sketches over Wi‑Fi via ESP‑01S?

Yes, with ESP‑LINK v2.2.3’s built‑in stk500v1 programmer. It requires wiring the UNO’s ICSP header. Uploading via UART bootloader also works but needs a reset pulse at the right moment. [Elektroda, kaczakat, post #18040001]

How do I program the ESP‑01S in the Arduino IDE?

Install the ESP board definitions, then code it like an UNO. Select the ESP8266 board and upload via a USB‑to‑TTL adapter. “You program in the same way as the Arduino UNO.” [Elektroda, Slawek K., post #18038537]

I only need to send a few bytes (e.g., a=45,34,0,0,1). Will that work?

Yes. With AT firmware, bytes from your network client are forwarded over UART to the UNO. Keep the protocol simple and test with a phone client. [Elektroda, kaczakat, post #18039303]

AT server prints extra status lines. How do I handle the noise?

Expect connection notices, sender IPs, and +IPD headers along with your payload. Filter these in your parser or switch to ESP‑LINK’s transparent bridge. “This can be useful or disruptive.” [Elektroda, kaczakat, post #18039800]

Can it work without a router or internet?

Yes. Run ESP as an AP for direct phone‑to‑ESP links, or as STA on your router. AP range may not beat Bluetooth; a router improves reliability. [Elektroda, kaczakat, post #18040001]

Can I replace the UNO and run the controller directly on ESP8266/ESP32?

Yes. ESP8266/ESP32 have enough I/O for many heating controllers and include Wi‑Fi. Design for 3.3 V logic levels throughout the system. [Elektroda, kaczakat, post #18040001]

What power supply should I plan for the ESP‑01S?

Provide a stable 3.3 V rail. Typical ESP8266 transmit current is about 170 mA at 18.5 dBm, so avoid undersized regulators. ["ESP8266EX Datasheet"]
Generated by the language model.
ADVERTISEMENT