Go Down

Topic: 4051 issue: false positive each 4 buttons (Read 1 time) previous topic - next topic


Hello there, I am using n. 2 4051 to control 16 pushbuttons on one Arduino. On breadboard everything went fine. Now I soldered the circuit on a prefboard and I have a quite weird issue: when I press a button it usually mess up with the 4th button preceding or following. More precicely
press 0 --> 0 and 4 appear ON
press 1 --> 1 and 5 appear ON
press 2 --> all OFF
press 3---> all OFF
press 4 --> all OFF
press 5--> 1 and 5 appear ON
and so on...
I tried with the multimeter to test resistance between joints and all seemed to be fine, but I guess there is a problem, but I cannot figure out where.
Any suggestion would be much appreciated. Thank you.


Sorry for bothering, figured out: stripped wires on the top of the pref board (the non conductive side) were touching themself.


Unfortunately the topic is still open.
The problem came out again and I start believing it's not about the stripped wires which are now separated one from the other.
I explain you the exact configuration, so maybe someone can help.

I have n.2 4051 chained togheter. S0 goes to pin 8, S1 to pin 7, S2 to pin 4 (all digitalPins).
To make it clear from now on I call S0(1), S1(1), S2(1) the pins from the first 4051, while S0(2), S1(2), S2(2) those from the second.

When not powered all joints (even testing directly on the ic) appear correctly chained together: resistance beteween
S0(1) and S0(2)
S1(1) and S1(2)
S2(1) and S2(2)
is 1.8Ohm

S0(1) and S1(2)
S0(1) and S2(2)
S0(1) and S1(1)
S0(1) and S2(1)

there is no resistance.

When powered:
S0(1) and S0(2)
S1(1) and S1(2)
S2(1) and S2(2)
is 1.8Ohm

S0(1) and S1(1)
S0(1) and S1(2)
S0(2) and S1(2)
is 44Ohm

S0(1) and S2(1)
S0(1) and S2(1)
S0(2) and S2(2)
there is no resistence

this is the test code I am using to check the buttons
Code: [Select]
ALWAYS CHECK THE INPUT S0, S1, S2!!!!!!!!!!!!!!!!!!!!!!!

///////////INPUTS VARIABLES////////////
int h;
int s0 = 8;
int s1 = 7;
int s2 = 4;
int sensorNumber;
int threshold = 100;
int mux4051InPin[2] = {
  0, 1};   
int result_mux4051OneInPin[8] = {
int result_mux4051TwoInPin[8] = {


void setup(){
  pinMode(s0, OUTPUT);
  pinMode(s1, OUTPUT);
  pinMode(s2, OUTPUT);

void loop(){
  for(int i=0; i<8; i++){
    digitalWrite(s0,bitRead(i, 0));
    digitalWrite(s1,bitRead(i, 1));
    digitalWrite(s2,bitRead(i, 2));
    for(int e = 0; e<2; e++){
      sensorNumber = (i+(8*e));
      Serial.print("Sensor n.");
      Serial.print (sensorNumber);
      Serial.print(" is ");
      if (e == 0){

        result_mux4051OneInPin[i] = analogRead(mux4051InPin[e]);
          Serial.println(result_mux4051OneInPin[i] );

      else if (e == 1){
        result_mux4051TwoInPin[i] = analogRead(mux4051InPin[e]);


    }// efor loop end
  }//main for loop end
}//main void end

Please someone can help me? The problem is on the circuit (everything worked fine on breadboard and also on the prefboard until today) but I cannot figure out what's the problem.


Think I figured out: cold joint between the wire goint to the S2 wire header and Arduino pin  :smiley-eek-blue:

Go Up