2
\$\begingroup\$

I'm working with an IC that can't take more than 3.3V (+/- 0.2V), including on its I/O pins. I want to control it using Arduino, but its PIN's are 5V. Now I'm wondering if I can use PWM to archieve the 3.3V by setting the correct duty cycle. It doesn't seem that good a solution since the voltage will transiently be above 5V which might harm the IC.

So what is the best solution for this? Given I need to control 6 PIN's both in and out (two PIN's are only input to the IC whereas 4 are both in/out depending on the IC's state), I would prefer something involving as few components as possible since I will need to dublicate the solution 6 times!

Given the current draw will likely be very small, I'm thinking I could use a voltage divider on each PIN (= 2 resistors) to get the 5V down to 3.3V. Is that a good solution? Or is there a better one?

Another solution could be to put a 3.3 Zener in reverse from signal to ground (after the resistor)?

\$\endgroup\$
  • \$\begingroup\$ Are you sure there is not a 5V IC that does the same function? It is really a problem to drive something that has not the same voltage reference from your MCU. Even more if the pins are IN/OUT. \$\endgroup\$ – gstorto Feb 14 '15 at 12:13
  • \$\begingroup\$ @Gleison: There might be 5V versions available but then I would have to wait weeks to get them ;-) But it would also be nice to know in general how to handle such situations. I suppose it isn't impossible -- why wouldn't the voltage divider work? \$\endgroup\$ – Morty Feb 14 '15 at 12:40
3
\$\begingroup\$

PWM will not solve the problem. The voltage will be 5V for 2/3 of the time, this will damage your IC.

The easiest option you got is the put voltage dividers between each pin. If you really don't want to place 12 resistors you can search for a 5V version of your IC. A lot of chips are produced as 3,3V and 5V versions.

\$\endgroup\$
  • \$\begingroup\$ I don't see how the voltage divider will step up the 3.3V to 5v in the IC output pins. Still a problem. \$\endgroup\$ – gstorto Feb 14 '15 at 13:22
  • \$\begingroup\$ @Gleison: The analog pins on the Arduino, when run in input mode can measure the voltage compared to a reference, so one could simply put the threshold for a "one" so it corresponds to e.g. \$\endgroup\$ – Morty Feb 14 '15 at 13:28
  • \$\begingroup\$ @Geurt: Did you see my question on using Zeners? \$\endgroup\$ – Morty Feb 14 '15 at 13:29
  • \$\begingroup\$ @Morty Wait, do you mean the "analog pins" as the ADC channels? I think it is a little bit of overkill to use them, no? \$\endgroup\$ – gstorto Feb 14 '15 at 13:39
  • 1
    \$\begingroup\$ @GleisonStorto - an ATmega328p running at 5v has an input threshold for a logic "1" as low as many other parts running on 3.3v, so if the electrical environment is not particularly noisy, no boosting of the input signals may be needed. \$\endgroup\$ – Chris Stratton Feb 14 '15 at 22:23
1
\$\begingroup\$

One possible option can be emulating an open collector output in SW. That is, for "0", you set the pin to output with value "0" --> ~0V sink. For "1", you set the pin to "high impedance input" --> floating, allowing you to drive ~3.3V through a pull-upp resistor to the 3.3V supply.

This requires a bidirectional I/O pin though and no built-in pull up, but I guess all Arduino pins are I/O.

You need great care with the software though, since a mistake may drive the pin with 5V. This must be ensured also during startup thus it takes both care and experience to use this option.

On the other hand, check how many mA the actual pin can drive from the 5V. It is not unlikely that your 3.3V chip can survive it for short periods, often specified separately in the data sheet as non-operating but also non-damaging conditions.

\$\endgroup\$
0
\$\begingroup\$

When going from 5v down to 3.3v the resistive voltage divider is the popular choice.

There are also the 5v tolerant buffer chips like 74LVC245, 74HC4050, and others similar to these that can run with a 3.3v supply but can take 5v input signals.
( http://www.adafruit.com/product/735 )
( http://media.digikey.com/pdf/Data%20Sheets/NXP%20PDFs/74HC4050.pdf ) .

Going in the other direction there are the typical transistor/mosfet options with pull up resistors:

schematic

simulate this circuit – Schematic created using CircuitLab

Then there are even some pre-made types that can be bidirectional: ( https://learn.sparkfun.com/tutorials/using-the-logic-level-converter )
( http://www.hobbytronics.co.uk/mosfet-voltage-level-converter )
For these the schematic is provided so you can roll your own.

Here are few similar to above and a few other stratigies (including using a zener): ( http://jamesreubenknowles.com/level-shifting-stragety-experments-1741 )

\$\endgroup\$

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.