3

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

Bidirectional level shifter

*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?

privera
  • 83
  • 1
  • 6
  • 1
    Have you tried using stronger pull-up resistors? 1 or 2K might make much faster transitions.. – KyranF Nov 09 '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 09 '14 at 20:43
  • @KyranF haven't tried but it makes sense. I'll add that to the list. – privera Nov 09 '14 at 20:45
  • also a simple non-inverting buffer supplied with 5V and with a gain of 2 (for good measure), will amplify the 3.3V and attempt to make it 6.6V but will just reach 5V (supply input) instead. You would need an IC with rail-to-rail outputs though. The op-amp will be able to source and sink current into the target pretty good too, so you might get even better performance – KyranF Nov 09 '14 at 20:48
  • A mosfet-gate-driver chip might be a better match. – Wouter van Ooijen Nov 09 '14 at 21:09
  • I wonder if above circuit can be used to step-up 3.3V from ESP8266 data pin to 5V for WS2812B LED strip control (which operates at maximum 800KHz)? What are the R1 and R2 values? If it works, it would be a nice alternative to [this solution](https://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/). Thanks! – dma_k Aug 01 '19 at 23:37

2 Answers2

3

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.

gsills
  • 7,133
  • 16
  • 22
  • 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 00: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](https://electronics.stackexchange.com/a/286531/227889). – dma_k Oct 08 '19 at 08:13
1

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.

user57037
  • 28,915
  • 1
  • 28
  • 81