So i have raspberry pi in my garage, where i want push-button connected to the exiting raspberry pi. (The push-button will be connected GND & GPIO. (I think it’s called pull up resistor) because all my vcc is used.)
When the button is pressed from the garage, I want to alert the people in the kitchen with the buzzer & led .
I think an esp32 board with a buzzer and 10mm led will be reasonable.(for the alerting part list)
I want the raspberry pi to communicate with esp32 via wifi when the button is pressed.
The simplest solution seems to be to run a long cable to the garage so you can eliminate the ESP from the system altogether and just use the Pi’s GPIO.
This is certainly possible but the big decision will be what sort of communications protocol you use to send the data to the Pi.
Also, do you need the information to be sent bi-directionally? Does the ESP32 always send and the Pi always receives, or do you need to send data both ways?
I haven’t used the ESP32 much myself but a few approaches spring to mind.
ESP-Now is supported on the ESP32, but we may need to confirm if it’s compatible with the Pi as well.
An MQTT setup would allow both the ESP32 and the Pi to post messages via a broker and subscribe to select updates.
Or you could use HTTP to do the data transfer.
That speaker should be fine to be driven by the Pi but you will need to wire it into the GPIO without using the plug it comes with.
There are heaps of ESP32 dev boards on our site, the choice is mostly based on which ESP32 chipset version you want. Once you know what extra features you may need (LiPo battery support) then you can choose the ESP32 dev board that includes the chipset you want with only the features you will use to save costs.
An ESP8266 would be cheaper than an ESP32.
You need Wifi available at your garage.
How are you powering the ESP?
Batteries will not last long without understanding ESP deep sleep and how to wake it up.
I’d look through the Random Nerd Tutorials to understand the choices between HTTP and MQTT.
And you can get our latest projects and tips straight away by following us on: