Monitoring Temperature Sensor Wirelessly

Hello, im trying to monitor some experimental engine temperature using thermocouple type K with MAX6675 module.

Is it possible to wirelessly monitor MAX6675 with RF 433 Mhz transmitter and receiver module?

Im trying to communicate one Arduino Uno with MAX6675 module and another Arduino Uno with LCD screen.

Yes, although the range will probably be only a few tens of metres, assuming line-of-site. Less of blocked by walls or trees. Zero if blocked by metal.

I dont really mind the transmitting distance now.. But I can't seem to send and transmit the reading to the LCD.

Do you know the code to convert MAX6675 temp reading to msg to send over to LCD via RF433mhz?

The reading only appear on transmitting serial monitor without transmitting to the receiver side serial nor LCD

transmit_msg__book_.ino (382 Bytes)

receiver_msg__book_.ino (731 Bytes)

Please post your code according to forum guidelines.

pardon me..

Here my Transmitter code

#include <VirtualWire.h>
#include <max6675.h>
#include <SPI.h>

int SO = 8;
int CS = 9;
int CLK = 10;
MAX6675 temp(CLK,CS,SO);

void setup() {
  Serial.begin(9600);
  vw_set_tx_pin(12);
  vw_setup(2000);
  
}

void loop() {

  Serial.println(temp.readCelsius()-10);
  delay(1000);
 
}

void send (char *message) {
  vw_send((uint8_t *)message, strlen(message));
  vw_wait_tx();
}

and here is my Receiver code

#include <VirtualWire.h>
#include <LiquidCrystal.h>
#include <SPI.h>
LiquidCrystal lcd (2,3,4,5,6,7);

byte message[VW_MAX_MESSAGE_LEN];
byte msgLength = VW_MAX_MESSAGE_LEN;

void setup() {
  Serial.begin(9600);
  Serial.println("Ready");
  lcd.begin(16, 2);
  vw_set_rx_pin(11);
  vw_setup(2000);
  vw_rx_start();
  
}

void loop() {
  lcd.clear();

  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  if (vw_get_message(buf, &buflen))
  {
    lcd.setCursor(0,0);
    lcd.print("Got:");
    for (int i = 0; i < buflen; i++)
    {
      lcd.write(buf[i]);
    }
    lcd.setCursor(0,1);
    lcd.print("Got:");
    for (int i = 0; i < buflen; i++)
    {
      lcd.write(buf[i]);
    }
    delay(1000);
  }
}

I think my problem is on the transmitter part..

Thanks.

Your transmitter code is not transmitting the temp! All it is doing is printing the temp to serial monitor, waiting a second and repeating. The send() function is not being called. The send() function needs a parameter which is a reference to a character array containing the text to be transmitted. I suggest you use sptrintf() function to write the temp to the character array then you can send the character array and print it to serial monitor.

PaulRB:
sptrintf() function

I suppose that should be sprintf() - one t too many.

Thank you for the respond!
Apparently this is my 1st time using that function..
How can I use the sprintf() function? As in how to write the code using that?

I want to transmit 2 data to other arduino with the LCD..
which are celcius and fahrenheit reading

  Serial.print("Cel.:");
  Serial.println(temp.readCelsius()-10);
  Serial.print("Far.:");
  Serial.println((temp.readCelsius()*9/5)+32);

Can you show me based on how should I transmit the thermocouple temp?

Update*
I already figure out how to use the sprintf() function and I found out that it only work well with positive integers.
So based from How to sprintf a float with Arduino - Yet Another Arduino Blog
I'll use dtostrf function instead as it support negative integers too.

I already manage to transmit the temperature over RF433 Mhz via this coding
Transmitter

#include <VirtualWire.h>
#include <SPI.h>
#include <max6675.h>
#include <SoftwareSerial.h>
#undef int
#undef abs
#undef double
#undef float
#undef round

int SO = 8;
int CS = 9;
int CLK = 10;
MAX6675 temp(CLK,CS,SO);

char msg1[6];

void setup() {
  Serial.begin(9600);
  vw_set_tx_pin(12);
  vw_setup(2000);
}

void loop() {
  Serial.print("Cel.:");
  Serial.println(temp.readCelsius()-10);
  float c = temp.readCelsius()-10;
  Serial.print("Original value1: ");
  Serial.println(c);
 
  char str[50];
  strcpy(str, "String value using dtostrf1: ");
  dtostrf(c, 2, 2, &str[strlen(str)]);
  Serial.println(str);

  Serial.println();
  dtostrf(temp.readCelsius()-10, 6,2,msg1);
  delay(2000);

  vw_send((uint8_t *)msg1,strlen(msg1)); 
  vw_wait_tx();
}

And Receiver

#include <VirtualWire.h>
#include <LiquidCrystal.h>
#include <SPI.h>
LiquidCrystal lcd (2,3,4,5,6,7);

byte msg1[VW_MAX_MESSAGE_LEN];
byte msgLength1 = VW_MAX_MESSAGE_LEN;

void setup() {
  Serial.begin(9600);
  Serial.println("Ready");
  lcd.begin(16, 2);
  vw_set_rx_pin(11);
  vw_setup(2000);
  vw_rx_start();
  
}

void loop() {
  lcd.clear();

  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  if (vw_get_message(msg1, &msgLength1))
  {
    lcd.setCursor(0,0);
    lcd.print("Cel:.");
    for (int i = 0; i < msgLength1; i++)
    {
      lcd.write(msg1[i]);
    }
    delay(2000);
  }
}

I manage to send 1 Data to the LCD which is Celsius attach picture
But I cant seem to figure out how to send 2 Data over which are Celsius & Fahrenheit

temp.readCelsius()-10
(temp.readCelsius()*9/5)+32

Anyone know the coding how to send both reading to LCD16x2?
I need Celsius on (0,1) and Fahrenheit on (0,2) LCD screen position.

Probably better to SEND just one or the other. Then, in the Arduino which has received THE TEMPERATURE, you can present the information in both forms, C and F. It may pay you to use a "bespoke" scale for the temperatures. If you expect, say -10 to 35 degrees C, and you want it to the nearest tenth degree, SEND 0 to 450... and when the number gets to the receiving Arduino, subtract 100 and divide by 10, to turn the number into degees C.... probably quite late in the day. All positive integers are a lot easier to work with than a mixture of +ve and negative, and fractions. Turn "the number" into degrees Celsius, at the last minute, just for the poor weak minded humans reading the display.

KaiserReo:
I already figure out how to use the sprintf() function and I found out that it only work well with positive integers.

Sorry, I was forgetting that sprintf() does not work for double data type on Uno.

But dtostrf is also a good suggestion.

Also possible is to send the double data value in its binary format (I think its only 4 bytes on Uno).

As tkbyd suggests, why not just send the Celsius version of the temp and convert to that other old-fashioned scale on the receiving Uno?

Double and float are the same on Arduino (and indeed 4 bytes of data).
If it's just about the value, it's better to send it in binary format than in human readable format (saves conversions and much less data to transmit).
By doing a simple multiplication you can convert your float into int: *10 and you have the first decimal, good enough for most sensors which are far less accurate than that anyway. Then you can transmit your value in just two bytes.

Thank you for responding all..
Im not quite understand the code as im quite new to this "VirtualWire"

PaulRB:
Also possible is to send the double data value in its binary format (I think its only 4 bytes on Uno).

As tkbyd suggests, why not just send the Celsius version of the temp and convert to that other old-fashioned scale on the receiving Uno?

Im sorry, I dont quite understand on how to convert on receiving uno since its a char and not intergers.
Right now im just sending Celsius as string using dtostrf and it received as char msg..
Im planning to add 9/5)+32 to the received celsius but I need to convert it into interger value before print the result of (Celsius9/5)+32 on LCD.. but im not sure how to work it out..

Also if the binary sending is much easier can you assist me with the code? Im quite new to it..

A char is an 8-bit integer value.
read this - it doesn't matter whether there's a wire or not, the communication is the same.