I have a need to read temperature simultaneously at several different points, and my question is how do I address multiple MAX31855s. Do I connect each to the same MIS0, MIS1 and just have different a different CS for each? I'm using hardware SPI on a Mega
Thanks
Multiple MAX31855 / Thermo Couples
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88145
- Joined: Sat Feb 07, 2009 10:11 am
Re: Multiple MAX31855 / Thermo Couples
The Data Out and Clock pins can be shared. You just need to define a unique CS pin for each additional 31855.
- donek
- Posts: 21
- Joined: Tue Dec 02, 2014 1:12 am
Re: Multiple MAX31855 / Thermo Couples
I am doing something similar. I need to be reading two different thermocouples. What I'm struggling with is how to pick the thermocouple I'm reading.
There's a:
Adafruit_MAX31855 thermocouple(CLK, CS, DO);
before my setup
and reading the temp is done with:
double c = thermocouple.readCelsius();
but I'm unclear as to the formatting or the code for two different sensors.
Do you create a
Adafruit_MAX31855 thermocouple1(CLK, CS, DO);
Adafruit_MAX31855 thermocouple2(CLK, CS, DO);
with different CS values.
Please advise.
There's a:
Adafruit_MAX31855 thermocouple(CLK, CS, DO);
before my setup
and reading the temp is done with:
double c = thermocouple.readCelsius();
but I'm unclear as to the formatting or the code for two different sensors.
Do you create a
Adafruit_MAX31855 thermocouple1(CLK, CS, DO);
Adafruit_MAX31855 thermocouple2(CLK, CS, DO);
with different CS values.
Please advise.
- Phil_Rounds
- Posts: 57
- Joined: Thu Aug 07, 2014 5:12 pm
Re: Multiple MAX31855 / Thermo Couples
Yes, you define two instances of the Adafruit_MAX31855, each with different values for CS
- donek
- Posts: 21
- Joined: Tue Dec 02, 2014 1:12 am
Re: Multiple MAX31855 / Thermo Couples
Thanks. I'm a little new to programming in this language ad was not certain if the thermocouple was one of the keywords or something that can be arbitrarily defined by the programmer. I am unable to find any keywords in the keyword document with the librairy, so I'm a little lost on that.PhilRounds wrote:Yes, you define two instances of the Adafruit_MAX31855, each with different values for CS
- adafruit_support_bill
- Posts: 88145
- Joined: Sat Feb 07, 2009 10:11 am
Re: Multiple MAX31855 / Thermo Couples
You define two different instances with two different CS pins:
When you want to read from one you use thermocouple1. When you want to read from the other you use thermocouple2.
Code: Select all
Adafruit_MAX31855 thermocouple1(CLK, CS_1, DO);
Adafruit_MAX31855 thermocouple2(CLK, CS_2, DO);
Please be positive and constructive with your questions and comments.