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 1428 12
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18038310
    patryk-84a
    Level 28  
    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  
    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
  • #3 18038444
    patryk-84a
    Level 28  
    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?
  • ADVERTISEMENT
  • Helpful post
    #4 18038537
    Slawek K.
    Level 35  
    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  
    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?
  • #6 18038944
    Slawek K.
    Level 35  
    Exactly right. Same baud on both sides.

    Greetings
  • ADVERTISEMENT
  • #7 18039013
    patryk-84a
    Level 28  
    Ok. I will order a converter, connect everything and if I have problems finding resources I will ask further. Greetings
  • Helpful post
    #8 18039303
    kaczakat
    Level 34  
    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.
  • ADVERTISEMENT
  • #9 18039665
    patryk-84a
    Level 28  
    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  
    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  
    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  
    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  
    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.
Summary generated by the language model.
ADVERTISEMENT