I want to connect 4 MAX6675 thermocouple to arduinoArduino.
MAX 6675 discriptiondescription.
It
It comes with a its own arduinoArduino library . library link.
I
I tested the example code for one sensor and it works perfectly.
Now i Now I want to connect all the four sensors to arduinoArduino using minimum gpioGPIO pins possible .
I connected - (for 2 sensors only for initial testing)
D7 -> clk(slave 1 ) ->clk (slave 2)
D3 -> so(slave 1 ) ->so (slave 2)
D4 -> cs(slave 1 )
D5 -> cs(slave 2):
D7 -> clk (slave 1) ->clk (slave 2)
D3 -> so (slave 1) ->so (slave 2)
D4 -> cs (slave 1)
D5 -> cs (slave 2)
My code (iI modified the original example code a bit):
// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoCLK = 7;
int thermoDO = 3;
int thermoCS = 4;
int thermoCS2 = 5;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
MAX6675 thermocouple2(thermoCLK, thermoCS2, thermoDO);
void setup() {
Serial.begin(9600);
Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
Serial.print("C 2= ");
Serial.println(thermocouple2.readCelsius());
Serial.print("F 2= ");
Serial.println(thermocouple2.readFahrenheit());
delay(1000);
}
I am able to read only one sensor information correctly,other. The other output is nan
Am i. Am I wiring the circuit wrong or is my code is incorrect or both?