Power Supply Issues

so my project has 32 IR sensors that go to the inputs of four 4051 chips which trigger corresponding pins on four 74hc595 chips which trigger 32 relays. in order to get the relays work according to the project i am working on they need to stay on constantly and when triggered by the sensor they turn off for 100ms and then return to their on state.
i have the sensors running on separate regulated power and the arduino is powering all the 4051's. since the 595's are going to be on constantly, i decided to power them with a separate regulated 5v at 1amp. i understand that with all the 595 pins on they use about 70-80ma per chip. is having 1amp going through all four chips too much? these are the relays i am using-http://parts.digikey.com/1/parts/754127-relay-reed-sip-spst-5a-5v-9007-05-00.html
the relays will be turning on these small greeting card audio recorders which individually run on 4.5v battery power and use 123ma. since they will be on constantly (and part of and art installation for 2 weeks) the batteries will surely die and i will need to power them separately too. there are 32, which comes out to almost 4 amps. i figured two 2amp power supplies for two groups of 16 would work. should i regulate this power too? would 5v be too much for them? theres not much info on these greeting card sound recorder things. i also am afraid that when many sensors are triggered (lets say that even though they will be off for 100ms, that the other 8 recorders that are still high on that power supply will then be getting 2 full amps instead of the required 1. will everything be ok?
any help is appreciated. thanks

is having 1amp going through all four chips too much?

You are getting mixed up you do not get 1 Amp going through the chips.

individually run on 4.5v battery power and use 123ma.

Are you sure of this, it sounds like a high voltage.

would 5v be too much for them?

I don't know but it would be best not to try. Power it from 5V but put a diode in series with the power line to drop the voltage a bit.

i also am afraid that when many sensors are triggered (lets say that even though they will be off for 100ms, that the other 8 recorders that are still high on that power supply will then be getting 2 full amps instead of the required 1.

You really should learn something about current and voltage that statement is total nonsense.

You power supply needs to be capable to supply the current requested by the load. If it is capable of supplying more then fine there is no problem the chips will just take what they need. If it is not capable of supplying the required current then you will either fry the power supply or it will shut down if it has over current protection on it.

hey mike, thanks for your help. i know i made some silly statements there.
i have another problem.
in my code, i was checking my sensors one by one and they all work fine until i test the last 4051 chip. i add the same code i would for the chips before it, and when i upload nothing happens for a second, and the on board led of the arduino flashes rapidly. when i remove that section of the code things work fine again. i was thinking maybe it was a power issue? like i said before the arduino is powering the 4051's (one master, four slaves)

It might be power but it might also be lack of decoupling. Each chip needs a 0.1uF capacitor across the supply.
It could also be the code, you will have to post that for us to know.

so i should put a .1uf capacitor on each vin on each chip? thats 13 total, since the 595's have two vin.
here is a section of my code, it gets repeated 4 more times (copy and pasted) just changing the writing for the next pin on the master 4051 and changing which 595 pin gets written.

#include <Shifter.h>
#include <Elapsed.h>
int r0 = 0;      //MASTER value of select pin at the 4051 (s0)
int r1 = 0;      //MASTER value of select pin at the 4051 (s1)
int r2 = 0;      //MASTER value of select pin at the 4051 (s2)
int r3 = 0;      //SLAVE_PRIME value of select pin at the 4051 (s3)
int r4 = 0;      //SLAVE_PRIME value of select pin at the 4051 (s4)
int r5 = 0;      //SLAVE_PRIME value of select pin at the 4051 (s5)
int analogreading[31];


#define SER_Pin 8 //SER_IN
#define RCLK_Pin 10 //L_CLOCK
#define SRCLK_Pin 9 //CLOCK
#define NUM_REGISTERS 4
Shifter shifter(SER_Pin, RCLK_Pin, SRCLK_Pin, NUM_REGISTERS);

void setup(){
Serial.begin(9600);
 pinMode(2, OUTPUT);    //MASTER (s0)
 pinMode(3, OUTPUT);    //MASTER (s1)
 pinMode(4, OUTPUT);    //MASTER (s2)
 pinMode(5, OUTPUT);    //SLAVE_PRIME (s3)
 pinMode(6, OUTPUT);    //SLAVE_PRIME (s4)
 pinMode(7, OUTPUT);    //SLAVE_PRIME (s5)
 pinMode(8, OUTPUT);    //Data
 pinMode(9, OUTPUT);    //Clock
 pinMode(10, OUTPUT);   //Latch
}

void loop ()

{     static Elapsed time;

   digitalWrite(2, LOW);
   digitalWrite(3, LOW);  //master pin 0 for slave 1
   digitalWrite(4, LOW);

   {
   
     digitalWrite(5, LOW); // slave 1 pin 0
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);
  
    {
 
    analogreading[0]=analogRead(0);
    //  Serial.print(analogreading[0]);
    if (analogreading[0]==100)
      {
        shifter.setPin(0, LOW);
        shifter.write();  
      }
  
    if (time.intervalMs () > 100)
      {
        shifter.setPin(0,HIGH);
        shifter.write();
        time.reset ();
      }  
    }

  
     digitalWrite(5, HIGH); // slave 1 pin 1
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);
   {
    analogreading[1]=analogRead(0);
 //   Serial.println(analogreading[1]);
    if (analogreading[1]==100)
    {
      shifter.setPin(1, LOW);
      shifter.write();  
    }

  if (time.intervalMs () > 100)
    {
      shifter.setPin(1,HIGH);
      shifter.write();
      time.reset ();
    }
 
   }

    
     digitalWrite(5, LOW); // slave 1 pin 2
     digitalWrite(6, HIGH);
     digitalWrite(7, LOW);
   {
    analogreading[2]=analogRead(0);
   //   Serial.print(analogreading[2]);
    if (analogreading[2]==100)
      {
        shifter.setPin(2, LOW);
        shifter.write();  
      }
  
    if (time.intervalMs () > 100)
      {
      shifter.setPin(2,HIGH);
      shifter.write();
      time.reset ();
      }
   
    }

     digitalWrite(5, HIGH);  // slave 1 pin 3
     digitalWrite(6, HIGH);
     digitalWrite(7, LOW);
    { 
    analogreading[3]=analogRead(0);
  //Serial.println(analogreading[3]);
    if (analogreading[3]==100)
      {
        shifter.setPin(3, LOW);
        shifter.write();  
      }
  
    if (time.intervalMs () > 100)
      {
      shifter.setPin(3,HIGH);
      shifter.write();
      time.reset ();
      }
      
    }  
   
   digitalWrite(5, LOW); // slave 1 pin 4
   digitalWrite(6, LOW);
   digitalWrite(7, HIGH);
  {
  analogreading[4]=analogRead(0);
  // Serial.println(analogreading[4]);
  if (analogreading[4]==100)
    {
      shifter.setPin(4, LOW);
      shifter.write();  
    }

  if (time.intervalMs () > 100)
    {
    shifter.setPin(4,HIGH);
    shifter.write();
    time.reset ();
    }
  }

   digitalWrite(5, HIGH); // slave 1 pin 5
   digitalWrite(6, LOW);
   digitalWrite(7, HIGH);
  {
  analogreading[5]=analogRead(0);
 //   Serial.println(analogreading[5]);
  if (analogreading[5]==100)
    {
      shifter.setPin(5, LOW);
      shifter.write();  
    }

  if (time.intervalMs () > 100)
    {
    shifter.setPin(5,HIGH);
    shifter.write();
    time.reset ();
    }
  }
   
   digitalWrite(5, LOW);  // slave 1 pin 6
   digitalWrite(6, HIGH);
   digitalWrite(7, HIGH);
  {
  analogreading[6]=analogRead(0);
//  Serial.println(analogreading[6]);
  if (analogreading[6]==100)
    {
      shifter.setPin(6, LOW);
      shifter.write();  
    }

  if (time.intervalMs () > 100)
    {
    shifter.setPin(6,HIGH);
    shifter.write();
    time.reset ();
    }
  }

   digitalWrite(5, HIGH);  // slave 1 pin 7
   digitalWrite(6, HIGH);
   digitalWrite(7, HIGH);
  {
  analogreading[7]=analogRead(0);
 // Serial.println(analogreading[7]);
  if (analogreading[7]==100)
    {
      shifter.setPin(7, LOW);
      shifter.write();  
    }

  if (time.intervalMs () > 100)
    {
    shifter.setPin(7,HIGH);
    shifter.write();
    time.reset ();
    } 
  }

}

since the 595's have two vin.

Where? Pin 16 is the power input where do you think the other one is?

sorry, i was getting confused by pin 10, master reclear, which also goes to power.
i added the capacitors and it didn't help my problem. i did some trouble shooting by adding just one pin at a time from the last 4051 chip (and reloading the code each time instead of just adding all 8 pins at once) and found that the more pins i added, the IR sensors got much more sensitive (not good, to the point where ambient light gives them a high signal) and when i added the final pin, #32, it all stoped working.
i checked the sensor and the wiring for the last pin and everything seems to be fine. i have a 7805 powering the sensors with enough current. the rest of the logic is powered entirely by the arduino. i tried powering all the chips via another 7805 and it did not help the problem.
im puzzled.

Can you post a schematic of how it's all wired? Are there any pull-ups/downs on the sensors or inputs?

i added the capacitors and it didn't help my problem

It matters where you added them, they have to be as close to the chip as possible. Also the layout is important, in electronics, just like other things, scaling up is not simply a matter of adding more stuff.
Can you post a photo as well as the schematic.

hey guys, i have made a rough drawing of my layout here- http://img.photobucket.com/albums/v355/tomkogut/roughlayout.jpg
and heres a picture of it- http://img.photobucket.com/albums/v355/tomkogut/picoflayout.jpg
a few things i came across today - i tested the last 4051 chip by itself and found it to have some different readings than the other ones and when i test the last pin on it, y7, it crashes the whole setup. could it be possible that its just a bad chip? i dont have any extra on hand but ordered some more to see if it helps the problem. as far as pull ups on the sensors i dont think so. heres the datasheet on them - http://www.optekinc.com/datasheets/OPB606-607.PDF
i also did some testing on the greeting card player things and they use 4.5v at 50ma max. any suggestions on a 4.5v regulator?

have made a rough drawing of my layout here

Well it is not a schematic so it is almost impossible to tell if it is designed right.

  1. You need in addition to the capacitors you have on the input and output of the regulator to have some 0.1uF ceramic ones.
  2. It is difficult to see about how the sensor is wired. However you only have a 1K resistor, this is too low for the pull up resistor and to high for the current limiting resistor on the LED. You need two resistors here.

and heres a picture of it

OMG!
I hope you are not going to try and install that and expect it to run for any time. You need proper soldered joints and short interconnections. I would advise making it on strip board with IC sockets.

i tested the last 4051 chip by itself and found it to have some different readings than the other ones and when i test the last pin on it, y7, it crashes the whole setup.

You could just swap the chip with one of the other ones and see if the fault moves with the chip. If not it is the wiring.

Breadboard is great for prototyping, but not very durable. Things fall off. Transfer to soldered veroboard or similar when you have the circuit right.
There are many relays. How mach current do the coils draw? What if they are all on at the same time? Do you have enough current in your power supply?
For a regulator to 4.5V, if you have ample source current and a heat sink, just use an adjustable linear regulator. You set the output voltage you want with two resistors.
Also, if you have 5V, a series diodes per pin will drop output by about 0.5V.

Well first off about the picture of the breadboard. I like clam sauce with my spaghetti.

The next thing you mentioned IR sensors. One of the best ways, meaning cheap and easy, to control ambient IR from influencing your readings is exposed film that is at the ends of rolls. Use that as a filter for the light. Most of the IR gets through and the little bit that you don't want to get through is stopped. Now I have no idea what you are making so that might not be applicable but it does work at filtering out unwanted IR.

Well it is not a schematic so it is almost impossible to tell if it is designed right.

I know, i am working on this project in my free time for a friend who is not as familiar with drawing schematics. i will do so and post it soon.

I like clam sauce with my spaghetti.

yes, dont worry the mess of wires and jumpers is going to find its permanent home on an organized soldered board, just wanted to test everything out first before it was set in stone.

  1. It is difficult to see about how the sensor is wired. However you only have a 1K resistor, this is too low for the pull up resistor and to high for the current limiting resistor on the LED. You need two resistors here.

for every sensor i have 1k going to the led, then no resistor for pin 1. what should i use for both? i apologize but the data sheet for the OPB606A confused me a bit.
could the 1k make the led too weak and not having a resistor on the 5v in on the IR sensor cause it to be too sensitive?

You could just swap the chip with one of the other ones and see if the fault moves with the chip. If not it is the wiring.

i tried this and the problem did move with the chip.

How mach current do the coils draw?

10ma each

thanks for taking the time to look at this for me. i appreciate it.

could the 1k make the led too weak

Yes, I should change it to 220R
It is not clear from your diagram you have got the wiring on the sensor right, it does not match up with the data sheet. I would use a 100K pull up on the output transistor of the sensor.

i tried this and the problem did move with the chip.

Then the chip is fine and it is your wiring, or software.

Grumpy_Mike:

i tried this and the problem did move with the chip.

Then the chip is fine and it is your wiring, or software.

Err should that be it is the chip as the fault moved with it?

Yes of course, I must have miss read the comment, sorry. :blush:

No worries, it wouldn't be the first time I made a mistake :astonished:

hey guys, i got a new chip and everything works like it should... EXCEPT. my power regulators are getting pretty hot. i have one for all the sensors which is only using about 640ma and another powering the arduino and chips. the one powering the arduino and chips is going directly to 5v on the arduino. i took a current reading from the regulator to the main power rail for the chips and it was only 280ma. both 7805 regulators are getting 7.5v at 1amp for input. i know that they "normally" get hot but my setup isnt using much current and theyre getting uncomfortably hot. i checked the wiring and i dont see any shorts anywhere.

680 mA times 2.5V drop equals 2 watts in the surface of a TO-220. That's bound to be hotter than body temperature.