Does any one know - can I use Arduino shields with ESP32?
This is possible using an ESP32 that has Arduino headers, like the ones found on the ESPDuino-32. This project uses the Duino and an ST shield (with theTSYS02D sensor) to get you up and running. I've made a building monitor project using the ESPDuino-32 and an ST shield using this set up before and it worked out great (screen shot below).
If the board doesn't have the headers you can link via jumper wires as mentioned above but that kind of defeats the purposes of using an Arduino shield in the first place. This does require you clip a pin to avoid power feedback on the ST board (image attached)
The short answer is yes, you can likely use the shields. But, the following will apply:
- This is obvious, but you won't be able to just plug it in to an ESP32 like a shield. You'll have to use another way of making the connections. Jumper wires should be fine for prototyping.
- If you plan on using the Arduino software libraries instead of coding from scratch, they will need modifications to work with the ESP32. Depending on the complexity, it may be easier to start with ESP32 specific code designed for similar hardware, and adapt it to the shield.
- The ESP32 is 3.3V and some Arduinos are 5V. You will need to keep this in mind when making your connections.
- It may be easier to just use bare hardware (sensors, relays, or whatever) than to try and retrofit an Arduino shield to do what you need. That will depend on the individual shield, and if you are just trying to use something you happen to have on hand.