6
\$\begingroup\$

I am using Arduino DUE for my project which gives a 3.3 volt output signal. I have to convert it to 5 volts to use it with another device. The problem is that my signal frequency is 1 MHz. I have tried using Spark Fun logic level converter which uses BSS138 MOSFET. The converter does give a signal of 1MHz but its output amplitude remains at 3.3 volts. I need to convert it to 5 volts. Can anyone tell me whats the problem. Why the signal amplitude remains at 3.3 volts? I have also tried the same circuit with 2n7000 MOSFET but it also gives the same problem. If frequency is the problem then can anyone suggest a level converter or circuit that can convert the 3.3 volt signal to 5 volts at 1MHz. Thank You

enter image description here

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ Did you manage to solve this please? \$\endgroup\$
    – Luke Galea
    Aug 26, 2022 at 14:53

5 Answers 5

5
\$\begingroup\$

TL;DR Your frequency is too high for that method of level shifting.

Old thread but on the off chance that someone stumbles across this like I did while looking for answers here's what is likely wrong:

I built my own level shifter based on the sparkfun level shifter which you are using. Like you I am attempting to shift 3.3V up to 5V at a frequency of 1MHz. I used a slightly different transistor/MOSFET and mine was just outputting 0V when on.

Changing my resistor values down to 100 ohms improved the output (I got spikes that went to about 3.3V so still not what was desired).

I then tried reducing the frequency to 1 KHz and the level shifter worked perfectly.

Basically I think the pwm turns the gate on (output goes low) and when it turns off again it takes awhile (too long at high freq) for the output to become high again. The resistor is just too slow. Smaller resistor values help but at 1 MHz I've found it's not quite good enough.

Alternate options to consider include:

\$\endgroup\$
3
\$\begingroup\$

You need to supply 5V to the HV input on the converter (and 3.3V to LV), and ensure that all the grounds are common (connected together).

Edit:

enter image description here

Simply applying the 5V supply to HV should give you 5V at the output (with or without LV connected to 3.3V) if not, something is damaged or connected incorrectly.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Of course i am applying 5V to the HV input and 3.3V to LV. The arduino DUE signal goes to LV side of MOSFET and output from the HV side of MOSFET. The output still remains at 3.3V. Thats the problem \$\endgroup\$
    – Hassaan
    Oct 25, 2014 at 10:32
  • 1
    \$\begingroup\$ Unless you've damaged the MOSFET (shorted the gate) the unloaded output will go to 5V with proper HV supply, no load and input either at 3.3V or open. Pulling down is a bit more iffy with this circuit, but the 5V high state should not be a problem. \$\endgroup\$ Oct 25, 2014 at 10:54
  • \$\begingroup\$ The MOSFET seems fine. When their is no input on the LV side their are 5V on the HV side and 3.3V on the LV side. But when i attach the arduino signal to LV side, the HV side gives the same signal of amplitude 3.3V instead of 5V. \$\endgroup\$
    – Hassaan
    Oct 25, 2014 at 11:24
  • 1
    \$\begingroup\$ I didn't quite understand what you said in the last message but i did check the converter using an external power supply. The grounds are connected together on both HV and LV sides. Without any input the HV side is at 5V and LV side at 3.3V. When i ground the the LV side the HV side also goes to 0 as it should. But when i apply a 3.3V signal of any frequency even from a function generator the output on the HV side remains at an amplitude of 3.3V. It does not go to 5V.... \$\endgroup\$
    – Hassaan
    Oct 25, 2014 at 11:59
  • 1
    \$\begingroup\$ Checked it. No short at input and output \$\endgroup\$
    – Hassaan
    Oct 25, 2014 at 13:47
2
\$\begingroup\$

I think the parasitic capacitance in q3 may be affecting the circuit at higher frequencies. I would recommend reducing r2 to 3.3K and reducing r10 to 4.7K and checking to see if the output on the 5 volt side is closer to 5 volts. If the output looks better but not quite close enough to 5 volts you might try reducing both resistors even more if the drivers can sink even more than 1 milliamp.

\$\endgroup\$
1
  • \$\begingroup\$ This improved the output voltage but obviously not for very high frequencies. Would you recommend using a better MOSFET perhaps? \$\endgroup\$
    – Luke Galea
    Aug 26, 2022 at 14:46
2
\$\begingroup\$

What is HV2 connected to? If there is a capacitor around 0.1uF coupled towards ground at HV2, then you will see this effect.

However, even with no capacitance, at this frequency, the signal will never reach 5.0V. For this I would recommend something like the SN74LVC8T245.

LTSpice Simulation

\$\endgroup\$
2
  • \$\begingroup\$ Good answer. This kind of FET solution is recommended up to a few hundred kHz, well kbit/s in the NXP appnote. So no wonder it doesn't work well at MHz. \$\endgroup\$ Dec 23, 2015 at 6:06
  • \$\begingroup\$ agreed, we can also reduce to 10k to about 3.3k but that maybe too much stress on the MCU if multiple pins are used \$\endgroup\$
    – Ali80
    Nov 17, 2018 at 10:42
0
\$\begingroup\$

As suggested in Pål-Kristian Engstad's answer, a faster alternative to the common SparkFun MOSFET based logic level shifter is to use a 74LVC245 octal bus transceiver, because a buffer will actively drive its output both high and low, which will give faster edge times.

From the datasheet, the switching characteristics are as follows:

74LVC245 switching characteristics

which should be fast enough for 1 MHz operation.

I got this info from Create® 2 Serial to 3.3V Logic, as I am looking into a similar circuit. This is the suggested implementation from that PDF:

Implementation suggestion

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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