0
\$\begingroup\$

I need to shift a 3.3V PWM signal to 5V to power a strip of LEDs. We are using a set of JSTs to connect from an Arduino to an LED strip and so only have access to the 5V power. I am having trouble with the circuit I've created not working 100% of the time but sometimes working, so I wanted to double check that my solution to use a voltage divider to shift down the LV reference voltage of a level shifter makes sense electrically. I'm using this level shifter "4 Channels IIC I2C Logic Level Converter Bi-Directional Module 3.3V to 5V Shifter for Arduino" that is a BOB-12009 (amazon.com/dp/B07YZTW2SM). The PWM signal from the Arduino Nano is said to run at 490Hz. Here's the circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

The goal is to route the SDA, SLC pins from the JST which are hooked up to pins on the Arduino BLE 33 (11/12) respectively. The LED code is running on pin 12 which is connected to the pin getting routed to the LED strips D1 input i.e. the SLC pin. It works consistently on one output of one of the boards but works intermittently on every other board. I've checked for shorts and there doesn't seem to be issues there. I don't currently have access to a scope so have been debugging with a voltmeter, but figured I could check here to make sure that there wouldn't be anything wrong using a voltage divider for the level shifter.

\$\endgroup\$
3
  • \$\begingroup\$ It's unclear what the level shifter circuit even is, and how fast PWM signal you expect to shift with it. If it's one of those FET based bidirectional level shifters, it might be completely wrong thing for the task you need to achieve. \$\endgroup\$
    – Justme
    Commented Jun 30, 2023 at 17:28
  • \$\begingroup\$ It's one right off the shelf directed to be used with the Arduino (hopefully truthfully lol). Here's a link: amazon.com/dp/B07YZTW2SM. The Arduino PWM specs are 490Hz for the Nano. Not sure how I would check if the bidirectional level shifter is the right move here? any help or additional information would be appreciated! thanks! \$\endgroup\$ Commented Jun 30, 2023 at 17:33
  • 1
    \$\begingroup\$ Never use an "automatic, one-size-fits-all" bidirectional isolator or level shifter if you can avoid them. They pick up on tiny amounts of noise as a signal and flip the direction around. Now, I2C's SDA signal really is bidirectional, so you can't just use a shifter with a mix of opposing unidirectional channels. But there are "I2C" isolators and level shifters., that know enough of the I2C protocol to control the direction without relying on detection of fast edges. \$\endgroup\$
    – Ben Voigt
    Commented Jun 30, 2023 at 17:59

2 Answers 2

2
\$\begingroup\$

You're using a divider to get 3.3 V from a 5 V source.

The top resistor is 510\$\Omega\$, and it needs to drop 1.7 V, so the current through it will be $$1.7V/510\Omega=3.333mA$$

Now what happens if whatever you're using the 3.3 V for draws a bit of current? Let's say 1 mA. You'd have $$4.33mA\times 510\Omega=2.21V$$ and instead of 3.3 V you now have 2.79 V.

This is why using a divider as a regulator is generally a bad idea, unless the change in load current is small compared to the divider string current (1/10th or less) they don't regulate very well. 3.3 V regulators are cheap and plentiful, use one.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ One can also use a resistor-zener divider instead of a purely resistive divider, which makes the output voltage much less sensitive to load current. \$\endgroup\$
    – Ben Voigt
    Commented Jun 30, 2023 at 18:00
  • \$\begingroup\$ ah ok so just to make sure I'm understanding correctly you mean that I should use a voltage regulator which could replace the input to the level shifter? i.e. I could use something like this amazon.com/Regulator-Adjustable-Converter-Electronic-Stabilizer/… which says it'll be variable and enable me to shift a signal down as long as it's 1.5V higher than it. Then I should be able to proceed to using the level shifter as designed? \$\endgroup\$ Commented Jun 30, 2023 at 18:14
  • \$\begingroup\$ @ZoltanaMaximus That looks a bit overkill. Not sure what your skill level is, I was thinking more like an LDO along the lines of ti.com/lit/ds/symlink/tps7a05.pdf but it's not a plug-and-play solution. You might look into what JustMe suggested in his answer. \$\endgroup\$
    – GodJihyo
    Commented Jun 30, 2023 at 18:24
2
\$\begingroup\$

If you don't have 3V3 supply available, then you need to modify the FET level shifter.

If you make a voltage divider, it must be quite strong and waste a lot of power to keep voltage stable when the 3V3 side pulls low.

You can simply remove the 3V3 pull-ups as the PWM is push-pull signal, and use somewhat reasonable kilo-ohm level resistive divider to drop 5V to 3V3 for FET gate.

\$\endgroup\$
4
  • \$\begingroup\$ I'm not sure I know exactly what you mean. Any chance you could link and example. You mean using a fet instead of a level shifter? Or for input to the level shifter? \$\endgroup\$ Commented Jun 30, 2023 at 19:35
  • \$\begingroup\$ It looks like maybe I could be using a 74AHCT125 to leverage the 5V signal and shift the 3.3V up? \$\endgroup\$ Commented Jun 30, 2023 at 20:04
  • \$\begingroup\$ No, your level shifter is a FET+resistor based shifter, even if to you it is just a black box and you don't know how it works. Yes, HCT chip would do, AHCT, or any other that can convert 3V3 levels to 5V. Highly recommed to switch the FET level shifter to a proper IC. \$\endgroup\$
    – Justme
    Commented Jun 30, 2023 at 20:16
  • \$\begingroup\$ Gotcha, ok thank you for your help! \$\endgroup\$ Commented Jul 1, 2023 at 15:33

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