Page 1 of 1

Circuit to pass PWM

Posted: Tue Sep 23, 2025 11:31 pm
by Occam Blazer
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

Re: Circuit to pass PWM

Posted: Wed Sep 24, 2025 9:02 am
by Sprite
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.

Re: Circuit to pass PWM

Posted: Wed Sep 24, 2025 5:13 pm
by Occam Blazer
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 1091 times

Re: Circuit to pass PWM

Posted: Wed Sep 24, 2025 9:47 pm
by MicroController
Are you sure you can externally drive the DOUT pin (without a resistor)?