Shop OBEX P1 Docs P2 Docs Learn Events
Thermocouple interface with BS2p — Parallax Forums

Thermocouple interface with BS2p

lindseydallaslindseydallas Posts: 14
edited 2014-12-14 04:03 in BASIC Stamp
Hello,

I need to interface two J-type thermocouples with a BS2p. I would like to use a 1-wire serial interface to do this. Looking through the forums, it looks like people used to use the MAX6675 thermocouple to digital converter IC chip or the DS2760 Thermocouple Kit from Parallax, but both of these solutions are no longer available. Maxim Integrated does offer the MAX31850 thermocouple to digital converter chip but it is not your standard chip with through-hole legs. It comes in a TDFN package, which seems to mean really tiny and basically impossible to solder without special equipment.

That being said:
What are people using these days to read thermocouples with a BS2p?

Thanks!

Comments

  • Tracy AllenTracy Allen Posts: 6,656
    edited 2014-12-12 11:14
    There is a recent discussion of this on the "Suggestions to Parallax" forum.

    The MAX31850 would be an interesting update, but yes, the TDFN. Why do you want to do this one-wire?

    The MAX31855 is a good alternative using SPI. More wires of course. Myself, I use mainlhy the ADS1115, a 16 bit ADC with internal programmable gain amplifier that can read thermocouples directly over I2C. There is also the ADS1118 which has an internal temperature reference and is meant specifically to read two fully differential thermocouple channels.
  • lindseydallaslindseydallas Posts: 14
    edited 2014-12-14 04:03
    Thanks for getting back to me. How funny that I posted so soon after the other user on the "Suggestions..." page!

    We want to stay with the 1-wire setup because we are already connecting to a A2D converter, the I2C 12-Bit, 8-CH Analog-to-Digital Converter from GraviTech, and it uses I2C serial connection, which is actually two pins, clock and data, but as I understand it we will be able to connect to these same pins with a thermocouple to digital converter that allows the 1-wire setup. So the basic answer is that we are trying to save pin space. The basic basic answer is that the 1-wire setup is what my boss told me to find and I'm still learning how to do this type of design. I'll look into the A2Ds that you suggest below, and also the options on the other post.

    We do have RS-485 capabilities since we are communicating with a Modbus device and if nothing else I can probably find something from Omega or similar that would be another drop on that network. But, the code I wrote for that is kind of clunky, not straightforward like the I2CIN/I2COUT commands so I've been hoping it doesn't come to that. Plus it would be much cheaper to design in our own chip that to buy a stand alone option.

    Thanks again!
  • Just in case anyone else is having this same problem, I wanted to touch base with the topic again and say what I ended up doing:

     I ended up using a MAX31850J chip that I bought from DigiKey.  Now, Adafruit has a breakout board for the Max31850 K chip that is really nifty and makes this problem really easy.  BUT, since we wanted to use a J thermocouple, it was decided that it was easier to build our own circuit rather than desolder the K chip from the breakout board and resolder the J chip.  So, that's what we did ("we" meaning that my boss told me to do it).  If you do this, I suggest you use the EAGLE files on the breakout board supplied by Adafruit and also carefully read the spec sheet on the MAX31850 since there are some caps you'll need to filter noise.  And, it IS POSSIBLE to solder a surface mount chip!!!!  I purchased a hot air soldering torch (I went with Dremel because it had lots of other cool attachments besides the hot air tip) and some flux and just had to BE PATIENT!  Don't get the torch too close to the chip or you will melt it and don't try pulling the chip off the pads unless they are completely desoldered or you will just rip the pads off the board.  This was a very frustrating and very rewarding task but I can verify that it is possible even those these TDFN chips are so darn tiny.

    Now, on to the code: first, you're going to need to get the unique ID for each chip.  If you only have one chip its not a problem, but I was using two.  I think it was Tracy Allen in another post that recommended connecting each one by itself and getting the ID, then putting the ID in your main code.
    here is my code for that:
    [/noparse][/b]
    '------------------------[  I/O Definitions ]--------------------------------
    ComPin           PIN       0          'BS pin connection to the level shifter A1 pin
    
    
    '------------------------[  Constants  ]-------------------------------------
    RdROM            CON        $33        'read serial number - one device
    
    
    '------------------------[  Variables  ]-------------------------------------
    ID             VAR        Byte(8)         'unique chip id
    i              VAR        Byte            'used in loop
    
    '------------------------[  Initializations  ]-------------------------------
    
    
    '------------------------[  MAIN  ]------------------------------------------
    
    OWOUT ComPin, 1, [RdROM]              ' get serial numbers
    OWIN ComPin, 2, [STR ID8]                  ' get ID
    FOR i = 0 TO 7
      DEBUG HEX2 ID(i)," "                      'show ID, serial num, CRC in hex
    NEXT
    [b][noparse]
    
    
    and now I've run out of characters so I'll have to post the rest in another comment
    
  • Ok, that file is way too long to post so I attached it.  I'm sure there's lots of room for improving the code and making it more efficient and all that but it worked for me and hopefully will help someone else out!

    Oh, forgot to mention that the Max31850 chip will also need a level converter since it talks at 3.3V and the BS talks at 5V. 
  • Ive been looking for this exact code- thanks for posting!
Sign In or Register to comment.