So I know IO34 & IO35 are read only on the ESP32. However, when I try to attach a reed switch to the pins, I'm unable to read anything but a 0. Using them as interrupts doesn't work either. Moving the reed switch to pins IO32 & IO33 works fine. You can see the 10k resistor attached to the reed switch in the schematic.
Any idea what I need to do to get those pins to work?
I'm not doing anything more than the following to read them:
Serial.printf("REED_NC: %d\n", digitalRead(REED_NC));
Serial.printf("REED_NO: %d\n", digitalRead(REED_NO));
IO34 & IO35 with Reed Switch & ESP32
IO34 & IO35 with Reed Switch & ESP32
- Attachments
-
- reed.png (3.04 KiB) Viewed 7539 times
Re: IO34 & IO35 with Reed Switch & ESP32
From your schematic, this is not how you want to wire up your pull up resistor.
Doing it this way can cause the pins to pick up stray interference because they are floating.
Also, why use 2 IO pins when you can use one to do the same thing.
Tie REED_NC to +3.3v, and tie REED_NO to GND. From the Com. side of the reed (the side you have going to 10k then to +3.3v) take that to your input pin.
Doing it this way can cause the pins to pick up stray interference because they are floating.
Also, why use 2 IO pins when you can use one to do the same thing.
Tie REED_NC to +3.3v, and tie REED_NO to GND. From the Com. side of the reed (the side you have going to 10k then to +3.3v) take that to your input pin.
Re: IO34 & IO35 with Reed Switch & ESP32
Good suggestion, but considering that the reed switch will always be positioned on N.O. OR N.C. pin, wiring just one pin is sufficient to know which.
Re: IO34 & IO35 with Reed Switch & ESP32
If you wire just one pin you will need to add a pull-up / pull-down resistor to the circuit. Otherwise there will be no way to detect the changed state.TomWS1 wrote:Good suggestion, but considering that the reed switch will always be positioned on N.O. OR N.C. pin, wiring just one pin is sufficient to know which.
Re: IO34 & IO35 with Reed Switch & ESP32
The pins are tied to deepsleep wakeups. I need the ESP32 to wake up when either state is selected. So, I'm not just monitoring the state, I'm using it for an interrupt.
Who is online
Users browsing this forum: Google [Bot] and 37 guests