595 Shift not behaving as expected

I have been trying for the last 2 months to make this extremely simple circuit to work, and still am getting nothing. All I need that hasn't been figured out yet, is just the addressable backlighting for the buttons to my custom head unit.


Here's the schematic, which works perfectly on a breadboard when I lay it out identically to how this is shown. However this is not the case when its on my PCB.

With version one of the PCB, I could address QB-QH just fine. But if I tried to turn on QA, the whole thing would start to pulse and haphazardly show different outputs on. I forget which pin I had connected to SER, but it turned out to be tied to one of the ESP's communication pins for uploading. In any case, I had recreated that same circuit on a breadboard, and got the same weird behavior until I assigned the pin to something else. Currently SER: 21, SRCLK: 18, RCLK: 19 on the ESP32. Seeing as I had gotten it to work, I had assumed that everything with it was fine.

Fast forward a bit, I make several changes to the board pertaining to other things, while leaving the shift register's part the same. Despite that, I am still getting the most useless behavior. Now everything is on all the time, except for QA. I cannot turn anything off, cannot address anything to anything. I had for testing purposes another one on a breadboard in parallel with its data pins, and it outputted what I wanted, while the one on the PCB refused to do anything. Basically all and all, both iterations of PCB, the shift register has just been a pain. Yet the identical circuit on a breadboard does what is expected. The only difference between the chips is the breadboard variant is obviously your typical DIP, vs the SOIC variant on the board. On both the breadboard and PCB, I have tried multiple IC's. The behavior is identical to their corresponding environment.

I am genuinely stumped as to what the issue could be.

Yes I am aware that it is being powered at 5V, despite the ESP32's data outputting 3.3V, but I had tested both options and found that the 5V option was simpler, and more reliable, and gave me the brightness I needed.

The board in its current state showing the only behavior I can get:

Solder job (I'm not seeing any bridges nor have found any:

The PCB Drawings:

This is just a test script that I made to work in a vacuum so its not cluttered with the rest of the program:


 int serialData = 21;   // Black     14    SER
 int shiftClock = 18;    // Yellow   11  SRCLK
 int latchClock = 19;    // RED      12   

void setup() {

  pinMode(serialData, OUTPUT);
  pinMode(shiftClock, OUTPUT);
  pinMode(latchClock, OUTPUT);


//       digitalWrite(latchClock, HIGH);
 //     shiftOut(serialData, shiftClock, MSBFIRST, 0b00000000);
  //    digitalWrite(latchClock, LOW);   

  digitalWrite(clearPin, LOW);
  digitalWrite(clearPin, HIGH);

  digitalWrite(latchClock, HIGH); 

}

void loop() {
       digitalWrite(latchClock, LOW);
      shiftOut(serialData, shiftClock, MSBFIRST, 0b00000000);
      digitalWrite(latchClock, HIGH);    

    delay(100);

}

Vcc = 3.3V?

SMD 01A resistors = 100R?

Vfwd of your green LEDs?

mA drive capability of an HC595 output?

mA being drawn to light up each LEDs?

Welcome Back!

Your code is close, but there are two issues with the 74HC595 initialization.

  1. clearPin is not defined. In your schematic, SRCLR (pin 10) is connected directly to VCC, so you cannot control it from software.
  2. The latch sequence should be LOW → shift data → HIGH. This transfers the eight bits into the output register.

const int serialData = 21; // Black - SER, pin 14
const int shiftClock = 18; // Yellow - SRCLK, pin 11
const int latchClock = 19; // Red - RCLK, pin 12

void setup() {
pinMode(serialData, OUTPUT);
pinMode(shiftClock, OUTPUT);
pinMode(latchClock, OUTPUT);

digitalWrite(serialData, LOW);
digitalWrite(shiftClock, LOW);
digitalWrite(latchClock, LOW);

// Clear all eight outputs
shiftOut(serialData, shiftClock, MSBFIRST, 0x00);
digitalWrite(latchClock, HIGH);
}

void loop() {
// Nothing required
}

VCC = 5VDC
Yes 100R, same behavior with 330R
LEDs are 3.3V
mA capability hold: ~6ma;
Calculated mA drawn from the LEDs ~5mA

Again, the key thing here, is I have tried with different resistances, and I have with the exact ones got it to work on the breadboard. I'm not denying there may be an issue, its just weird to me how it works in one place, but not the other

I had clearPin defined and a dedicated pin when I was troubleshooting on the breadboard. I had forgotten I still had some of that commented out. Its now tied to VCC, pulled HIGH.

Again with shift LOW, then HIGH, I was just trying things in case I had things backwards. Obviously that did not help.

But also I uploaded your code, and still nothing. Thank you though

@cpt-weird_makes

This is a working circuit with Arduino UNO using SPI Port. It may serve you as a reference.


Figure-1:

Test Sketch:

#include <SPI.h>

const int storePin = 10;  // ST_CP
char myData[10];

void setup() 
{
  Serial.begin(115200);
  pinMode(storePin, OUTPUT);
  SPI.begin();
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  digitalWrite(storePin, LOW);  // Prepare latch
  //--------------------
  SPI.transfer(0b10101010);      // 0xAA
  digitalWrite(storePin, HIGH);  // Output appears on Q0–Q7
  delayMicroseconds(5);
  digitalWrite(storePin, LOW);
}

void loop() 
{
  byte n = Serial.available();
  if (n != 0) 
  {
    byte m = Monitor.readBytesUntil('\n', myData, sizeof myData - 1);
    myData[m] = '\0';
    byte y = atoi(myData);
    Serial.println(y, BIN);
    //--------------------
    SPI.transfer(y);               // 0xAA
    digitalWrite(storePin, HIGH);  // Output appears on Q0–Q7
    delayMicroseconds(5);
    digitalWrite(storePin, LOW);
  }
}

You're not giving Vih on the HC595 much margin. The ESP32's not going to put out more than 3.3V, and the minimum Vih on the HC595 is 3.15V with Vcc of 4.5V.

Hmm. Back of the envolope calculations follow, so errors would not be surpring.

E=IR. So 0.005A * 100R = 0.5V. Do you really measure only 0.5V across your 100R resistors? I know green LEDs have a higher Vfwd, but 4.5V seems unlikely. I'd expect no more than 3.5V. Which would leave 1.5V to drop across your 100R resistor, meaning 0.015A or 15mA, which is well outside of what the HC595 output should be asked to provide.

I await the measured voltage drop across a 100R resistor as a real world check.

The following circuit works well with 3.3V Arduino UNO Q.

I may have measured wrong, but I'm getting a drop from 2.04, to 2.42, for a total of .38V, and they read at 100.08R. The claimed rating for the LEDs is between 2 and 3.

Sorry, I have to go for a few hours, I can test further later

So 0.38V across a 100R resistor means about 3.8mA. Well within the drive capability of an HC595. But it also means a Vfwd of 4.62V across your green LED. Which makes me go hmm. Something seems off here.

Can you verify the value of C1?

If the breadoard version works and the pcb version does not work, they are probably different.
From your pcb picture I cannot see if it is ok. Some of thr circuit is missing.
A more close up picture if your final pcb (both sides) would be worthwhile. So we can check your soldering skills. Soldering joints of R18 may be bad.
Can you add a close up of the adapter? It is out of focus now.

Between what points?

I just want to start that I was in a rush, measuring things as fast as I could so that I may get a solution while I was out. So my measurements were not accurate, nor did I have enough time to thoroughly look through the datasheets maximum table before my previous comments. I am sorry about that. In any case I have returned with some updated information.

Agreed. But like I said. I was in a rush. To be honest I'm not sure what I probed, but it almost certainly was not what I intended to. Per the listing, the LEDs claim that their forward voltage is 3.2. In practice I measure a FwV of 3.08 when in series with a 100R across the 5V leads (A separate circuit exclusively for testing purposes). Further, I'm not sure where I got the 6mA output rating, but looking further into the datasheet, the true max is 35mA. A much higher ceiling. In which case, following the formula below, I should theoretically get away with up to 53.7R, as that would hit 35mA in an ideal and theoretical world. Unless I measured or calculated something way off, I dont see how that would be an issue, especially when again, it works on the breadboard.
image

That should be .1μf or 100nf, not 1μf, I apparently wrote that down wrong. I can replace that with one and see if that changes anything. But would make everything high except QA even when disconnected from its data pins?

Only difference to my knowledge is that the breadboard version has the amber colored version of LEDs instead. But if that was making a difference, with their lower fwV, would that not be more susceptible to these issues than the green?

Im not sure what adapter you mean, but I have attached better photos below.





Currently the only pins connected on the dev side of the FFC is VCC, GND, SRCLK, RCLK, and SER

If I have missed anything or anything is an issue, please let me know

It should be .1µF (ceramic) .  Look over this:

That's the Absolute Maximum Rating. Electrical Characteristics table on the next page shows 6mA to maintain a Voh of 4.3V.

Anyhow, with 1.92V left across the 100R resistor, that's 19.2mA per LED. Or 153.6mA total.

An interesting number from the Absolute Maximum Rating table is "Continuous current through VCC or GND". That's 70mA. So with 100R, you're more than 2x over the Absolute Maximum.

70mA divided by 8 LEDs gives 8.75mA per LED. With a measured 3.08 Vfwd, that works out to 220R series resistors. Just to get the chip operating on the hairy edge of Absolute Maximum.

I'm just going to leave you with that thought.

I see. I didn't know about that relationship with the chip as a whole. But a couple questions then. First of all, how was it working on the breadboard then? because I'm getting the impression that it shouldn't have. Secondly, I was under the impression that each channel is only drawing that power so long as its active. Or in other words, if you had them blinking fast enough sequentially, it wouldn't burn it out? But then why was the only behavior it showed all of them on, regardless of what data it was receiving? I'm just confused why just the mere act of it being powered was enough to trip everything and overload it. Or is it just that there's too much between GND and VCC?

Either way I see general consensus is fix the ceramic cap, and increase the resistance of the LED's resistors. Which is fine. But I need it to be at least 90% the brightness it is at the 100R. Without overloading it, how could I achieve that without making things complicated with boosting that somehow? Basically, what could I do that I could make it work with the current board enough, so I'm not having to make another order right away? Unless there's an alternative shift register that exists that more or less the same, just with a higher current output (such as the TPIC6C595? Assuming I can somehow step up the ESP's logic to atleast 4.5v?)

Are more components involved on the PWA than the lighting (VCC, GND, 595, resistors and LEDs)?

I put the wrong potential down a MAX7219 8x8 LED matrix, now they all light when power is applied. Check shorts that might bias all LEDs without commands.

Thank you everyone, I got it to work

I replaced the resistors with 220's, the decoupling capacitor with .1μf, and the entire IC, because it likely got shot from powering it on earlier. That and I had the epiphany that that one came from an old porotype board from a few years ago. There's a solid chance that it could have been shot from the start.

Either way, despite now having more than twice the resistance before, the brightness in the LEDs is near indistinguishable. I think I was over saturating them before. So it wouldn't have lasted long term anyways.

:+1: