Friday, February 13, 2015

[Wireless Room Temperature Monitoring System] Sending a value through RF 433 Mhz Module from an Arduino Pro Mini 5V

Now that i have successfully programmed the Arduino Pro Mini with a simple blink program, i need to take it to the next level and try to send some data through the TX 433 Mhz module.

For the wiring :

The TX 433 Mhz pin are to be connected as following:

  • VCC > Any VCC pin on the Arduino Pro Mini
  • GND > Any GND pin on the Arduino Pro Mini
  • Data > Pin 10 on the Arduino Pro Mini
Here i am using the FT232RL module to power the Arduino Pro Mini, but ultimately i will plug a 9V Battery as source of power



Now from the Software side :

First download and install the RCSwitch library : https://code.google.com/p/rc-switch/

Once done you can compile and send the following code to the Arduino Pro Mini

Sending data code :
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  // Transmitter is connected to Arduino Pin #10
  mySwitch.enableTransmit(10);

  // Optional set pulse length.
  // mySwitch.setPulseLength(320);

  // Optional set protocol (default is 1, will work for most outlets)
  // mySwitch.setProtocol(2);

  // Optional set number of transmission repetitions.
  // mySwitch.setRepeatTransmit(15);

}

void loop() {
  /* Same switch as above, but using decimal code */
  mySwitch.send(5393, 24);
  delay(1000);
  mySwitch.send(5396, 24);
  delay(1000);

  /* Same switch as above, but using binary code */
  /*mySwitch.send("000000000001010100010001");
  delay(1000);
  mySwitch.send("000000000001010100010100");
  delay(1000);*/

  delay(2000);
  //mySwitch.send(4212181, 24);

}
Note this code is not from me at all. source : http://www.homautomation.org/2013/09/21/433mhtz-rf-communication-between-arduino-and-raspberry-pi/

On the receiving end, we have the RX 433 Mhz module plugged in the Raspberry Pi (Receiver : Pin 13 (GPIO 27 Rasp Pi B+). Also marked as Pin 2 under WiringPi's naming convention)

I am basically using the same setup (RFSniffer code etc ...) as explain in the following post : Link

And it works ! The Raspberry Pi successfully sniffs the code sent (5393, 5396)


Looks like that all the send messages were not picked up, only 1 within the loop (4 digit long) the other two are longer and i am not sure they are being picked up by the RFSniffer program.

Yay, that is big for me that is not an electronic expert :)

Next i will try to make the DS18B20 independently with the Arduino Pro Mini

No comments:

Post a Comment