Hi, I am new to Arduino and the forum. I have been fiddling for about a month now and one of my first projects is connecting a K type thermocouple to a Nano board to measure some temperatures on a piston engine. I have managed to copy/paste/modify code enabling me to read one thermocouple. I would be appreciate for a novice like myself if someone could advise how to connect multiple thermocouple (4 in my case) to a nano board with the additional code required. This is what I have successfully used so far
Average Thermocouple
Average Thermocouple
Reads a temperature from a thermocouple based
on the MAX6675 driver and displays it in the default Serial.
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(9600);
thermocouple = new MAX6675_Thermocouple(SCK_PIN, CS_PIN, SO_PIN);
}
// the loop function runs over and over again forever
void loop() {
// Reads temperature
const double celsius = thermocouple->readCelsius();
const double kelvin = thermocouple->readKelvin();
const double fahrenheit = thermocouple->readFahrenheit();
// Output of information
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.print(" C, ");
Serial.print(fahrenheit);
Serial.println(" F");
delay(500); // optionally, only to delay the output of information in the example.
Not compiled, not tested. Give it a try, if it works as expected it can be optimised; each time you start numbering variables (like I did), you should start thinking about arrays.
// Edit
Changed the second double celsius = thermocouple2->readCelsius(); to celsius = thermocouple2->readCelsius();. Copy/paste error, sorry.