Circuit to pass PWM

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

Circuit to pass PWM

Postby Occam Blazer » Tue Sep 23, 2025 11:31 pm

Hey y’all. I am designing a game board with some LED pieces. When a player places a piece on the board the ESP32 should sense its presence and begin sending PWM to it. If no piece is present the PWM signal should pass to the next space. Here’s my circuit idea.

Image

Pres S1 (presence sensor) is wired to a multiplexer and a logic lever shifter, then to the GPIO.

PWM1 comes from the microcontroller.

PWM2 routes to the next board space.

The game piece has a magnet to trigger the SPDT reed switch.

After assembling on a breadboard, dowsntream pieces do not receive PWM. It’s possible that the PWM signal flows through both the transistor’s emitter and the LED data out. (Gonna borrow an oscilloscope to verify.)

Are there any glaring mistakes with this idea? Is there a better way to do it?

tia

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

Re: Circuit to pass PWM

Postby Sprite » Wed Sep 24, 2025 9:02 am

You have most of what's called an emittor follower there. In an emittor follower, the output is the input minus 0.7V (which probably is fine here unless you cascade them). However, you're missing an inportant bit: the transistor can only pull Dout high, not low. You need a pulldown resistor to do this (so between Dout and GND). The value of that depends on the transistor, timings etc, but you can start by 1K, see if the output signal is somewhat sane, and adjust from there.

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

Re: Circuit to pass PWM

Postby Occam Blazer » Wed Sep 24, 2025 5:13 pm

You need a pulldown resistor to do this (so between Dout and GND).
Thank you for the explanation. Something like this?
Screenshot From 2025-09-24 12-11-56.png
Screenshot From 2025-09-24 12-11-56.png (47.39 KiB) Viewed 1086 times

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

Re: Circuit to pass PWM

Postby MicroController » Wed Sep 24, 2025 9:47 pm

Are you sure you can externally drive the DOUT pin (without a resistor)?

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests