2 Replies Latest reply on Aug 20, 2014 11:09 PM by fusionstein

    Thermocouples with Intel Galileo


      I'm documenting my use of the Playing With Fusion MAX31855K Thermocouple Amplifier with the Intel Galileo (Gen 1) on Windows 7 for the benefit of all. I'm new to Galileo, so this discussion is friendly to someone just getting started with Galileo.


      Prerequisites: Ability to open files in a text editor such as Notepad++. Ability to comment out lines in C++. Ability to solder and make electrical jumper connections.


      I bought a 5 pack of bare type K thermocouples online from Omega. The red lead is the minus lead.

      I bought Playing With Fusion's Playing With Fusion - MAX31855 K-Type Thermocouple Sensor Breakout (1ch) for $19, but shipping was a nasty $11. I would have bought Adafruit's product, but it was sold out.

      I considered using the themocouple sensor with an Arduino, but I quickly realized that the Arduino wants 5V inputs and the thermocouple sensor only gives 3.3V out. I cried when Playing With Fusion's tech support told me I would need to buy a level switcher. Sure, the level switcher is less than $10, but I am not paying them again for expensive shipping. When I found out Intel Galileo has a jumper on it to accept 3.3V, I made the switch to Galileo.


      First, set up your Galileo according to the Getting Started Guide. (USB driver, special Arduino program for Galileo [make sure to unzip it to C:\], firmware update, etc). Test it with the blink example. Test it again by changing the time of the blink, maybe 5 seconds for visual confirmation.


      Next move the jumper on your Galileo board labeled IOREF to 3.3V.


      Playing With Fusion confuses users with its support documents. Under Related Files, they include this example sketch that you need:

      They might as well rename it to 1 ch (channel) because they intend for the user to use the 1 channel product with the 4 channel example sketch (tech support confirmed this). Unzip it to your Arduino folder.


      You also need the library (unzip it into your Arduino\libraries folder in your Documents):

      One more Playing With Fusion confusion: The breakout board is labeled wrong: mine says "MAX31885K". They acknowledge this as a screen printing typo on their product webpage.


      Now we get down to business:

      There are a few minor code changes because we are using Galileo.

      First, you need to grab the AVR pgmspace library for Galileo. Follow the solution in this Intel discussion: Missing avr/pgmspace.h


      Edit: To avoid having to do the code changes below, just use the attachment in the reply below.


      Next, you will realize that util/delay.h is not included with the Galileo version of the Arduino IDE. The quick fix is to go into PlayingWithFusion_MAX31855_1CH.h comment out the line "#include "util/delay.h"" (around line 47). Next, go into PlayingWithFusion_MAX31855_1CH.cpp and replace "_delay_ms(1)" with "delay(1)" around line 118. This discussion gives more details, but I said enough: Re: BMP085 Library Error


      Now you have a choice:

      You could comment out the 3 of the 4 channels that you don't need in max31855_4ch_spi_example.ino. I kept channel 0 (and commented out 1, 2, and 3) since I bought the 1 channel breakout board. Maybe you have the four channel breakout board, so don't comment out the other three channels.



      Themocouple Sensor to Galileo:

      SCK to Galileo 13.

      SDO to Galileo 12.

      CS to Galileo 10.

      3.3V to 3.3V.

      GND to GND.


      If you are using the 4 channel breakout board, the wiring is given around line 50 of max31855_4ch_spi_example.ino.


      Lastly, upload your sketch to Galileo and then Tools -> Serial Monitor.


      I hope this helps.


      Message was edited by: Christopher Pannier

        • 1. Re: Thermocouples with Intel Galileo

          Attached are my example sketch and libraries so that you don not have to do the edits yourself. Unzip this to your Arduino folder.

          • 2. Re: Thermocouples with Intel Galileo

            Hi TexasAggie,


            Thanks for your useful post! I am an owner/engineer at Playing With Fusion, Inc., and this information will be useful to me when customers contact us in the future - especially regarding Galileo board interfacing. We do have a couple new products that design in the MAX31855 IC if you're interested, and yes, we fixed the silkscreen issues! Something you may not have encountered is the linearity assumption that is made by the MAX31855 chip. We are working on an application note regarding temperature correction, with the biggest benefits seen at very low temperatures (all thermocouple types) as well as higher temperatures (J-type and T-type, especially).


            Thanks again for your work, as well as your business!

            -fusionstein, owner/engineer, Playing With Fusion, Inc.