MAX6675
-
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); }
-
Nice, thanks for the example.
Please enclose the source code between 4 backtick characters to format it correctly in the forum.
Backtick == ` x 4
-
Can you share the wiring diagram ?
-
@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.
-
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
-
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.
-
I can not understand that!
I have not Radio my Arduino ist connect per USB.
-
@wthiess How do you plan to communicate with any sensors/actuators if you have no radio/supported transport attached???
-
Paspberry > USB > Ardunino-max6675
-
@wthiess You need to use a supported transport.
-
USB / Serial
/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700RH5J-if00-port0@9600
-
@wthiess I suggest you read up on what MySensors is.
Here is a good start: https://www.mysensors.org/about/network
-
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
-
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.pdeError:
MAX6875Temp.ino: In function 'void loop()':MAX6875Temp:24: error: 'class MAX6675' has no member named 'read_temp'
temperature = temp.read_temp();
Suggested Topics
-
💬 MyMultisensors
OpenHardware.io • 15 Apr 2016, 23:39 • openhardware.io 17 Feb 2023, 18:35 -
💬 MySFreezer - Node for Freezer and Lab Equipment monitoring
OpenHardware.io • 12 Dec 2016, 06:13 • openhardware.io 12 Dec 2016, 06:13 -
💬 Floor heating controller
OpenHardware.io • 14 Oct 2017, 18:26 • openhardware.io 15 Oct 2017, 09:49 -
💬 LoRa ESP32 Low Power Lerning Board
OpenHardware.io • 8 May 2019, 08:49 • openhardware.io 8 May 2019, 08:49 -
Basement Monitor
My Project • 3 Apr 2016, 21:27 • micah 8 Apr 2016, 16:43 -
Calculate Delta T of two temperature sensors with lua
Domoticz • 5 Oct 2022, 10:06 • Mela 5 Oct 2022, 10:06 -
RGBW LED Controller
OpenHardware.io • 26 Jan 2016, 14:35 • openhardware.io 20 Mar 2016, 16:51 -
Binary / Temp sensor help - sleep time
Development • 16 Nov 2014, 05:21 • niccodemi 17 Nov 2014, 05:08