1

I was following a tutorial similar to this: https://www.arduino.cc/en/Tutorial/ShiftOut

That is, an array of 8 LEDs that lit up accordingly to the binary representation of a number, which was given in a loop from 0 to 255.

The problem is that when invoked shiftOut() over certain numbers (such as 5, 9 or 13), the LEDs didn't lit as expected.

I even tried replacing the IC, but what finally solved this issue was to disconnect IC's pin 8 (GND) and let only pin 13 (OE) connected to Arduino's ground pin.

Does anyone know the reason this strange behavior happens on 595 IC?

Here's a video showing the circuit finally working (without IC's GND pin connected): https://www.youtube.com/watch?v=NGfpk-kjemo

6
  • Please post your code and format the code using the code formatting markdown (four leading spaces). For help see Markdown help. You should be able to do this by selecting the code and pressing Ctrl+K to have your browser do this for you. Please post your schematic. You have done something very very wrong for this to happen.
    – Nick Gammon
    Feb 27, 2016 at 6:32
  • What size resistor? Check how much current is pulled. Feb 27, 2016 at 9:17
  • didn't lit as expected. Please expand on that. No leds were lid? Wrong leds were lid? If so which?
    – Gerben
    Feb 27, 2016 at 13:58
  • As suggested by previous comments, you ought to provide enough information so that replies can give answers instead of speculation. Besides the video (which seems to show that you correctly oriented the chip), add a couple of clear photos of your breadboard setup, and draw the circuit. Feb 27, 2016 at 17:46
  • Sorry, I'll try to explain more. When 595's GND was connected, wrong LEDs were lid only for some numbers. For instance, 3 lid 00000011, 4 lid 00000100, but 5 lid 00000110 (instead of 00000101). The resistors I used were 150 ohms. Actually I was following a chapter of this book (in a Brazilian Portuguese version): books.google.com.br/… The project schematics and source code are in this link above. The exceptions are that the 1st edition it recommended 220 ohms resistors (instead of 560 ohms) and the capacitor wasn't present. Feb 28, 2016 at 17:25

1 Answer 1

2

Disconnecting the ground pin was not a solution.

It is hard to be certain from video but the resistor values are likely too small because I can't see any color on the bands. They are 100?

Look closely at the driver data sheet. It may say an output pin maximum current is +/-35 mA which would suggest that the 100 ohm resistor is okay.

For example, a red LED has a of around 1.6 V. You are using Vcc=3.3, so a 100 ohm resistor limits the current to <17 mA ((3.3-1.6)/100). The actual current will be a somewhat smaller as the Vf increases with current..

But you also stay within the maximum Icc and Ignd on the data sheet. These limits are not necessarily 8 x 35 mA. For example an NXP max Icc is 70 mA. That means you cannot drive all the outputs at maximum current, just 2. This is a logic chip, not a driver.

There is other hint that you should not using all the outputs at the max current spec in the section where the Voh and Vol are described. The current at which the voltage is specified is 6 mA, which is the maximum you should use if all output are going to source or sink at the same time.

A common LED current is 5 mA, so this chip could drive 8 simultaneously. If you want high brightness, you need to add a driver such as ULN2003.

Note that the schematic shows red LED's. The color is important. Different LED's have different forward voltage. The blue LED have the highest in the range of 3.3 V and higher. So with a Vcc=3.3 there is barely enough voltage to light the blue LED. The red and yellow have much lower forward voltage. When the chip tries to light the red and blue at same time, the output voltage is dropping enough that the blue is not visible, but the red is easily lit.

From the video, it looks that you have the same resistor on all the LED's. On different color LED's this will not achieve the same brightness on all LED's. You need different resistors for each color if you want them the same brightness.

The solution is

  • Up the Vcc to 5V so that you can reliably light the blue LED's.

  • Increase the resistor values start with 510 for red and 220 for blue. This should be about 6 mA for both.

1
  • I used 150 ohms resistors. The input Vcc was 3.3 V (from Arduino's). I realized that LEDs were quickly blinking just before each transition. Feb 28, 2016 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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