Electronic – arduino – Driving 3.3 V LEDs with an Arduino and a shift register

arduinoledshift-registervoltage

I'm planning to build a simple LED matrix with an Arduino and some 74HC595 shift registers. However my Ardiuno outputs 5 V to the registers which will pass that 5 V on. How and where along the line do I reduce this voltage to 3.3 V?

Edit: Found this after a while of Googling. Is a resistor in front of every LED all i need (which i need anyway)?

(5–3.3) / 0.02 = 85 ohm for a 20 mA 3.3 V LED?

Edit 2: Can i provide 3 V from a different source to the Vcc pin of the shift register, but send 5 V logic on the serial pins? Im guessing that won't work but just wanted to double check.

Best Answer

There are a number of options, most of them discussed in this post. Since the communication is one way you can use:

  • Voltage dividers: cheap and easey: 2 resistors. Cannot provide stiff voltage sources unless you lose a lot of power through them
  • A diode with a resistor circuit. Same as previous
  • Level shifter (something like a 74LVC245)

There are shift registers that do run on 3.3V: depending on how many lines you need, an easier solution might be to shift the Arduino output to 3.3V, and feed that to a 3.3V shift register. This will likely (again, depending on your setup) in fewer lines to be level-shifted.

EDIT: Yes, you will need current-limiting resistors for your LEDs, however, voltage divider != a single resistor. Voltage divider looks like this:

schematic

simulate this circuit – Schematic created using CircuitLab

EDIT2: Usually not. You should read the datasheet for the shift register you are planning to use about its various maximum voltages. P.S. When you say "serial pins" you don't mean the Serial TX and Serial RX, right? Usually, one drives shift registers using general purpuse digital IO pins. You can use serial pins for two of those, but usually you need a more pins to drive a shift register (usually at least three in the case of 74HC595). The point is 74HC595 is driven via SPI protocol, not RS-232