Basically I have a Arduino Mega using about 30 digital pins. I'm trying to power 30 light sensors, it works with a dozen or so but if I add more than that its more than the ~500mA @ 5V it can output. I have a 2A @ 5V power adapter but my design needs the arduino to turn up the pins.
Is there any way to "inject" the additional 2A @ 5V into the arduino?
Why do you want to power them through it? Instead of just powering them directly, connect gnd from the power supply and the arduino, and then just look at the feedback from them?
Yeah I could do that, but I wanted one design for different Arduino's, so I wouldn't need the extra power supply for the mega vs non-mega versions of the code.
One small problem, if I don't set the pins to be HIGH (+5V) then I have a floating input when I set it to LOW instead, and it flip-flops on all the pins...
pinMode(i, INPUT);
digitalWrite(i,LOW); // when HIGH there is no floating input problem
You need to have more sensors that it can, but they are not all wired up(in?) all the time?
This is a pull down resistor, to pull the floating value down to zero, you can do the same, and then use the sensors to pull it up, instead of the switch.
But then instead use an external 5V supply to pull it up.
Oh duh, nevermind. I forgot that the prototype on my desk here doesn't have that, and the breadboard at location does. I'm sure it will work as soon as I plug it back in! Thanks again!