Custom PCB module with 7seg display and shift register not working

I have created a PCB that makes a 7 segment common anode display module controlled by shift register

I have soldered the components on a first PCB and it works fine. I have a sample code that displays digit 0 to 9. No problem.
So then I went on to solder components on the second PCB. This was to test daisychainging such modules. And it did not work. I created a thrid one and the behaviour is the same. I tested display a shift register by using the ones from the first board that definetly work and still no joy.
Then I discovered something. When I touch Clock (STCP) the module all of the sudden works . But only for few seconds. It then flickers and dims out.

Can someone explain this behaviour for me and is there anything I can do with this board to fix it. I checked all the connections with multimeter and they are fine. Can this be somefow linked to the way the tracks are layed down on the PCB. This is a learning curve for me. I know that I should not use 90 degrees angle on the PCB and I did not know that when I was starting this little project.

Any help would be greatly appreciated.

You need a 0.1uF ceramic bypass capacitor on each board, attached between the Vcc and GND pins of the shift register. You can probably solder them directly to the shift register pins on the back of the PCB.

Hi, @Dziubym

What have you got the "Clock" connected to?

Can you please post a circuit diagram of how you connect two of your PCBs to the controller.
Please not a Fritzy picture, label pins and components.
A pen(cil) and paper circuit will be fine.

What model Arduino are you using?
How are you powering the display?

Tom.... :grinning: :+1: :coffee: :australia:

Thanks. But why does it work on one and does not work on the other one.
Can you explain this issue in more detail so I can undertansd what difference capacitor makes

This may help,
From what you have said, I gather that all your module work when the only one connected to your controller, but if you cascade them, the extra module doesn't?

Can you please post a circuit diagram of how you connect two of your PCBs to the controller.
Please not a Fritzy picture, label pins and components.
A pen(cil) and paper circuit will be fine.

What model Arduino are you using?
How are you powering the display?

Tom... :grinning: :+1: :coffee: :australia:
PS, if one module works and others don't you may have a soldering/connection problem.

The clock pin goes to Arduino D3
The latch pin goes to Arduino D2
The data pin goes to Arduino D4
And also I connect VCC and ground. Here is the code I use.
Also this setup worked on the breadboard without capacitor in place

int DS1_pin = 4;
int STCP1_pin =3;
int SHCP1_pin = 2 ;

int digits [10][8]{
  {0,1,1,1,1,1,1,0}, // digit 0
  {0,0,1,1,0,0,0,0}, // digit 1
  {0,1,1,0,1,1,0,1}, // digit 2
  {0,1,1,1,1,0,0,1}, // digit 3
  {0,0,1,1,0,0,1,1}, // digit 4
  {0,1,0,1,1,0,1,1}, // digit 5
  {0,1,0,1,1,1,1,1}, // digit 6
  {0,1,1,1,0,0,0,0}, // digit 7
  {0,1,1,1,1,1,1,1}, // digit 8
  {0,1,1,1,1,0,1,1}  // digit 9

void display_digit(int d){
  if (digits[d][0]==1) digitalWrite(7, LOW); else digitalWrite(7, HIGH); //A
  if (digits[d][1]==1) digitalWrite(8, LOW); else digitalWrite(8, HIGH); //B
  if (digits[d][2]==1) digitalWrite(9, LOW); else digitalWrite(9, HIGH); //C
  if (digits[d][3]==1) digitalWrite(2, LOW); else digitalWrite(2, HIGH); //D
  if (digits[d][4]==1) digitalWrite(3, LOW); else digitalWrite(3, HIGH); //E
  if (digits[d][5]==1) digitalWrite(5, LOW); else digitalWrite(5, HIGH); //F
  if (digits[d][6]==1) digitalWrite(4, LOW); else digitalWrite(4, HIGH); //G

void DisplayDigit(int Digit)
    for (int i = 7; i>=0; i--)
    if (digits[Digit][i]==1) digitalWrite(DS1_pin, LOW); 
    if (digits[Digit][i]==0) digitalWrite(DS1_pin, HIGH);
   digitalWrite(STCP1_pin, HIGH); 

void setup() {  
  pinMode(DS1_pin, OUTPUT);
  pinMode(STCP1_pin, OUTPUT);
  pinMode(SHCP1_pin, OUTPUT);

void loop() {
for (int i=0;i<10;i++){  

Bypass capacitors are not optional. Without them, circuits containing ICs can misbehave in random ways, or may behave correctly sometimes but with no guarantees.

Thanks guys:
Answering few ofo your questions:

  • I am using Arduino Nano. it is powered from the PC (USB cable)
  • The first PCB works in standalone mode
  • the second and third PCB does not work in standalone mode, I did not even get to daisychaining as I could not make two modules to work so i could test it. Just the fact that two modules show the same behaviour tells me this is not a soldering issue. Plus I checked all the connections

Breadboards normally contain some small amounts of natural capacitance because of their internal construction. Could be this was enough to allow your circuit to work, by luck.

Touching the circuit can also introduce some small capacitance.

Another problem I spotted. I don't think this is the reason for the problems you describe, but it is a mistake. The led segments in your display could have a forward voltage as low as about 1.8V. With 220R series resistors, around 13~14mA could flow through each segment. If all 8 segments are lit, that's a total of over 110mA flowing through the shift register, and it's only rated for an absolute maximum of 80mA. 330R would be ok and would not make the display noticeably dimmer (except perhaps in a side-by-side comparison).

I will definetly try it. Not sure I have 0,1uF capacitoor. How did you decide on which capacitor to use, Need to check. Is there a range I can use or is just this one.

So the setup in the picture would work
Just checked have just one 0,1uF capacitor. Need to buy some more.

Yes, probably. But closer to the chip is better. 0.1uF caps are small, you should be able to lay it flat against the back of the PCB behind the chip socket and solder the leads directly to the Vcc and ground pins.

So when all segments lit is this causing the display to be dimmer right. It will still display the digits. When displaying the digits always at least LED is off. So that makes my problem a bit smaller right.
But since you mentioned it I ahve a clock project I am working on with Large custom made 7 segments display controlled by MAX7219 chip. With my close to not existant electronic skills. I was planning to use following leds.
100 sztuk/partia led 5mm słomkowy kapelusz białe światło led diody świecące 4.8mm wody jasne ultra jasny szerokokątne led|light emitting diode|emitting diodewide angle led - AliExpress
When I bought them I did not see what forward voltage they have . Max 7219 is capable to lit 64 leds on the 8x8 matrix. Would it be posible to lit 28 of these or will I have a problem.

I will connect the module now with the capacitor and let you know if it works

Unfortunately the capacitor did not help:(


Then the others must have a wiring problem.
Do you have a DMM to check continuity of your pcb tracks.?
Can you show us a picture of the other side of your PCB please, a malfunctioning PCB preferably.

What do you mean, have you still got a PCB that works?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Here it is.

I have the same problem on two PCBs so this is why I said I do not thing it is a sloldering issue.

So uptill now I soldered components on 3 PCB boards. One worked and the other two do not with the same behaviour.

I checked with multimeter the connection between the 6 header male pins to ST_Cp, ST_CH, Data,GND and VCC and it does work.

If it was a soldering and something was not connected then it would not work. But it does as expected when I touch ST_CP pin but just for 3-5 sec


That sounds as if the ST_CP pin is floating and not connected to the Nano.

Have you gone over solder joints on the DIP socket, adding a little more solder, some of your joints don't flow solder right through the hole.

Tom... :grinning: :+1: :coffee: :australia:

I did add solder to ST_pc pin. I will do this again giving it a bit of extra. But what are the chances of making the same soldering mistake twice. Is there a possibility that the stpc gets somehow disturbed by something else?

If in fact this is a case of STPC being not properly connected how would we then explain the fact that by bearly touching it , the module springs to life

Nothing works. It is driving me up the wall.
Here is the picture with a lot of solder added. Multimeter shows the St_pc connection works from Header pin to dip socket where shift register is plagged in.

On the picture you also see the capacitor. hopefully I connected it properly