Shop OBEX P1 Docs P2 Docs Learn Events
DS2760 Thermocouple Kit Driver for Propeller - oddities — Parallax Forums

DS2760 Thermocouple Kit Driver for Propeller - oddities

Timothy D. SwieterTimothy D. Swieter Posts: 1,613
edited 2009-10-13 18:30 in Accessories
Last November I setup a home SMD soldering station using a toaster oven. The setup is documented in another thread, but basically it uses a Propeller protoboard, some added electronics and the DS2760 thermocouple kit from Parallax. The Propeller is control the system and reads an internal temperature of the oven from the thermocouple.

I created a driver for the thermocouple to be used with the Propeller since I didn't see any others posted. I had trouble back when I was first writing the software because the code seems to fail or error at times. I am guessing it is the code, maybe it is hardware. What I am seeing is that sometimes when I start the system the temperature I am getting returned (after processing) is a -1 or error. Sometimes the system starts and is giving a good temperature and as the system is heating up then the temperature will go to -1. It happens as different points in the process and at different temperatures. Sometimes it seems like I can't get it to come out of reporting -1 until I shut down the system and fiddle with the thermocouple itself. So again, I am not sure if it is hardware or software. I have done various levels of troubleshooting and haven't figure it out yet, most of the trouble shooting was months ago.

Since there is a forum here for sensors I thought I would ask for help or someone else to hook up a thermocouple and a Propeller and try out my code. Look it over to see what I may have wrong or to confirm that the code is perfect. In the coming weeks I want to get back into details of my toaster oven system and do some software work, so I can better troubleshoot the thermocouple then, but for now I am hoping someone else can try out the code or offer advice.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com

Comments

  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-21 04:07
    Here is a link to the object in the exchange.

    obex.parallax.com/objects/385/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • Greg LaPollaGreg LaPolla Posts: 320
    edited 2009-02-22 15:30
    Timothy,

    I am using your object. I have modified it to use type J thermocouples. I had to build a new table in the dat section. I am also writing an object using part of your code to use the DS2760 to read a ph sensor probe.

    I am still sourcing some parts to build the ph amplifier as described here

    I will be ordering the DS2760 kit from parallax this week. I should be ready for some testing next week on the thermocouples. Probably a little longer on the ph.

    I would be glad to share my findings and any modifications I make with you.


    Greg
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-22 23:17
    That would be great Greg. I am looking forward to having someone else look through and use the code. Having someone else in the code will help to verify the code is good so I can narrow down if this is a hardware or software problem.

    Yesterday I ran my toaster oven again and right when I turned it on it was giving me the -1 error. I tweaked the end of the thermocouple that does the measuring and then I started getting valid measurements. I don't get it because the wires are twisted together well at the sensing end.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • Greg LaPollaGreg LaPolla Posts: 320
    edited 2009-03-06 16:14
    Timothy,

    Haven't had any time this last week to attack this yet. I will be ordering the thermocouple set today. I have 3 DS2760 Chips to put on my dev board that I am making, I wish they came in a dip. I did manage to get a ph sensor with an amplifier off ebay for 20 bucks so I am set to go. I have a few questions and I noticed you touched on one these these previously.

    First off, did you make any headway using multiple DS2760's on the same pin? From what I am reading this would only be beneficial for getting an aggregate reading across multiple sensors from the same source without knowing the physical address of each chip. I need to monitor temps from 2 different sources and make separate decisions base on those readings. I can't think of an easy way to do this on 1 pin without knowing the address, which would require special code for each board. My solution right now is to put each DS2760 on a separate pin.

    Second, on the ph sensor, it has an amplifier that outputs millivolts, is there a way to get the propeller to read that directly without the use of a DS2760? I think this is possible on the stamp using SHIFTOUT and SHIFTIN, I could be wrong there but I am not up to speed on the stamp yet.


    Greg
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-08 01:59
    Greg -

    I haven't had a need to get drive multiple DS2760 ICs on a single wire, so I can't offer much help there. One-wire busses can have multiple ICs on them and from a glance at the data sheet the DS2760 has a built in 64-bit unique address. You will have to construct your system in pieces, but you should be able to run a test on each IC to determine its address and then put all the ICs together on the bus and communicate with all them using the known addresses.

    For your PH sensor, I can't offer much help there either as I have only used the DS2760 in the thermocouple application. Depending on the range of the sensor you may need to use an Analog to Digital IC (AD IC) or maybe you can construct a simple circuit that charges/discharges a capacitor using an I/O pin. The software then counts time and you can get close to what the voltage measurement, but it isn't precise and depending on the voltage levels of the sensor may not work. There are examples of this elsewhere for the basic stamp and the Propeller (I think). I remember the Toddler kit used this capacitor method to read some IR or light sensors.

    Last time I used my toaster over/DS2760 thermocouple it worked fine. I don't get what is wrong with my setup that it sometimes works and sometimes doesn't. Someday I will need to devote time to this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • Greg LaPollaGreg LaPolla Posts: 320
    edited 2009-03-11 03:19
    Timothy,

    I got my thermocouple kit today. I have found some wierdness.

    So I hooked it up and sometimes it works and sometimes it gives a -1

    here is the code:

    
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
      LCD_PIN   = 4                                        
      LCD_BAUD  = 19_200
      LCD_LINES = 2 
      THERMO_PIN = 15
      
    VAR
      long mashTemp
      long hltTemp
      long phVal
      long timerVal
      long tcStack[noparse][[/noparse]9]
      long myTemp
      
    OBJ
         tc : "DS2760"                                        ' Thermocouple control
        lcd : "serial_lcd"                                    ' driver for Parallax Serial LCD
        num : "simple_numbers"                                ' number to string conversion
      
    PUB Main | idx
    {{Start application.}}
      if lcd.init(LCD_PIN, LCD_BAUD, LCD_LINES)             ' start lcd
        lcd.cursor(0)                                       ' cursor off
        lcd.backLight(true)                                 ' backlight on (if available)
        lcd.cls                                             ' clear the lcd
        lcd.str(string(" Starting Up!", 13))                 
        lcd.str(string(" Calibrating thermcouples ", 13))
         
        tc.start(THERMO_PIN)         
             lcd.cls
        lcd.home
        lcd.str(string("Temp = ", 13))
         
        repeat
          repeat idx from 0 to 255
            myTemp := tc.TCtemp
            ' myTemp := (myTemp * 1.8) + 32
            updateLcd(myTemp) 
            waitcnt(clkfreq / 5 + cnt)                      ' pad with 1/5 sec
            repeat idx from -255 to 0
              ' TODO : figure out multi controllers on one wire
              myTemp := tc.TCtemp
              ' myTemp := (myTemp * 1.8) + 32
              updateLcd(myTemp)    
              waitcnt(clkfreq / 5 + cnt)
    
    PRI updateLcd(temp)
    
      lcd.gotoxy(6, 0)
      lcd.str(num.decf(temp, 3))
    
    
    



    I renamed your object and added a table for type J. I think the problem is the connection of the thermocouple to the ds2760. If I touch the wire, the temp reading will drop to -1. Also touching the bare twisted wire also results in a -1.

    I am fairly convinced the problems you are seeing are related to the connection, not the code.

    I am in the process of designing a board right now that has 3 ds2760 chips on board. It will use screw terminals for the connections which should make a cleaner connection.

    So far it looks like your code is pretty solid. I will be doing more extensive testing on this over the next week or so.


    Greg
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-03-11 04:49
    Any chance your toaster oven el cheapo thermostat is creating an arc when it turns on and off? Might such an arc be inducing a weird pulse through the thermocouple wire?

    Just thinking out loud here...
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-11 15:41
    Thanks for the thoughts and checking the code. I have been through the code several times and always suspect of error checking or out of bounds. I see the same -1, which is what the code defaults to on errors. I am fairly confident in my connecction - mostly, but I find to when I bend or retwist the wires on the bare ends that the signals start showing up fine. Odd.

    ElectricAye - no, I don't think it is an arc of any sort. I don't have a thermostat in my toaster oven, gutted everything but the heating elements and the light bulb and adding my own solid state electronics.

    Greg, I am glad to get some other eyes looking and working with this code. Let me know if you find anything....and in time here I should add the tables for the J-type thermocouple to the listed object so others won't have to add them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • Greg LaPollaGreg LaPolla Posts: 320
    edited 2009-03-15 01:16
    Timothy,

    I am going over the ds2760 pretty hard this weekend. Your driver returns Celsius, so I am trying to convert it to Fahrenheit

    using the following formula

    myTemp := (9/5) * tc.TCtemp + 32

    this way always is about 15-20 degrees off for some reason. Being fairly new to the propeller, I can't make a solid assumption here but it may be because the calculations will not produce integers.

    Could this problem arise from the type of the values being returned from your object? I guess I need to do a little reading in the prop manual and see if the operands are different for doing real math instead of integer math. Any input would be greatly appreciated.


    Greg
  • kwinnkwinn Posts: 8,697
    edited 2009-03-15 17:37
    Timothy, I have found the most common problem with thermocouples is contact problems. Make sure the wires are twisted together tightly at the junction end and are making good contact on the DS2760 board. I would consider changing the two sockets the wires are pushed into for screw on connections if possible. The temperatures the thermocouples work at make corrosion at both ends a problem.

    As for the software, it would be good to indicate when the reading has gone beyond the entries covered by the tables. Say -1 when it is below the lowest entry, and perhaps 9999 when it is above the highest. I worked on some equipment that gave ridiculous readings when the incoming water was below the minimum temperature of the table, and as a result the heater would not come on. Basically the customer ended up waiting a long time until the water warmed up enough to give reasonable readings so the main software could then start the heater.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-16 19:46
    The wire samples included are for testing different probe configurations, however if you're going to use the Thermocouple in an application you should definitely get an actual probe unit. We used one in the following project, which also uses the Thermocouple Module. Take care.

    http://forums.parallax.com/showthread.php?p=637023

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Tim UTim U Posts: 9
    edited 2009-10-13 18:03
    Hello Everyone,
    Does anyone know if you can submerse the DS2760 Thermocouple?
    I want to use it in to interface with the Propeller for the purpose to measure and display (on an LCD) the temperature of the cooking oil. This would require it be submersed into the oil pot. The range of temp would be 0 to 550 degrees F.
    Also can anyone tell me which model LCD on the PARALLAX wed site would be compatible with the Propeller. All the ones I seen seem to be for the Basic Stamp only.

    Thanks
    Tim U.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-13 18:10
    Any of the serial LCDs should work with the Propeller as well. They're all marketed for use with the Stamps, but can be used with pretty much any microcontroller that can produce a serial asynchronous output. There are objects in the Object Exchange for the use of parallel LCDs as well. These use more I/O pins, but can be used with the Propeller.

    Although it's probably not necessary, it's a good idea to use a 2.2K resistor between the Propeller I/O pin and the serial input pin of a serial LCD that runs off +5V. It won't affect the serial I/O signal, but would protect the Propeller's +3.3V I/O pins from accidentally applied +5V signals.

    Post Edited (Mike Green) : 10/13/2009 6:15:25 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-13 18:30
    I don't recommend you immerse the DS2760 thermocouple. It's not designed for that sort of use. The hot junction is just provided by twisting the two wires together. Even though the cooking oil is an insulator, between the expansion and contraction of the wires from the temperature changes and the lubricating effect of the oil, your thermocouple may not hold up for long and a poor contact between the two wires may cause errors. I'd get a thermocouple probe which would have a sealed tube around the thermocouple itself and probably fiberglass insulation inside the tube.
Sign In or Register to comment.