3
\$\begingroup\$

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?

\$\endgroup\$
9
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – mkeith Nov 9 '14 at 20:21
  • 1
    \$\begingroup\$ Have you tried using stronger pull-up resistors? 1 or 2K might make much faster transitions.. \$\endgroup\$ – KyranF Nov 9 '14 at 20:43
  • \$\begingroup\$ 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. \$\endgroup\$ – privera Nov 9 '14 at 20:43
  • \$\begingroup\$ @KyranF haven't tried but it makes sense. I'll add that to the list. \$\endgroup\$ – privera Nov 9 '14 at 20:45
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – mkeith Nov 9 '14 at 21:51
3
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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 \$\endgroup\$ – privera Nov 10 '14 at 0:41
  • \$\begingroup\$ 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. \$\endgroup\$ – dma_k Oct 8 '19 at 8:13
1
\$\begingroup\$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.