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 :

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() {
  // Transmitter is connected to Arduino Pin #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);
  mySwitch.send(5396, 24);

  /* Same switch as above, but using binary code */

  //mySwitch.send(4212181, 24);

Note this code is not from me at all. source :

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