Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. MAX6675

MAX6675

Scheduled Pinned Locked Moved Development
temperature
14 Posts 5 Posters 8.3k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mrlynx
    Hardware Contributor
    wrote on last edited by Mrlynx
    #1

    I have gotten a maxim MAX6675 board and a K-type thermocouple for measuring high temperatures working with mysensors and thought I would share my sketch.

    board is off ebay http://www.ebay.com/itm/301283128770

    I have found a library written by ryan j mclaughlin on github https://github.com/ryanjmclaughlin/MAX6675-Library

    #include <MySensor.h>  
    #include <MAX6675.h>
    #include <SPI.h>
    
    uint8_t CS0 = 4;              // CS pin on MAX6675
    uint8_t SO = 3;              // SO pin of MAX6675
    uint8_t SCLK = 5;             // SCK pin of MAX6675
    uint8_t units = 1;            // Units to readout temp (0 = ˚F, 1 = ˚C)
    float temperature = 0.0;  // Temperature output variable
    float lastTemperature;
    unsigned long SLEEP_TIME = 30000; 
    boolean metric = true;
    MySensor gw;
    
    MyMessage msg(0,V_TEMP);
    
    // Initialize the MAX6675 Library for our chip
    
    MAX6675 temp0(CS0,SO,SCLK,units);
    
    void setup()  
    { 
    
    
      // Startup and initialize MySensors library. Set callback for incoming messages. 
      gw.begin(); 
    
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Max6675 Temperature Sensor", "1.0");
    
      // Present all sensors to controller
     
      gw.present(0, S_TEMP);
      
      Serial.begin(115200);
      
    }
    
    void loop()     
    {     
      // Process incoming messages (like config from server)
      gw.process(); 
      
      temperature = temp0.read_temp();         // Read the temp
      
      if(temperature == -1) {                   // If there is an error with the TC, temperature will be -1
        Serial.println("Thermocouple Error!!"); // Temperature is -1 and there is a thermocouple error
      
      } else {
        Serial.print("Current Temperature: ");
        Serial.println( temperature );          // Print the temperature to Serial 
        if (temperature!=lastTemperature)
          gw.send(msg.setSensor(0).set(temperature,1));
        lastTemperature=temperature;
      }
      
      gw.sleep(SLEEP_TIME);
    }
    

    http://www.sa2avr.se

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Nice, thanks for the example.

      Please enclose the source code between 4 backtick characters to format it correctly in the forum.

      Backtick == ` x 4

      1 Reply Last reply
      0
      • Ezequiel TorresE Offline
        Ezequiel TorresE Offline
        Ezequiel Torres
        wrote on last edited by
        #3

        Can you share the wiring diagram ?

        M 1 Reply Last reply
        0
        • Ezequiel TorresE Ezequiel Torres

          Can you share the wiring diagram ?

          M Offline
          M Offline
          Mrlynx
          Hardware Contributor
          wrote on last edited by
          #4

          @Ezequiel-Torres I did just connect pin 3,4,5 and vcc,gnd to module and sensor to module. Look in example code for directions.
          Example is made for mysensors 1.4 or 1.5 so may have to modify it a bit.

          http://www.sa2avr.se

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wthiess
            wrote on last edited by
            #5

            Hy i

            IDE upload:

            MySensors.h:328:2: error: #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

            Bleas help

            lg
            Wolfgang

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mrlynx
              Hardware Contributor
              wrote on last edited by
              #6

              example has to be converted to 2.x of mysensors.
              To do so you need at least to add
              #define MY_RADIO_NRF24
              remove all gw.
              please look at any 2.x example to see what have changed.

              http://www.sa2avr.se

              1 Reply Last reply
              0
              • W Offline
                W Offline
                wthiess
                wrote on last edited by
                #7

                I can not understand that!
                I have not Radio my Arduino ist connect per USB.

                AnticimexA 1 Reply Last reply
                0
                • W wthiess

                  I can not understand that!
                  I have not Radio my Arduino ist connect per USB.

                  AnticimexA Offline
                  AnticimexA Offline
                  Anticimex
                  Contest Winner
                  wrote on last edited by
                  #8

                  @wthiess How do you plan to communicate with any sensors/actuators if you have no radio/supported transport attached???

                  Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    wthiess
                    wrote on last edited by
                    #9

                    Paspberry > USB > Ardunino-max6675

                    AnticimexA 1 Reply Last reply
                    0
                    • W wthiess

                      Paspberry > USB > Ardunino-max6675

                      AnticimexA Offline
                      AnticimexA Offline
                      Anticimex
                      Contest Winner
                      wrote on last edited by
                      #10

                      @wthiess You need to use a supported transport.

                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                      1 Reply Last reply
                      0
                      • W Offline
                        W Offline
                        wthiess
                        wrote on last edited by
                        #11

                        USB / Serial
                        /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700RH5J-if00-port0@9600

                        AnticimexA 1 Reply Last reply
                        0
                        • W wthiess

                          USB / Serial
                          /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700RH5J-if00-port0@9600

                          AnticimexA Offline
                          AnticimexA Offline
                          Anticimex
                          Contest Winner
                          wrote on last edited by
                          #12

                          @wthiess I suggest you read up on what MySensors is.
                          Here is a good start: https://www.mysensors.org/about/network

                          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            Mrlynx
                            Hardware Contributor
                            wrote on last edited by
                            #13

                            If you are not going to use mysensors look at library example
                            https://github.com/mcleng/MAX6675-Library/blob/master/examples/read_temp/read_temp.pde

                            http://www.sa2avr.se

                            1 Reply Last reply
                            0
                            • W Offline
                              W Offline
                              wthiess
                              wrote on last edited by
                              #14

                              If you are not going to use mysensors look at library example
                              https://github.com/mcleng/MAX6675-Library/blob/master/examples/read_temp/read_temp.pde

                              Error:
                              MAX6875Temp.ino: In function 'void loop()':

                              MAX6875Temp:24: error: 'class MAX6675' has no member named 'read_temp'

                              temperature = temp.read_temp();

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              15

                              Online

                              11.7k

                              Users

                              11.2k

                              Topics

                              113.1k

                              Posts


                              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • MySensors
                              • OpenHardware.io
                              • Categories
                              • Recent
                              • Tags
                              • Popular