# I'm building a 3.3 to 5V level converter with a MOSFET but can't reach 800KHz

I've built a level converter for a digital PWM signal that runs at 800KHz. The circuit goes like this:

*I'm using a BS170 transistor instead

The problem is the signal gets distorted at around 10KHz, I think the transistor is supposed to handle the bandwidth. How can I raise the frequency limit?

• Just to make sure you know. This is a bidirectional level shifter. If you don't need it to be bi-directional, there may be a better way to do this. The reason I mention it is that I don't normally think of PWM signals as being bidirectional. – mkeith Nov 9 '14 at 20:21
• Have you tried using stronger pull-up resistors? 1 or 2K might make much faster transitions.. – KyranF Nov 9 '14 at 20:43
• You're right, I don't need it to be bidirectional. The reason I'm using that circuit is that it experimentally gave a better frequency response than simple inverter I tested. – privera Nov 9 '14 at 20:43
• @KyranF haven't tried but it makes sense. I'll add that to the list. – privera Nov 9 '14 at 20:45
• TI p/n SN74AHCT1G125 requires VCC to be 5V, but it is guaranteed to be high with only 2V at the input. This would be perfect for unidirectional level shifting from 3.3V CMOS to 5V CMOS. It's a single-gate buffer. – mkeith Nov 9 '14 at 21:51

Is the distortion on the rising edge? Pull-up of Q1 $V_{\text{ds}}$ through R2 is a limiter for bandwidth. At close to $V_{\text{ds}}$=0V, BS170 has $C_{\text{ds}}$~40pF and $C_{\text{gd}}$~20pF. So, time constant for R2($C_{\text{ds}}$+$C_{\text{gd}}$) ~ 4usec. After the rise of GPIO has played out, the last 2V to 2.5V of rise will follow that 4usec time constant, which makes the large signal bandwidth less than 100kHz. Other capacitance in the circuit will make things worse. Lowering R2 to 1kOhm would help get the bandwidth close to 800kHz.

Should also point out that $V_{\text{th}}$ of the BS170 can be as high as 3V, so there could be units that won't properly turn on. A lower voltage part with lower $V_{\text{th}}$ and smaller die size, to reduce part capacitance would be a better choice.

• Exactly, the distortion is on the rising edge. I hadn't noticed the 3V Vth, thanks for that. I'll also try lowering R2 and get back with results. Thank you – privera Nov 10 '14 at 0:41
• I can confirm that with R2=1kOm the BS170-based circuit works for ESP8266 (WeMos D1 mini) and WS2812B LED (about 100 LEDs). Linking also similar answer. – dma_k Oct 8 '19 at 8:13

Put a capacitor from source to drain. Start small (say, 22pF) and observe the effect. Try different values. Smaller is better as long as it works.

This provides some AC coupling to boost bandwidth, but still allows isolation at DC.

I did not look up the specs on the BS170, and am not familiar with it. I have done this in the past with a BSS138 (if I remember correctly), which is a good choice. It is a "jelly bean" which is available from many vendors and at low price. The 2N7000 has a higher Vgs(th) than the BSS138.

• I'll try with the s-d capacitor tomorrow at the lab, I'll let you know. – privera Nov 10 '14 at 0:38