Author Topic: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!  (Read 7154 times)

bats

  • Newbie
  • *
  • Posts: 5
MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« on: June 25, 2013, 10:22:14 am »
Be gentle, I'm new here... and I've only recently picked up the soldering iron for the first time since Bush was in office (no, the first one) - so while I'm not entirely clueless (after all, I did resist the urge to lick the terminals on those big pretty caps in the PSU), it's pretty safe to pretend I am.



Short version: What's wrong with this schematic? :p

Long version [deep breath]:

So...

I've got a 5m strip of 5630 (white) LEDs, and I'm trying to use a digi + MOSFET shield (jumpered to use P4) as a PWM dimmer, powered off the +12V of an old ATX PSU. The idea (at least for the first stage of the project - eventually I'm looking at tying it into a Chumby for touch-screen and/or network control) was simply to use a momentary switch on P2 (or P3) to incrementally cycle through successively higher duty cycles (and then loop back to zero), with an indicator LED on P1 showing the same levels. I'm attaching a rough (sorry, first time with Eagle & sloppy as hell) schematic - everything shown on the MOSFET shield is (aside from the jumper) stock, with my mess outside.

That much went pretty smoothly (mostly) and, after some testing and recklessly hacking assorted holes in the chassis, I happily boxed it all back up again... only to find that the LED strip would only/always run at full power - although the indicator shows that the 'spark is still behaving itself nicely.

After pulling everything apart again, with much rending of hair and gnashing of teeth, it looks like the point where things all fell apart was on screwing the MOSFET's heatsink (and ground) to the ATX chassis (and other ground).

I'm trying to power both the digispark and the LED strip both off the ATX 12V line (this seemed like a good idea at the beginning, when I was looking at having the digispark in a separate enclosure - rather than mounted inside the PSU - and wanted to minimize the number of wires I hard to run between them), so this ends up tying together the LED ground (MOSFET shield OUT) with the digi's GND pin. Obviously this is a problem - but I'm at something of a loss figuring out how to resolve it.


I thought about reworking the circuit to drive the digi off the +5V or +5VSB line instead (actually I've been thinking about switching to +5VSB anyhow), but, still sharing the same ground, would that even make a difference? Cutting the trace to ground on the ATX PCB would solve that problem, but, err, sounds rather like a Bad Idea™- it also seemed to have the interesting side effect of making the wire to P2 (but, oddly, not P3) touch sensitive, even through the insulation (tangentially, I'd love an explanation for that).

So is there a reasonable electronic way out of this, or do I need to resort to something like mounting it on a separate (isolated) heatsink with a USB extension to the outside?



-Bats

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #1 on: June 25, 2013, 11:03:44 am »
You should be sharing a ground between them - and you are the GND on the MOSFET shield attaches to the main ground on the Digispark - for good measure you should attach the PSU ground to the Digispark itself as well.


Where the circuit goes wrong is that the Drain (OUT) of the MOSFET is also being attached to ground - effectively removing the MOSFET from the circuit and powering the LED strip permanently.


You can power the DIgispark from the PSU as you are now - but whether you do or not - you need to isolate the heatsink attached to the MOSFET - you can't attach it to a grounded case. It would be nice if the MOSFET was made so it could be, but they are sinking the heat out the drain to the case - so it can't.


Always remember if you are powering something from a supply you must have a common ground with that supply - forgetting that can have some pretty crazy consequences - I recently forgot to connect my common ground on a circuit that was running from USB power and a 5v wall wart - the result was the destruction of everything connected (a Digispark and an Arduino and the wall wart) and the wall wart allowing 120v wall power into my circuit with a huge arc - glad I wasn't touching it! I'd never start cutting ground on a PSU, they share a common ground across all voltages on the PSU.


Hope that helps!

bats

  • Newbie
  • *
  • Posts: 5
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #2 on: June 25, 2013, 01:05:16 pm »
You should be sharing a ground between them - and you are the GND on the MOSFET shield attaches to the main ground on the Digispark - for good measure you should attach the PSU ground to the Digispark itself as well.
So you're saying I should run another line from the PSU ground directly to the Digispark ground, in addition to the one from the PSU ground to the MOSFET shield ground (which already ties to the digiground)? I think you lost me... is there a reason I'm missing? Or did I just completely misunderstand your suggestion?


Where the circuit goes wrong is that the Drain (OUT) of the MOSFET is also being attached to ground - effectively removing the MOSFET from the circuit and powering the LED strip permanently.
Ok, so at least I got that much right.

You can power the DIgispark from the PSU as you are now - but whether you do or not - you need to isolate the heatsink attached to the MOSFET - you can't attach it to a grounded case. It would be nice if the MOSFET was made so it could be, but they are sinking the heat out the drain to the case - so it can't.
Ugh. That's about what I was afraid of. That nixes piggybacking it onto any of the existing heatsinks in the PSU, too... and makes it tricky to mount a separate heatsink inside, unless I go the epoxy route. Need to figure out a new way to mount the USB connector, too...


Ah well... at least now I know I have to redesign it, instead of constantly worrying that there was a simple & sensible option I was overlooking.

Always remember if you are powering something from a supply you must have a common ground with that supply - forgetting that can have some pretty crazy consequences
I think that may be part of what led to my oddly sensitive wire issue... It hadn't occurred to me when I was testing that, while the ground pin of the power cord went to the chassis, with the PCB removed the actual PSU ground was just floating. In retrospect, it's a little disconcerting.


- I recently forgot to connect my common ground on a circuit that was running from USB power and a 5v wall wart - the result was the destruction of everything connected (a Digispark and an Arduino and the wall wart) and the wall wart allowing 120v wall power into my circuit with a huge arc - glad I wasn't touching it!
This is why I'm a lot more comfortable trying this with the Digispark than the Arduino - much cheaper to keep a few spares kicking around. The fingers & hearts... those cost a little more to replace. (needless to say, the DigiX isn't going to be allowed to partake in such reckless pursuits)


I'd never start cutting ground on a PSU, they share a common ground across all voltages on the PSU.
Err, yeah. A 450W Bad Idea™.




Actually, one other (only vaguely related) question... When I was originally breadboarding this (using an Arduino, bench supply, and a circuit nearly identical to the MOSFET shield, but with a TIP120 transistor) I had no trouble measuring the frequency and duty cycle coming off the TIP120 with my DMM (an early model Fluke 87), but on the assembled version, it croaks (00.00Hz & OL, respectively) when trying to make the same measurement off the MOSFET. I'd actually been convinced that I I'd gotten something wrong, until I went ahead and tested it with the strip. Does this have something to do with the difference between the MOSFET and the transistor, or does the lack of a crystal throw off the timing enough to confuse the DMM? Obviously this isn't critical (or entirely relevant), but I've been curious about what causes it.




Thanks for all the help... even if it's not the nice easy answer I wanted to hear.
-Bats

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #3 on: June 25, 2013, 08:21:28 pm »
The MOSFET ground should be sufficient - since it is connected to the Digispark ground - I'm sure I was over-engineering it in recommending that they both be tied together, now that I think about it I don't see a real advantage to it.


I don't see an issue with the case of the USB connector touching the power supply - since the Digispark shares a ground with the PSU. But yes the MOSFET will need an isolated heatsink.


On the DMM - no idea - I can read it with mine just fine (been awhile but I'm sure I did when I designed it) - it certainly shouldn't be the timing I look at signals from the Digispark all the time (Rigol DS1102E)


bats

  • Newbie
  • *
  • Posts: 5
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #4 on: June 26, 2013, 12:42:46 am »
The MOSFET ground should be sufficient - since it is connected to the Digispark ground - I'm sure I was over-engineering it in recommending that they both be tied together, now that I think about it I don't see a real advantage to it.
Oh, good... So I'm not losing my mind or about to see fireworks a week early.

I don't see an issue with the case of the USB connector touching the power supply - since the Digispark shares a ground with the PSU. But yes the MOSFET will need an isolated heatsink.
It's not the electronics of the USB connector I was worried about... It's the mechanics - specifically the fact that the MOSFET's heatsink side faces out over the same side as the connector. Earlier I'd cut a hole in the chassis so that the connector would protrude when the MOSFET was bolted to the inside, but putting any thickness of heatsink in there (plus insulation) pushes the plug too far inside to reasonably connect to it. So instead I'm thinking I'll run an extension from a plug at the hole (or maybe just on a cable, since I don't think I've got any panel mount USB connectors handy) in to wherever the Digispark gets mounted internally. It's not as elegant, but it could actually end up easier to connect to.

On the DMM - no idea - I can read it with mine just fine (been awhile but I'm sure I did when I designed it) - it certainly shouldn't be the timing I look at signals from the Digispark all the time (Rigol DS1102E)
I still need to pick up a proper scope - all I have is a Navy-issue Jetronic OS8C/U circa '54 that I've never felt entirely comfortable (or safe) using - when it actually powers up at all... But the signal coming out of the Digispark is just fine (I'm not sure why that didn't shoot down the crystal theory from the beginning), it's only coming off the MOSFET that I can't see it - which was why I'd wondered if it was the TIP120 that made a difference in the other circuit.


-Bats

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #5 on: June 26, 2013, 12:57:07 am »
An extension cable likely would be easier for the USB -  but  you could also bend the MOSFET so it is heatsink tab up and attach a heat sink - depending on the size of the heatsink you should be able to isolate it still.

bats

  • Newbie
  • *
  • Posts: 5
Re: MOSFET Shield + LED Strip + ATX PSU = Agh! Halp!
« Reply #6 on: June 26, 2013, 01:12:33 pm »
An extension cable likely would be easier for the USB -  but  you could also bend the MOSFET so it is heatsink tab up and attach a heat sink - depending on the size of the heatsink you should be able to isolate it still.
Wait, bending the leads? You, sir, are a genius!

(or at least you have a talent for the obvious that I seem to lack)

I knew there had to be a reason I didn't trim the extra length off the MOSFET leads... With a bit of a zigzag, I may even be able to use the original mounting holes after all.

Thank you!

-Bats, the less-than-brilliant