Piezo activated LEDs

So I've made a drumkit, and I've installed RGB leds and a series of white leds in each pad. Each pad connects to my arduino-based board, Ardweeny, via Cat6 cable. Each output on the ardweeny turns on a mosfet, which turns on the LED string. There are 5 leds per color, and 25 white LEDs right now, there will be more later.

Here is the current script:

//Pin Numbers
const int ledred = 0;
const int ledgreen = 1;
const int ledblue = 2;
const int ledOr = 3;
const int ledw = 4;
const int ledOg = 5;
const int ledYr = 6;
const int ledYg = 9;


//Analog Inputs
const int Ar = 5;
const int Ag = 4;
const int Ab = 3;
const int Ao = 1;
const int Ay = 2;

//Analog readings
int ArVal = 0;
int AgVal = 0;
int AbVal = 0;
int AoVal = 0;
int AyVal = 0;

int wcount = 0;
int wcount2 = 0;
int threshold = 230;

void setup() {
  pinMode(ledred, OUTPUT);
  pinMode(ledgreen, OUTPUT);
  pinMode(ledblue, OUTPUT);
  pinMode(ledw, OUTPUT);
  //all Leds off
  digitalWrite(ledred, LOW);
  digitalWrite(ledgreen, LOW);
  digitalWrite(ledblue, LOW);
  digitalWrite(ledw, LOW);
  analogWrite(ledOr, 0);
  analogWrite(ledOg, 0);
  analogWrite(ledYr, 0);
  analogWrite(ledYg, 0);


}

void loop() {
 //Read the inputs and divide it by 4
 //so its between 0 and 255
 ArVal = analogRead(Ar) / 4;
 AgVal = analogRead(Ag) / 4;
 AbVal = analogRead(Ab) / 4;
 AoVal = analogRead(Ao) / 4;
 AyVal = analogRead(Ay) / 4;


 //Turn on the Leds if they're triggered

 if (ArVal >= (threshold - 20)) {
   digitalWrite(ledred, HIGH);
   wcount++;
 } else {
   digitalWrite(ledred, LOW);
 }
 if (AgVal >= threshold) {
   digitalWrite(ledgreen, HIGH);
   wcount++;
 } else {
   digitalWrite(ledgreen, LOW);
 }
 if (AbVal >= threshold) {
   digitalWrite(ledblue, HIGH);
   wcount++;
 } else {
   digitalWrite(ledblue, LOW);
 }
 if (AoVal >= threshold) {
   wcount++;
   analogWrite(ledOr, 250); //Check orange and yellow vals
   analogWrite(ledOg, 40);
 } else {
   analogWrite(ledOr, 0);
   analogWrite(ledOg, 0);
 }
  if (AyVal >= threshold) {
    wcount++;
   analogWrite(ledYr, 250);
   analogWrite(ledYg, 210);
 } else {
   analogWrite(ledYr, 0);
   analogWrite(ledYg, 0);
 }

  //Every Xth hit, white turns on.
 if (wcount >= 112) {
   digitalWrite(ledw, HIGH);
   wcount2++;
 } 
 if (wcount2 >= 20) {
   digitalWrite(ledw, LOW);
   wcount = 0;
   wcount2 = 0;
 }  
}

It reads the input, checks it against a threshold value, and turns the LED on if its above the threshold. If not, it turns it off. While above the threshold, it adds to a count which turns the white leds after a time. Which is just a cheap way of having them turn on every x hits.. It all worked fine on the test bench, but now with everything hooked up the white is not turning on as often as it should be, and after a few seconds of hitting the piezos, all the LEDs come on. The LEDs don't come on full tho, the yellow LED still shows up yellow(as far as I remember, tested last night). And there is a flicker on the white leds. It all works again for a little bit after hitting the reset button.

Is there a problem with my script, or is it possible that the analog input readings are being flooded somehow? Too much input at one time? I followed the Knock tutorial and have a 1M resistor in parallel with each piezo before connecting to the analog input. Perhaps the resistor isnt enough and I'm overloading the inputs. I'm also powering it by an old computer PSU, and I never got around to attaching a power resistor to keep a steady draw on the 5v rail, so that may be messing with the power.

Try taking each reading twice and putting a delay in between. Throw away the first reading so you get:-
ArVal = analogRead(Ar) / 4;
delay(5);
ArVal = analogRead(Ar) / 4;

This will allow the input capacitors to charge / discharge to the new reading value with the very high impedance you have on the input of the multiplexer.

Adding the delay messes with response time of the pads too much, doesnt pick up every hit.

Also, the whole thing seems to work entirely different when hooked up to USB, then when powered by the PSU. When hooked up via USB, every pad turns on.

Hrm... I just played around with it a little, no delays, but an extra reading of the first analogreading.... and it seems to work now.

the whole thing seems to work entirely different when hooked up to USB, then when powered by the PSU

That is probably due to grounding issues and the high input impedances you have. Anyway glad it works now.

Well. I didnt do a whole lot in the way of changes since I last posted, but I'm having the problem again. Tried asking for help in an electronics channel, the only thing I could get as a suggestion before they decided to leave was to move the 1M resistor from inside the pad closer to the analog inputs, and to disconnect all but one piezo to "see if the tap is just propogating along the object they're all attached to" and "leave the analogs floating" After I disconnected all but one piezo, and moved a resistor down near the inputs, tapping the red was activating the other pads as well, tho nothing was very bright. I then took another look at the wiring and saw that my white leds had been disconnected from the output (they're just temporarily hooked up right now until I figure out a solution of how to get them all hooked up properly). I reconnected the white leds, and after a single tap, all the leds would come on and the whites were pulsing on/off quickly.

Here's some pictures of the pads so you can see how it is actually connected: Inside the pad: http://img713.imageshack.us/img713/8051/p1010054b.jpg The control board: http://img15.imageshack.us/img15/1914/p1010055k.jpg (above and to the right of where it says "Outputs", the light brown wires connected to the brown wire is where the white are connected)

Now seeing as I seem to have fewer problems when my white are disconnected, I'm thinking there is some sort of electrical problem, possibly with the way I have the grounds connected. In the control board picture, the black wires are the grounds. The left row of mosfets connect back to the single point, while the right row connect in a row, then to the spot with the other grounds. Meanwhile the grounds coming from the pads (basically only carrying the signal from the piezo) go straight back to the main connection. The only other thing I can think of with my very limited knowledge of electronics, is that perhaps I'm overloading the analog inputs or something. The only thing I can think of doing with what equipment I have here, is to put some transistors in front of the piezo input, and have the transistor operate the analog inputs. I have 2n7000 transistors here that i can use.

I'm getting very frustrated with this project, and I dont want to spend more money on it. Any help would be appreciated.

Sorry to bump, but does nobody have any idea what could be causing my problems?