A problem with my circuit, shift registers, LEDs and display !! help ?!

hello guys,
i am gonna tell exactly what is happening to my circuit :
i have 12 LEDs connected to a shift register (every 2 leds connected to 1 pin of the shift)
i have 4 7 segment displays (2 digits) connected to 4 shift registers

every shift register is getting GND and 5V and of course connected to arduino

for now i am working with 1 7 segment for testing and the 12 LEDs

what is happening is this : when i remove the +5 from the shift register connected to the 7 segment and the +5 of the shift register connected to the 12 LEDs, the function continue like if everything is in place !!! how the hell this shift register is taking power ?!!

for the display it works (actully i never new how it works because when all the pins are high plus the common high, the pattern showed is 8.)

so any help please ?

Got a schematic, code, part numbers?

CrossRoads:
Got a schematic, code, part numbers?

yes this is the schematics and the display datasheet

What is the shift register? I can't make out the part number.
Looks like 74HC594?

CrossRoads:
What is the shift register? I can't make out the part number.
Looks like 74HC594?
http://www.ti.com/lit/ds/symlink/sn74hc594.pdf

i am sorry i didn't mentioned the register, yes it's the 594

Okay. What is the Vf of your LEDs and display?

Your dual-digit display, how are you controlling the multipexing to that?

You don't have everything connected to +12V and Gnd do you? Surely you are using +5?

CrossRoads:
Okay. What is the Vf of your LEDs and display?

Your dual-digit display, how are you controlling the multipexing to that?

You don't have everything connected to +12V and Gnd do you? Surely you are using +5?

i have written in my notebook the Max voltage of the RGB is 3.2V, about the display mmm i don't know exactly the datasheet doesn't mentioned that unfortunatly

i found the datasheet of the RGB hope it helps

22_5MM_LED_RGB.pdf (135 KB)

CrossRoads:
Okay. What is the Vf of your LEDs and display?

Your dual-digit display, how are you controlling the multipexing to that?

You don't have everything connected to +12V and Gnd do you? Surely you are using +5?

this is the display i am using, it's a Commun Anode but the datasheet doesn't mention any voltage or Vmax !!

http://www.ekt2.com/products/productdetails?ProductId=be2704fe-15ba-4582-9f2d-5e49eeb0eace

The reason I ask about +12V is because that appears to be what you are powering everything from +12V on your schematic.
If you are connecting +12V to IO pins on your Arduino's you will damage the Atmega328s.
So before going any farther:

  • are the LEDs connected to +12V on the common anodes?
  • are the pushbuttons connected to +12V?
  • are the shift register's Vcc pins connected to +12V?
  • are the potentiometers connected to +12V

If any of those are, you need to fix that before going any farther. Nothing should be connected to +12V, only to +5V.
The only thing connected to +12V should be the barrel jack connectors.

CrossRoads:
The reason I ask about +12V is because that appears to be what you are powering everything from +12V on your schematic.
If you are connecting +12V to IO pins on your Arduino's you will damage the Atmega328s.
So before going any farther:

  • are the LEDs connected to +12V on the common anodes?
  • are the pushbuttons connected to +12V?
  • are the shift register's Vcc pins connected to +12V?
  • are the potentiometers connected to +12V

If any of those are, you need to fix that before going any farther. Nothing should be connected to +12V, only to +5V.
The only thing connected to +12V should be the barrel jack connectors.

actully now i am using a +5V and the shift register of the LEDs and the shift Register of 1 7 segment display of 2 digits, and forget about all the others but i put this schematic to how are the shifts and leds connected because it's the only schematic i draw for now

about the arduino and 12V, i connected it to the Vin

Ok, need to see the code running on each arduino next.
Please post for each, use the code tag button #

CrossRoads:
Ok, need to see the code running on each arduino next.
Please post for each, use the code tag button #

ok for now i am using just one arduino which is the arduino number 2

the codes for testing are these :

///Shift register for 12 LEDs
int latchPin1 = 3;
int clockPin1 = 4;
int dataPin1 = 2;
byte leds = 0;

///Shift register for first 2 Digit Display for gear box
int pin11 = 11;
int pin12 = 12;
int latchPin3 = 8;
int clockPin3 = 9;
int dataPin3 = 10;
byte displays2 = 0;

void setup()
{
  digitalWrite(13, LOW);
  
  pinMode(latchPin1, OUTPUT);
  pinMode(dataPin1, OUTPUT);
  pinMode(clockPin1, OUTPUT);
  
  pinMode(latchPin3, OUTPUT);
  pinMode(dataPin3, OUTPUT);
  pinMode(clockPin3, OUTPUT);
  pinMode(pin11, OUTPUT);
  pinMode(pin12, OUTPUT);
  
}

void updateShiftRegisterLEDs(){
  digitalWrite(latchPin1, LOW);
  shiftOut(dataPin1, clockPin1, LSBFIRST, leds);
  digitalWrite(latchPin1, HIGH);
}

void updateShiftRegister2Digit(){
  digitalWrite(latchPin3, LOW);
  shiftOut(dataPin3, clockPin3, LSBFIRST, displays2);
  digitalWrite(latchPin3, HIGH);
}

void loop()
{
  leds = B01111110; //for this format, all LEDs will be on
   updateShiftRegisterLEDs();
   
  digitalWrite(pin11, HIGH);
  digitalWrite(pin12, HIGH);
    
  displays2 = B11111111; //for this format, all LEDs will be on
  updateShiftRegister2Digit();
}

This does nothing as as an output until you set pinMode for it:
digitalWrite(13, LOW);

If you do not have +5 connected to shift register pin 16, and you are applying high signals to other pins, the internal pin protection diodes (See Input Clamp, Note 1 on page 4 of the datasheet) can conduct current to +5 internal to the shift register and provide enough current to operate from.

CrossRoads:
This does nothing as as an output until you set pinMode for it:
digitalWrite(13, LOW);

If you do not have +5 connected to shift register pin 16, and you are applying high signals to other pins, the internal pin protection diodes (See Input Clamp, Note 1 on page 4 of the datasheet) can conduct current to +5 internal to the shift register and provide enough current to operate from.

ok than this way is better isn't it ?

for(int i=0; i<20; i++){
    pinMode(i, OUTPUT);
  }

so what do i have to do ? to solve the problem because pattern are not working as i want, the pattern i always see is 8

firashelou:
so what do i have to do ? to solve the problem because pattern are not working as i want, the pattern i always see is 8

Then you need different values (pattern) for leds or displays2 (whichever you're using).

what do you mean ?
changing this B11111111 ? because if your talking about this bit series i tried to change it which will change the pattern but it didn't work !!

You are using a Common Anode display?
To turn a Common Anode segment on it must go to Gnd (through a resistor.)
[Schematic1.jpg is wrong.]

The Common Anode should go to +5V and
Each segment should be connected to a shift register output pin through a resistor

This should have stayed with the Subject where it originated
is my relay circuit right ? - General Electronics - Arduino Forum

it is connected from shift output to resistors then to display
and the common should be high to make it on, but the pattern that make the 8. shape are 11111111 that's why i feel something so wrong !!

firashelou:
it is connected from shift output to resistors then to display
and the common should be high to make it on, but the pattern that make the 8. shape are 11111111 that's why i feel something so wrong !!

The display and the shift register are connected as shown in the drawing that I've attached?
(Your documentation shows otherwise.)

IMG_1663.jpg