Page 1 of 1

Reed switch for presence detection

Posted: Mon Sep 01, 2025 6:44 pm
by Occam Blazer
I am creating a game board using a S3-WROOM. When a player places a piece on the board the ESP should detect it and begin sending it some PWM to drive a couple of LEDs. Is this a reasonable circuit or do I need the reed switch on a separate net? TIA
Screenshot From 2025-09-01 13-34-53.png
Screenshot From 2025-09-01 13-34-53.png (27.06 KiB) Viewed 903 times

Re: Reed switch for presence detection

Posted: Tue Sep 02, 2025 1:09 am
by Sprite
I am creating a game board using a S3-WROOM. When a player places a piece on the board the ESP should detect it and begin sending it some PWM to drive a couple of LEDs. Is this a reasonable circuit or do I need the reed switch on a separate net? TIA

Screenshot From 2025-09-01 13-34-53.png
Should work, but A. keep in mind the max current through the reed switch you're using, and B. you may need a pulldown on the switched 5V as well as the LEDs might not pull the 5V line down by themselves. Also note that technically the ESP32 GPIOs aren't 5V compatible, although I doubt it'll pose an issue in your case; you could change R1 for a divider network that makes it into 3V3 if you're worried about that.

Re: Reed switch for presence detection

Posted: Tue Sep 02, 2025 2:13 am
by Occam Blazer
I am creating a game board using a S3-WROOM. When a player places a piece on the board the ESP should detect it and begin sending it some PWM to drive a couple of LEDs. Is this a reasonable circuit or do I need the reed switch on a separate net? TIA

Screenshot From 2025-09-01 13-34-53.png
Should work, but A. keep in mind the max current through the reed switch you're using, and B. you may need a pulldown on the switched 5V as well as the LEDs might not pull the 5V line down by themselves. Also note that technically the ESP32 GPIOs aren't 5V compatible, although I doubt it'll pose an issue in your case; you could change R1 for a divider network that makes it into 3V3 if you're worried about that.
Thanks for the sanity check. The reed switch I have is 1A which might be undersized for 60 leds even though they'll be on about 25% duty. I'll source a more appropriate switch when I start real testing.

And good catch with the gpio voltage.

Re: Reed switch for presence detection

Posted: Tue Sep 02, 2025 8:23 am
by MicroController
Check what the LEDs' DIN pin does when the LED has no power. May be that it puts a load on the DIN signal effectively pulling it low or to some intermediate voltage level.