ESP32 pin availability

Here we can discuss about the problem found
Post Reply
Stuart
Posts: 40
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 1 time
Been thanked: 6 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: 142
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 56 times
Been thanked: 75 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: 111
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 41 times
Been thanked: 81 times

Re: ESP32 pin availability

Post by AndyGadget »

I've always found this useful : [External Link Removed for Guests]
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.
cicciocb
Site Admin
Posts: 401
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 90 times
Been thanked: 289 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: 111
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 41 times
Been thanked: 81 times

Re: ESP32 pin availability

Post by AndyGadget »

There's your answer Stuart :D
Stuart
Posts: 40
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 1 time
Been thanked: 6 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: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 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: 12
Joined: Sat Feb 20, 2021 9:36 am
Location: Sindelfingen, Germany
Has thanked: 20 times
Been thanked: 2 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: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 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: 12
Joined: Sat Feb 20, 2021 9:36 am
Location: Sindelfingen, Germany
Has thanked: 20 times
Been thanked: 2 times

Re: ESP32 pin availability

Post by rmsta »

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