Using CD74HC4067 with MAX6675 to read temperature by k-type thermocouple


I would like to read the temperature values ​​of 16 different points with Arduino, a 16-channel multiplexer (CD74HC4067) and MAX-6675 k-type thermocouple.

I have used MAX6675 and CD74HC4067 separately before, but this is the first time I have used both.

Circuit drawing is as follows:

I made all the necessary connections of the 16 channel multiplexer to Arduino and connected the signal (COM) port to the plus input port of MAX6675.
I made all the connections of MAX6675 as shown.

What I want to do is this;

I want the multiplexer to send the analog value to MAX6675 by changing the read address for each temperature value. In this way, I want to read the temperature value over MAX6675. But when I read it over MAX6675 it doesn't get any value. I get zero.

My Arduino codes are as follows.

#include <Mux.h>
#include <max6675.h>
Mux mux;
//Mux control pins
int s0 = 6;
int s1 = 7;
int s2 = 8;
int s3 = 9;

int thermoDO = 12;
int thermoCS = 10;
int thermoCLK = 13;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

//Mux in "SIG" pin
int SIG_pin = 0;

void setup(){
  pinMode(s0, INPUT); 
  pinMode(s1, INPUT); 
  pinMode(s2, INPUT); 
  pinMode(s3, INPUT); 
  pinMode(thermoCS, OUTPUT); 
  pinMode(thermoDO, INPUT); 
  pinMode(thermoCLK, OUTPUT); 
  digitalWrite(s0, HIGH);
  digitalWrite(s1, HIGH);
  digitalWrite(s2, HIGH);
  digitalWrite(s3, HIGH);
  mux.setup(s0,s1,s2,s3,SIG_pin); // initialise on setup
void loop(){
  for(int i = 0; i < 16; i ++){
    Serial.print(" = ");
int readMux(int channel){
  int controlPin[] = {s0, s1, s2, s3};
  int muxChannel[16][4]={
    {0,0,0,0}, //channel 0
    {1,0,0,0}, //channel 1
    {0,1,0,0}, //channel 2
    {1,1,0,0}, //channel 3
    {0,0,1,0}, //channel 4
    {1,0,1,0}, //channel 5
    {0,1,1,0}, //channel 6
    {1,1,1,0}, //channel 7
    {0,0,0,1}, //channel 8
    {1,0,0,1}, //channel 9
    {0,1,0,1}, //channel 10
    {1,1,0,1}, //channel 11
    {0,0,1,1}, //channel 12
    {1,0,1,1}, //channel 13
    {0,1,1,1}, //channel 14
    {1,1,1,1}  //channel 15
  //loop through the 4 sig
  for(int i = 0; i < 4; i ++){
    digitalWrite(controlPin[i], muxChannel[channel][i]);
  //read the value at the SIG pin
  //int val = digitalRead(SIG_pin); // It's doesn't work
  //int val = analogRead(SIG_pin); // It's doesn't work
  int val = thermocouple.readCelsius();
  //return the value
  return val;

Can you help me solve my problem?
If you have suggestions about circuit drawing and codes, I would be pleased to hear, do not hesitate.

Thank you so much.

Hmm, I am sure this question was asked recently but I cannot find it.

You cannot multiplex thermocouples with CMOS multiplexer chips. :cold_sweat: It has been suggested you might use relays but even that requires great design care.

You need to use one MAX6675 per thermocouple.