3
\$\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\$
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\$
  • 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 '14 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\$ – Spehro Pefhany Oct 25 '14 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 '14 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 '14 at 11:59
  • 1
    \$\begingroup\$ Checked it. No short at input and output \$\endgroup\$ – Hassaan Oct 25 '14 at 13:47
3
\$\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\$
1
\$\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\$

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\$
  • \$\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\$ – Fizz Dec 23 '15 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 '18 at 10:42

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.