Serial Data Transfer Between 2 Arduinos Using 433MHz RF

Hi

I have a 433Mhz Transmitter and Receiver and they seem to work well with the VirtualWire library. I can send text from the first Arduino and receive it on the second Arduino without ant problems. I want to have a Temperature Sensor (LM35DZ) connected to the first Arduino and for that to send temperature measurements to the second Arduino, say every 10 seconds.

Any help with the TX and RX code would be appreciated

Thanks

I can send text from the first Arduino and receive it on the second Arduino without ant problems.

That's good, because dealing with ants on the Arduino is not a easy task.

Any help with the TX and RX code would be appreciated

What help do you need? Seems the simplest thing to do is convert the temperature to a string and send that string (text). Is the temperature an int (itoa()) or a float (dtostrf())?

Hi

Thanks for getting back to me.

Yes, that was a typo; it should have been 'any'

The temperature is and (itoa())

As I'm (very) new to this, I need help to convert the temperature to a string and send that string, as you suggested

Thanks

The temperature is and (itoa())

This doesn't make sense. If the temperature is an int, you can use itoa() to convert it to a string to send.

OK

Another typo - 'and'' shouldn't be in there. I was trying to do this from memory as I was away from the laptop that has the sketches on. I have access to the sketches now and have managed to convert the temperature to a string and display this on an LCD. What I need is the code to send this from one Arduino and the code to receive it on another Arduino.

Apologies (and in advance) for any typos

OK

Read temperature-
Temp = (5.0 * analogRead(tempPin) * 100.0) / 1024;

Convert integer to Char array -
itoa(Temp,S2Msg,10);

Transmit -
vw_send((uint8_t *)S2Msg, strlen(S2Msg));

Sorted!