Hello, I have a problem with cascading 50 modules like this: Display Module 7-Segment 2 Digit with 74HC595
Project describtion:
ESM8266 Node MCU V3 is connected to 50 modules linked above, the wifi module is connected only to the first display module and the first display module is cascaded to second display module. To power it i use PC PSU, im almost sure the power isnt a problem, because now it works with 10 wifi modules (5 display module for each wifi).
Problem:
When I connect 5 display modules everything works fine, but when i add more displays (it starts to mess up with 10 displays) it stops working. The first thing is that the bits starts to shift or something and additional segments on displays appear (Most often dots, the first/last bit). When i connect even more displays everything starts to shift and its just a big mess with random segments turned on, whats more funny not only added modules are broken, but all of them. For example adding 11 display module break all the modules. Another thing, i see some patterns in how it breaks, for example on module 2 there is sometimes additional dot when sending digit "1", and there isnt while sending "2" and it shifts to another module.
Solutions that i tried:
- Wire connection isnt a problem, i checked like 10000 times
- There is enough power, it can run 50 displays with 10 Wi-fis easily
- Display or wifi modules aren't destoryed, tested in set of 5 everything works
- I tried to slow down the code, it didnt work
- The data in the code (bits) are correct
What is my futher guess:
I think it might be connected with signal losing it "strenght", i'm not familiar with theory and i dont know how to operate with digital signals.
Parts of code:
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
ESP8266WiFiMulti wifiMulti;
const int latchPin = 2;
const int clockPin = 12;
const int dataPin = 14;
uint8_t numberB[] = {B11000000, //0 _8_
B11111001, //1 3| |7
B10100100, //2 |_2_|
B10110000, //3 4| |6
B10011001, //4 |_5_|.1
B10010010, //5
B10000010, //6
B11111000, //7
B10000000, //8
B10011000, //9
B11111111, //10 blank
B10000110, //11 E
B00101111 //12 r.
};
void updateDisps() {
digitalWrite(latchPin, LOW);
for(int i = endIndex; i >= startIndex; i--){
dispNum(dataArr[i]);
delay(10);
}
digitalWrite(latchPin, HIGH);
}
void dispNum(int numInt) {
// _ _ = (digit2) (digit1)]
int clockDelay = 10000;
if (numInt == -1) { // -1 => Er.
shiftOut(dataPin, clockPin, MSBFIRST, numberB[12]);
delay(10);
shiftOut(dataPin, clockPin, MSBFIRST, numberB[11]);
return;
}
int digit2 = numInt / 10;
int digit1 = numInt % 10;
if (digit2 != 0) { // [2 3] v [2 0]
shiftOut(dataPin, clockPin, MSBFIRST, numberB[digit1]);
delay(10);
shiftOut(dataPin, clockPin, MSBFIRST, numberB[digit2]);
}
else { // [_ 1] v [_ _]
if (digit1 != 0 ) { // [_ 1]
shiftOut(dataPin, clockPin, MSBFIRST, numberB[digit1]);
delay(10);
shiftOut(dataPin, clockPin, MSBFIRST, numberB[10]);
}
else { // [_ _]
shiftOut(dataPin, clockPin, MSBFIRST, numberB[10]);
delay(10);
shiftOut(dataPin, clockPin, MSBFIRST, numberB[10]);
}
}
}
I can't fix it and i'm trying for a while and I really need help with this :((.