ESP32 pin availability

Here we can discuss about the problem found
Post Reply
Stuart
Posts: 126
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

ESP32 pin availability

Post by Stuart »

Are there any pin restrictions on ESP32 other than those specified by the board manufacturers? I ask as I have moved some temperature sensors from multi-drop on pin 2 to different pins (32-35) and they don't seem to work. So I need to find pins that do work, or discover if I have done something silly. I'm using an ESP32-WROOM-32D.

thanks
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

Re: ESP32 pin availability

Post by PeterN »

Hi Stuart,
There are some helpful hints in the online help:
[Local Link Removed for Guests]

Especially GPIO 34 to 39 are input only, but as I understand you do need inputs(?)
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 120 times
Been thanked: 132 times

Re: ESP32 pin availability

Post by AndyGadget »

I've always found this useful : https://randomnerdtutorials.com/esp32-p ... nce-gpios/
32 to 35 shouldn't be a problem, although I have had issues using the higher numbers on a different device where it should have worked. I didn't investigate at the time, just changed pins.

As Peter implies, 34 and 35 may be a problem depending on what sensors you're using. If they're anything which requires bi-directional data you'll have problems.
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: ESP32 pin availability

Post by cicciocb »

Hi Andy,
the pin32 and the pin33 are associated with the TFT so cannot be used except if you select "NO TFT" in the config page.
The pins 34 to 39 are input only and in most of the cases will not work with the sensors (for example the DS18B20) as the pin is used as an I/O.
image.png
You do not have the required permissions to view the files attached to this post.
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 120 times
Been thanked: 132 times

Re: ESP32 pin availability

Post by AndyGadget »

There's your answer Stuart :D
Stuart
Posts: 126
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

Re: ESP32 pin availability

Post by Stuart »

Thanks guys, it's a bit of a minefield. Especially where pins are described by manufacturers as GPIOs when they are actually GPIs. Still hunting for some usable pins! Quite a few already in use this end as well as reserved. Unfortunately my cable lengths are too long for multi-dropping more than a couple of DB18S20s.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: ESP32 pin availability

Post by Electroguard »

Stuart, an alternative possibility could be to use remote bluetooth temp & humidity sensors which don't need connecting by local pins.
Bluetooth range should exceed the dallas 1-wire sensors anyway, but is easy to use additional more distant esp32's sending back data from many other bluetooth sensors much further away.

EDIT:
The sensors can be reflashed with custom code so they broadcast their info to any nearby BLE listening devices without pairing.
My Thermostatic script already monitors 3 sensors, but I will be adding a couple more as Inside and Outside backup sensors.
sensors$ = "ATC_9AFEA8.Data=Inside ATC_BEF7AB.Data=Outside ATC_BACFA8=Freezer" 'list of ble sensor ID=name pairs
rmsta
Posts: 32
Joined: Sat Feb 20, 2021 9:36 am
Location: Sindelfingen, Germany
Has thanked: 134 times
Been thanked: 9 times

Re: ESP32 pin availability

Post by rmsta »

Hello,
"to use remote bluetooth temp & humidity sensors" ... this is highly intersting.
I would appreciate any hint, which sensors are suitable for this, being tired wiring DS18B20...
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: ESP32 pin availability

Post by Electroguard »

Hi, do a search on eg: Aliexpress for XIAOMI Mijia Bluetooth Thermometer.
I just call them a 'Gizmo' cos I don't know how to pronounce XIAOMI or Mijia

Check the following thread from CiccioCB and the subsequent replies...
[Local Link Removed for Guests]

Also see one of his BLE examples in the ESP32 Online Help which is actually for reading these sensors - his original article was using an Epaper device, whereas I am using TFT touchscreen, but the received temp and humidity and battery % could be displayed on anything (they also transmit an incrementing count).

They cost about a fiver each, which is not bad considering they are completely self-contained in a case with battery and LCD display.

The original proprietary firmware encrypts the data, and the senders must be paired with the receiving device... but custom firmware is available which causes them to broadcast unencrypted data to any and all BLE receivers within range.

If a sender stops sending for any reason it is easy to swap it out and change the script to the new senders ID... or for the sake of a fiver a spare backup could already be in-situ for the script to automatically switch over to if/when the primary sender fails.
rmsta
Posts: 32
Joined: Sat Feb 20, 2021 9:36 am
Location: Sindelfingen, Germany
Has thanked: 134 times
Been thanked: 9 times

Re: ESP32 pin availability

Post by rmsta »

This looks really very promising.
Thanks a lot for the hint !
Post Reply