Reed switch for presence detection

Occam Blazer
Posts: 4
Joined: Mon Sep 01, 2025 4:21 pm

Reed switch for presence detection

Postby Occam Blazer » Mon Sep 01, 2025 6:44 pm

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 899 times

Sprite
Espressif staff
Espressif staff
Posts: 10617
Joined: Thu Nov 26, 2015 4:08 am

Re: Reed switch for presence detection

Postby Sprite » Tue Sep 02, 2025 1:09 am

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.

Occam Blazer
Posts: 4
Joined: Mon Sep 01, 2025 4:21 pm

Re: Reed switch for presence detection

Postby Occam Blazer » Tue Sep 02, 2025 2:13 am

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.

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Reed switch for presence detection

Postby MicroController » Tue Sep 02, 2025 8:23 am

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.

Who is online

Users browsing this forum: Perplexity-User, PetalBot and 3 guests