Stumped by slow MOSFET rise time - Page 1
Forum section: electronics / beginners

author: int2str
author_rank: Regular Contributor
timestamp: July 21, 2017, 05:52:18 am
content: Mighty EEVBLOG,I have the attached very simple circuit.DIN is a 3.3V signal from an ATmega328p.The MOSFET is a BS270Datasheet ->http://www.mouser.com/ds/2/149/BS270-1006630.pdfI'm using it to control WS2812 LEDs.The problem I'm having is that despite the datasheet showing 10ms turn-on time, on my oscilloscope the nice, square 3.3V wave I'm feeding in get's turned into horrible peaks with seemingly a ~300ns rise time.I'm saying seemingly, because the LEDs actually work. Which has me confusedIdeas?

author: agehall
author_rank: Frequent Contributor
timestamp: July 21, 2017, 06:10:50 am
content: You are looking at the switching times under very specific conditions specified in the datasheet. You are feeding it a GS voltage of 3.3V and the datasheet specifies 10V, so that could be one reason why you are not seeing the expected raise time.

author: Zero999
author_rank: Super Contributor
timestamp: July 21, 2017, 07:59:05 am
content: Try reducing the value of R1 to 1k.

author: danadak
author_rank: Super Contributor
timestamp: July 21, 2017, 11:07:50 am
content: Spec shows turn on from a V source with 25 ohms source Z. Your Atmega outputhas much higher effective Rdson than 25 ohms. Additionally you are driving themiller C at the MOSFET gate as it moves into active region, these all contributeto slowing down turn on & off time. Another contributing factor is Vgs drive available,look at the normalized gate drive vs Rdson curves.http://www.vishay.com/docs/73217/73217.pdfhttps://www.onsemi.com/pub/Collateral/AN1090-D.PDFThe resolution is to use gate drivers.Regards, Dana.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 21, 2017, 01:44:24 pm
content: I don't know what to think.Where in the datasheet does it show 10ms?CMOS pins are typically a few ns. It'll be a lot slower with a MOSFET gate on there loading it down.Are you referring to the drain / output waveform instead?Tim

author: rstofer
author_rank: Super Contributor
timestamp: July 21, 2017, 02:14:25 pm
content: I had been thinking that the 10 ms number should have been 10 ns and the op is measuring 300 ns.In any event, this particular MOSFET doesn't even pretend to be a "logic level" device. There are "logic level MOSFETs" around that might show better switching but the fact is, a 3.3V ATmega uC simply can't drive enough gate current to get over the capacitance that is slowly charging at the gate.Figure 5 in the datasheet shows that at 3.3V Vgsthe device is barely on the curves. Sure, it will switch a hundred milliamps but is won't do it very quickly.That's why they invented gate drivers - a device that can dump AMPS into a gate to get it switching a lot faster.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: July 21, 2017, 02:26:11 pm
content: Max Vgs(th) of 2.5v means that MOSFET is really not suitable for a 3.3v drive, you want at least ~5v drive. Look for a FET with a max Vgs(th)<1.7, or get a gate driver.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 21, 2017, 04:20:18 pm
content: Quote from: suicidaleggroll on July 21, 2017, 02:26:11 pmTo this end, you want low voltage MOSFETs, Vds <= 20V. These have higher specific transconductance than conventional (>= 30V) parts, so they can be used on 3.3V, even 2.5V and 1.8V logic.Offhand, I like RUM001L02T2CL for small switches, but the package may be inconveniently small for prototyping.Tim

author: int2str
author_rank: Regular Contributor
timestamp: July 21, 2017, 08:01:02 pm
content: Quote from: Hero999 on July 21, 2017, 07:59:05 amEven tried shorting R1 - no effect.Quote from: T3sl4co1l on July 21, 2017, 01:44:24 pmAs others have pointed out, yes, NANO seconds (typo).Quote from: suicidaleggroll on July 21, 2017, 02:26:11 pmAwww crap. As you and others pointed out, yes, 3.3V doesn't seem to be on the curve.Sloppy part selection.Thanks everyone!

author: bson
author_rank: Unknown
timestamp: July 22, 2017, 01:14:38 am
content: How many WS2812?The datasheet for that part has no current consumption vs brightness info, so I'd start by measuring current consumption at my desired brightness. Multiply this by the number of LEDs, and that's the drain current the MOSFET needs to handle. A BSS806 might switch fast enough, and has Rds(on) on the order of tens of \$m\Omega\$ so can easily handle 1.5A - as long as you switch it fast enough.By the way, if the WS2812's power on in an off state, then switching speed may not matter.

author: int2str
author_rank: Regular Contributor
timestamp: July 22, 2017, 06:09:50 am
content: The MOSFET is only for the data line, not drawing any current really.

author: bson
author_rank: Unknown
timestamp: July 22, 2017, 07:57:42 am
content: The WS2812 datasheet suggests the data line current consumption is 1uA, so you can probably connect that directly to the I/O pin.

author: Beamin
author_rank: Super Contributor
timestamp: July 22, 2017, 08:41:22 am
content: Quote from: int2str on July 21, 2017, 05:52:18 amPardon my ignorance but how does that circuit work? I could see if it had one led that fed into the mosfet but how is that LED wired and why does it have a pin going to ground and not to the source(top) of the mosfet in the scematic?

author: int2str
author_rank: Regular Contributor
timestamp: July 22, 2017, 06:38:00 pm
content: Quote from: bson on July 22, 2017, 07:57:42 amI/O pin is 3.3V, WS2812 needs 5V in this case.

author: int2str
author_rank: Regular Contributor
timestamp: July 22, 2017, 06:39:43 pm
content: Quote from: Beamin on July 22, 2017, 08:41:22 amLED is not one LED, it a strip of WS2812b LEDs:http://www.seeedstudio.com/document/pdf/WS2812B%20Datasheet.pdf

author: bson
author_rank: Unknown
timestamp: July 22, 2017, 06:56:35 pm
content: It doesn't need 5V, it needs 0.7*Vdd. If you drop the 5V with a diode you get 4.35V and VIHbecomes 4.34*0.7 = 3.04V. A Vddof 4.35V is perfectly within its range of 3.5-5V.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 22, 2017, 08:02:27 pm
content: 74HCT07 or '17 has TTL/LVCMOS compatible inputs and 5V compatible outputs ('07: open drain).Tim

author: int2str
author_rank: Regular Contributor
timestamp: July 23, 2017, 11:02:53 pm
content: Quote from: bson on July 22, 2017, 06:56:35 pmYes, I've seen that trick. But you have to "sacrifice" one LED and it's really no easier than using a MOSFET.

author: David_AVD
author_rank: Super Contributor
timestamp: July 24, 2017, 12:56:19 am
content: The usual way to do the voltage translation for driving pixels from a 3.3V micro is to use a 74ACT541 or similar buffer.The buffer is run from the 5V supply, but has 3.3V compatible inputs.

author: int2str
author_rank: Regular Contributor
timestamp: July 25, 2017, 05:20:29 am
content: Wow, I'm really questioning my life choices right now....Replaced the MOSFET with this one:http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en570658Now I'm not getting any real output at all, just ground+noise.So what's wrong with my part choice now?

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2017, 06:11:07 am
content: More likely incorrect connections.

author: int2str
author_rank: Regular Contributor
timestamp: July 25, 2017, 06:34:45 am
content: Quote from: David_AVD on July 25, 2017, 06:11:07 amI have made a PCB for this. So same connections as with the other MOSFET.Also measured everything. Source is ground, Drain is 5V / output and Gate is 3.3V signal as in the original schematic.

author: int2str
author_rank: Regular Contributor
timestamp: July 25, 2017, 07:48:37 am
content: It's speed once againAt around 90kHz or so the signal breaks down.

author: MK14
author_rank: Super Contributor
timestamp: July 25, 2017, 08:24:37 am
content: Quote from: int2str on July 25, 2017, 07:48:37 amProbably because R1 10K will give a slow rise time, as it takes time to charge the stray (including the Fets contribution) capacitance.Lower R1 to e.g. 1K or use the other suggestions in this thread, such as logic gates. Which should be considerably faster.

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2017, 08:40:20 am
content: If you're still using that 10K pull-up that's definitely an issue. You need to drive the pixels with a lot lower source impedance than that. Even 470R is only around 10mA of +ve drive.

author: Kerr
author_rank: Newbie
timestamp: July 25, 2017, 11:27:39 am
content: as a note that led control says 6v minimum input

author: David_AVD
author_rank: Super Contributor
timestamp: July 25, 2017, 11:44:17 am
content: WS28xx are 5V devices and require a 5V drive signal.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: July 25, 2017, 03:39:14 pm
content: As far as levels are concerned you only need to talk to the first LED....There is a hack...http://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/or for the level shifter... 2N7000? BSS138?Oh.... and what danadak said.

author: int2str
author_rank: Regular Contributor
timestamp: July 25, 2017, 10:13:09 pm
content: Thanks David and MK14!Spot on.Changed the pull-up to 220Ohm and it does a nice square(-ish) wave at 800kHz.Works great now.