5
\$\begingroup\$

The new Arduino Due board has its microcontroller running at 3.3V, but unfortunately most standard Arduino add-on shields (boards) run at 5V, thus their I/O signals are at different logic levels.

The number of signals is approximately 20, and includes:

  • standard digital lines (some with hardware interrupt capability)
  • analog I/O
  • Serial UART lines
  • as well as SPI and I2C signals

Now, I would like to add an in-between shield (board) so as to facilitate compatibility between the 3.3V Arduino Due board and all the signals of any given 5V shield. This in-between board would need to allow interfacing between the 3.3V signals and the 5V signals (i.e., both ways).

What is the best way to create bidirectional level-translation for a case like the above? Here, by "best", I just mean straightforward, inexpensive, and would work without problems across the various shields and signal types.

Based on my research of this kind of level shifting so far, the options available seem to be:

  • A set of diodes that create a voltage drop (but this would be uni-directional)
  • A set of resistive dividers (again uni-directional)
  • A specialized level shifting chip?...
\$\endgroup\$
  • \$\begingroup\$ Resistive dividers are also uni-directional in nature. Level shifter ICs are mostly unidirectional (though the direction can be changed by a pin), although some are automatic as well. \$\endgroup\$ – Gustavo Litovsky Dec 9 '12 at 3:29
  • \$\begingroup\$ @gl3829: Hmm, any specific level-shifter ICs you have in mind that are bidirectional (that aren't restricted to all being toggled just one way or the other)? Or other two-way solution? \$\endgroup\$ – boardbite Dec 9 '12 at 5:17
  • \$\begingroup\$ There's the TI TXB series for bidirectional, but they're on the pricy side. Ex: ti.com/product/txb0108 \$\endgroup\$ – Joe Baker Dec 9 '12 at 5:33
  • \$\begingroup\$ @JoeBaker: Not too bad; thanks. Looking in the same category as the TXB0108 on the Digikey catalog, I found this: GTL2000. It has 22 channels, but its specs say "Voltage" for Input type and Output type while specs for TXB0108, etc. say "Logic" for the same. I am trying to explore if there is any difference. \$\endgroup\$ – boardbite Dec 9 '12 at 5:43
  • \$\begingroup\$ Useful article here: eetimes.com/electronics-news/4169927/… - Now just wait for our resident LMGTFY to reword that into an "original" answer :-) \$\endgroup\$ – Anindo Ghosh Dec 9 '12 at 5:50
1
\$\begingroup\$

I've designed a small system that might work for your particular application. Here is the schematic: Level Translator

I forgot the reference node, it must be connected to terminal 2 of BT1. How does this work?

From high to low

First of all let's assume we can neglect the current flowing in/from "low".

When high is pulled up (5V) in R1 no current flows, while the three diodes are conducting. Assuming a forward drop voltage of 0.6V the voltage at low will be 3.2V, and the current flowing from high will be approximately 320uA.

When high is pulled down (0V) all the diodes are interdicted, so the voltage at low will be pulled down by R2. The current that high must sink is approximately 500uA.

From low to high

Now let's assume high is not consuming current.

When low is pulled up (3.3V) the diodes can not conduct because the voltage at high would be more than 5V, so high is pulled up by R1, the diodes are off and low must provide about 330uA.

When low is pulled down (0V) the diodes are correctly polarized, R2 has zero volt across, the voltage at high is about 1.8V and the current sunk by low is approximately 180uA.

As you can see, the big problem is that 1.8V is a bit too much: a CMOS circuit would probably read that "low", while a TTL is likely to read that "high". A better approach could use a 1.5V zener diode instead of the three small signal diodes, with the cathode connected to R1 and the anode to R2. The resistor will probably need to be reduced to meet the minimum polarization current of the zener diode.

One last thing about the resitors is that you can use any value from 1k to 100k, of course higher resistance values correspond to lower current consumption, but also to slower transient response, and vice versa.

\$\endgroup\$
1
\$\begingroup\$

Very easy, just slap a shield on and it will work no voltage correction needed. The Due works with the Ethernet shield and WiFi Shield just fine. If your power input to the shields are 3.3volts the chips on those shields do not have voltage boosters, and will then output 3.3volts. If you are purchasing a shield with a controller on it, check the datasheet of the device and check if its capable of having a 3.3volt power input. CMOS high is 1.5 volts and above I believe. (It would be almost impossible to communicate at that voltage, I would says your safe low is 3 volts.) If it is capable of 3.3volt power, plug it and check the pins outputs, if its all 3.3 volt plug it into the Arduino and have fun :)

\$\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.