Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Why do I get analog reading to the non connected ports, by taping the piezo in channel 1 ?

The piezo element is only connected to Channel 1 (Arduino A[0] port). The channels Ch 1 – Ch 6 are connected to female mono jacks and the ground(GND) wiring is in series from jack 1, 2 and 3 so on... till the Ch 6 end to the Arduino GND port.

The channels Ch2 – Ch6 have no piezo connected, but still connected to the arduino board. A1-A[5]

This is the serial read... first column is Ch1 … Ch 6.

Taped 3 times

787 0 0 0 0 0 
191 0 0 0 0 0 
19 0 0 0 0 0 
937 123 63 5 0 0 < ch2, ch3 ch4 ERROR !> 
86 0 0 0 0 0 
13 0 0 0 0 0 
507 83 126 16 8 0 < ch2, ch3, ch4 ch5 ERROR !>
21 1 1 0 0 0  < ch2, ch3 ERROR !>
0 0 18 0 0 0 < ch3 ERROR !>

This is the arduino code:

const int singnalLevel = 10;  
boolean treshold = false;

int sensorReading[6];

void setup() {
  Serial.begin(9600);          
}

void loop() {
   int sensorReading[6] = {0, 0, 0, 0, 0, 0}; 
   boolean treshold = false;
   sensorReading[0] = analogRead(A0);
   sensorReading[1] = analogRead(A1);
   sensorReading[2] = analogRead(A2);
   sensorReading[3] = analogRead(A3);
   sensorReading[4] = analogRead(A4);
   sensorReading[5] = analogRead(A5);

  for (int index = 0; index <= 5 ; index++) {        
    if(sensorReading[index] > singnalLevel){
      treshold = true;
    }
  }
    if(treshold){  
        for (int index = 0; index <= 5 ; index++) {        
          Serial.print(sensorReading[index]);   
          Serial.print(" ");  
        }
    Serial.println();  
  }    
  delay(1);  
}

This is the circuit schematic.

schematic

share|improve this question

1 Answer

I'm not sure if this is a valid answer or not, but I'm going to submit it anyway since there is a remote chance that it's helpful.

In other microcontrollers that I've used before, you need to have a settling time between ADC channel reads, or the previous reading is likely to affect subsequent reads. I haven't used the ADC on the Arduino yet, but perhaps there is either a library function you can call so that there will be a processor-dependent sleep / delay that is used when reading ADC channels. In either case, you can easily test this theory out by delaying between ADC channel reads to see if the problem goes away.

share|improve this answer
Good point. Also high resistance loads are especially troubling and on some PICs I've even seen bleed over between analog inputs probably via the analog mux. – kenny May 10 '11 at 17:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.