LED & Fan PWM driver with bonus weird scope trace - Page 1
Forum section: electronics / projects

author: UpLateGeek
author_rank: Contributor
timestamp: July 07, 2022, 01:49:36 pm
content: So I've designed this three channel LED and fan PWM driver circuit, and it works great but while I was tweaking the values of the pull-up and gate resistors, I noticed a weird thing on the scope trace.This is probing the output of one channel:As you can see, there's this bit sticking up at the top, which is the same width as the PWM signal on the other channel. Looks pretty weird to me. The signal going into the gate looks fine, so not really sure what would be causing it.Anyway, here's the ski-matic if anyone's curious or whatever.Feel free to point out any glaring mistakes. For some reason it's licensed CC BY-SA, so apparently that means you're required to point at me and laugh if you find a good one.EDIT: Not sure what went wrong with inserting the attachments, but you're smart, you know what's going on.

author: moffy
author_rank: Super Contributor
timestamp: July 08, 2022, 06:40:47 am
content: Looks a bit like you are overloading your 12v supply.

author: UpLateGeek
author_rank: Contributor
timestamp: July 08, 2022, 07:55:01 am
content: Quote from: moffy on July 08, 2022, 06:40:47 amVCC is at 24V, and we're probing at pin 2 of the output, which is the drain of the MOSFET. If I probe pin 1 VCC, it's rock solid at 24V.

author: moffy
author_rank: Super Contributor
timestamp: July 08, 2022, 08:13:34 am
content: What is your load? Why doesn't pin2 go to 24V when the MOSFET is off?

author: UpLateGeek
author_rank: Contributor
timestamp: July 08, 2022, 09:47:15 am
content: Quote from: moffy on July 08, 2022, 08:13:34 amIt's a 24V LED strip, so I guess the drop across the LEDs is 12V.

author: Zero999
author_rank: Super Contributor
timestamp: July 08, 2022, 09:57:57 am
content: If it's from another channel, then it's probably due to capacitive coupling.Why not use a comparator with a push-pull output, then you can do away with all those pull-up resistors as well as speed up the turn-on time?

author: moffy
author_rank: Super Contributor
timestamp: July 08, 2022, 10:34:48 am
content: Quote from: UpLateGeek on July 08, 2022, 09:47:15 amAs Zero999 says "... it's probably due to capacitive coupling."

author: UpLateGeek
author_rank: Contributor
timestamp: July 09, 2022, 04:11:54 am
content: Quote from: Zero999 on July 08, 2022, 09:57:57 amThat's a good point, the traces would be pretty close and parallel for a long distance on the LED strip.Thanks for the push-pull comparator suggestion, it didn't occur to me that these were different to an op amp, so I'll definitely look into them.

author: Zero999
author_rank: Super Contributor
timestamp: July 09, 2022, 07:39:03 am
content: Quote from: UpLateGeek on July 09, 2022, 04:11:54 amAt the speed you're using it at, an op-amp will work. U3A is an op-amp being used as a comparator. You could use TLC272 for U4, or two TLC274 for all op-amps/comparators in the circuit, as it would make the parts list easier.

author: UpLateGeek
author_rank: Contributor
timestamp: July 10, 2022, 04:49:43 am
content: Quote from: Zero999 on July 09, 2022, 07:39:03 amI tried using an op amp when I originally prototyped it on perfboard and it could only manage about 8KHz, switching to a comparator improved it to about 12KHz. Granted I was using pretty mediocre parts (NE5532 and LM393 were all I had to hand at the time), and perfboard isn't the best for circuits that are affected by parasitic capacitance.I'll try hacking in a TLC272. Although the advantage of using a comparator was that it's easy to limit the output to 5V with a simple pull-up for the fan channel, since a 12V signal would damage the fan.

author: UpLateGeek
author_rank: Contributor
timestamp: July 12, 2022, 12:32:54 pm
content: With tremendous effort I managed to hack in the op amp, and it verks!Performance is almost identical to the comparator; rise time is about 510ns, which is about the same as the comparator.Still not sure how I can handle the 5V PWM output for the fan.