I'm trying to use the popular SN74HC595 Shift Register, but I think something isn't right because when the bits are submitted to the register it comes out with something similar but not the same.

#define Latch 9
#define CLK 10
#define DATA 8

byte led = B10110111;

void setup() 
  pinMode(Latch, OUTPUT);
  pinMode(CLK, OUTPUT);
  pinMode(DATA, OUTPUT);

  digitalWrite(Latch, LOW);
  shiftOut(DATA, CLK, MSBFIRST, led);
  digitalWrite(Latch, HIGH);

void loop() 

After this completes I receive an output of 10110101 instead of 10110111. Has anybody had the same area? Any fixes? Could my chip be faulty inside?

Schematic: Schematic

  • is a specific bit failing?
    – jsotola
    Commented Jul 10, 2019 at 4:29
  • I guess you have just forgotten to draw the gnd and 5V lines to the breadboard?
    – Wirewrap
    Commented Jul 10, 2019 at 5:35
  • 1
    Lack of decoupling capacitors?
    – Majenko
    Commented Jul 10, 2019 at 5:57
  • @jsotola It can be any bit that fails but usually within the last 3 Commented Jul 10, 2019 at 13:51
  • @Wirewrap Yes I forgot to draw the GND, and 5V to the breadboard, but they are connected Commented Jul 10, 2019 at 13:52


Your Answer

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

Browse other questions tagged or ask your own question.