Analog multiplexer values affected by IC connected to power rail

Hi,

I'm fairly new to programming and very new to electronics. This is also my first post so I apologize if it is unclear.

I'm using a 4067 multiplexer with 4 100k pots connected to 4 of the inputs with the intention of connecting 12 more to use with an IC, the SN76489. The values read in the monitor properly from 0 to 1023 with just the multiplexer set up, but when I connect the power and ground of the SN76489 to the 5V and ground rails on the breadboard (from the 5V and GND pins on the Arduino UNO), the values go up to about 910. When I connect an additional IC (74HC595) the values are a little lower.

I have a 10k resistor from each input pin of of the 4067 to the ground rail, which I'm not sure is helping or not, it was an idea from some posts I've read on these forums. I'm sure there is some fundamental electronics/coding knowledge I am missing which may help (I will be taking more than just intro classes soon) so thought I'd ask if anyone has any ideas. Here is my code to read the multiplexer values:

// setting pins for multiplexer 1
const int mux1A = 8;    // A select pin on 4067
const int mux1B = 9;    // B select pin on 4067
const int mux1C = 10;   // C select pin on 4067
const int mux1D = 11;   // D select pin on 4067
const int muxInhibit = 12; // inhibit pin on 4067, kept low to deactivate
double muxValue[16] = {0}; // array to store mux values for all 16 pins
int mxChan0 = 0;
int mxChan1 = 1;


void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // set pins
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);
  pinMode(A4, INPUT);
  pinMode(A5, INPUT);
  pinMode(mux1A, OUTPUT);               // set direction for mux1 pins
  pinMode(mux1B, OUTPUT);
  pinMode(mux1C, OUTPUT);
  pinMode(mux1D, OUTPUT);
  digitalWrite(muxInhibit, LOW);        // initialize mux1 pins
  digitalWrite(mux1A, LOW);
  digitalWrite(mux1B, LOW);
  digitalWrite(mux1C, LOW);
  digitalWrite(mux1D, LOW);
}

void createMuxValues()
{
  for(int mxVal=0;mxVal<16;mxVal++){
    digitalWrite(mux1A, (mxVal&1)?HIGH:LOW);
    digitalWrite(mux1B, (mxVal&2)?HIGH:LOW);
    digitalWrite(mux1C, (mxVal&4)?HIGH:LOW);
    digitalWrite(mux1D, (mxVal&8)?HIGH:LOW);
    muxValue[mxVal]=analogRead(A0);
    Serial.print("mux value ");
    Serial.print(mxVal);
    Serial.print(" ");
    Serial.println(muxValue[mxVal]);
  }
}

void loop() {
  createMuxValues();
}

Thanks for any advice!

Thanks for any advice!

Please read this:-
How to use this forum
Because your post is breaking the rules about posting code.
Unless you use code tags ( the </> icon ) the forum mangles your code.
Also you will see we need a schematic, words are too vague at this level.

Hi,

Thanks (and sorry) about the code tags. I read through the posting rules but I may forget a few. I posted the full code above and added the code tags. As for schematics, I'm not completely clear on how to make schematics but read a few posts about Fritzing, please let me know if the attached schematic is not clear enough. Here are links to the IC datasheets:

CD4067
74HC595

but read a few posts about Fritzing

Did you read about why we all hate it here?

So you are having a problem when you connect a SN76489 to the 5V and ground rails on the breadboard, but you don't show a SN76489 in that physical layout diagram ( it is not a schematic ). So that becomes tricky.

Also I notice that you have no supply decoupling on any chips, is that real or a mistake in the diagram? If it is real read this:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Measure the voltage between the 5V and ground on the bread board, does it drop when you add the SN76489?

Hi,

I did read that some people feel its limited and buggy but some people seemed to think it was OK for beginners. I will look into some of the other options. Is there one that is generally preferred for the forum? I've seen mentions of Eagle and expresspcb.

There was no SN76489 in the diagram because I didn't really know how to add it with Fritzing. I figured I'd add the 74HC595 since it was doing the same thing.

The lack of supply decoupling is real and not a mistake, this was something I was not aware of. Thank you for the link, I will read more into decoupling capacitors and see if this might fix my problem.

The voltage between the 5V and ground does drop from 10.1 to 10 when the SN76489 is connected, not sure how significant that drop is. Thanks again for all your help.

but some people seemed to think it was OK for beginners

Very few, there are lots that disagree.

There was no SN76489 in the diagram because I didn't really know how to add it with Fritzing. I figured I'd add the 74HC595 since it was doing the same thing.

That is EXACTLY why it is no good for beginners. You knew that but you didn't bother to tell anyone. Even if you did tell them then they have to juggle those changes in their head when they look at the layout diagram and try and make sense of it. When you get good at electronics you will realise how hard that is.

Is there one that is generally preferred for the forum?

Pen and paper then photograph the results. Then you avoid the "their is not a symbol for this part" syndrome. Alternatively a general purpose 2D cad package where you can draw what you want.

The voltage between the 5V and ground does drop from 10.1 to 10

WHAT !
you should be measuring 5V or very close to it not 10.1V
If you really have 10V on the bread board you could have fried everything.

Also you should not be connecting a chip with just power and ground and nothing else. It has inputs that need to be fed otherwise it can become unstable.