logo elektroda
logo elektroda
X
logo elektroda

ESP32 control using Raspberry Pi Pico with touchscreen display - sensor management

Michal8883 792 14
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20244497
    Michal8883
    Level 5  
    Hello I have an ESP32 which will do the brain of about 10 simple sensors connected by cable. And next to it will be a touchscreen display connected to the Pi PicoW. Now the question is if it is possible to use the pi picoW with the touchscreen to control the esp ie turn the sensors on or off or check if they are active? Is it better to do everything on the same board two pi picoW instead of esp32 and pi picoW.
  • ADVERTISEMENT
  • #2 20245375
    khoam
    Level 42  
    Michal8883 wrote:
    Would it be better to do everything on the same board two pi picoW instead of esp32 and pi picoW.

    Preferably on one ESP32 ;) .
  • ADVERTISEMENT
  • #3 20245378
    Michal8883
    Level 5  
    Will I have enough pins for 10 sensors and a touchscreen?
  • #4 20245381
    khoam
    Level 42  
    I believe so. You would have to write specifically what touchscreen and sensors you are referring to.
  • ADVERTISEMENT
  • #6 20245828
    khoam
    Level 42  
    This display is controlled from SPI. You can use the same library TFT_espi to support it, which is suggested for the Pico in the link provided. The display itself is specified as "dedicated" to the RPI, but that's more of a marketing ploy to raise its price ;) Of course it's probably easier to do this with the Pico - it's quite well documented.
    I don't see any obstacle to being able to control this display, reed switch and PIR from the ESP32, as long as you need WiFi.
  • ADVERTISEMENT
  • #7 20246135
    Michal8883
    Level 5  
    Esp= A tangle of cables and this pi pico elegantly connects just right, for this I wanted to use a set of pico + screen esp brain operation
  • #8 20246301
    khoam
    Level 42  
    Communication between ESP32 and Pico is most simply (in software terms) provided over SPI. Unfortunately, once this display is connected to the Pico, you will need to "share" any of the SPI channels on the Pico for transmission with the ESP32.
  • #9 20246369
    Michal8883
    Level 5  
    And it would be possible over wifi
  • #10 20246422
    khoam
    Level 42  
    It can be done. I think then the ESP32 needs to be set up in AP+STA mode. Then the Pico W can connect directly to the ESP, without going through an external AP router. There would be normal connectivity from the home WiFi network to the ESP.
    This kind of connection requires careful fault diagnostics in the code for ESP and Pico (in case of breakage or errors in WiFi transmission).
  • #11 20246713
    Michal8883
    Level 5  
    Either combine the two pico's together and give up the esp or it is not worth giving up the esp.
  • #12 20246878
    khoam
    Level 42  
    A lot depends on which SDK is/will be more convenient for you. Arduino Core for Pico W does not support AP+STA mode ( Link ).
    A fairly good comparison of the RP2040 and ESP32 chips is here: Link .
  • #13 20246896
    Michal8883
    Level 5  
    No comparison esp better and crushes pi pico.
  • #14 20254109
    Michal8883
    Level 5  
    And what would be the best combination of esp and pico or pico and pico
  • #15 21495491
    mitagimi75
    Level 3  
    You can use a Raspberry Pi Pico W with a touchscreen to control the ESP32, e.g. via Wi-Fi (MQTT, HTTP) or UART. The ESP32 is great for sensors and the Pico W can act as a user interface. If your project is simple, you can use two Pico W, but the ESP32 offers more processing power and better support for wireless communication.

Topic summary

The discussion addresses controlling an ESP32 managing about 10 simple sensors (reed switches and PIR sensors) via a Raspberry Pi Pico W connected to a touchscreen display. The touchscreen options considered include a 2.8" or 3.5" display designed for the Raspberry Pi Pico, typically interfaced over SPI using libraries like TFT_espi. It is feasible to use the Pico W with the touchscreen to control the ESP32 sensors, either through wired SPI communication—though SPI bus sharing between the Pico and ESP32 can be complex—or via Wi-Fi using protocols such as MQTT or HTTP. Setting the ESP32 in AP+STA mode allows the Pico W to connect directly without an external router, but this requires robust error handling in both devices' firmware. The ESP32 offers superior processing power and wireless support compared to the Pico W, which has limitations such as lack of AP+STA mode support in Arduino Core SDK. The choice between using a single ESP32 or combining ESP32 and Pico W depends on pin availability, SDK convenience, and project complexity. For simpler projects, two Pico W boards could suffice, but the ESP32 generally outperforms the Pico W in sensor management and wireless capabilities.
Summary generated by the language model.
ADVERTISEMENT