Arduino+RF Moduls

3,532

26

2

Posted in WorkshopOrganizing

Introduction: Arduino+RF Moduls

About: I am electronic engineering.

We use 433mhz RF moduls between two differents arduino uno by button. if we push button, firstly uno send data other uno. and if second uno receivering correct data, it turn on led1 and off led2.

materyal list - 2 x arduino uno - 433 mhz RF Rev. - 433 mhz RF Trans. - 1 x button - 2 x led (differents colour)

Step 1: ​make Circuits

show that below. how do you make connect.

Step 2: Software

RF_RECEIVER
#include int input1 = 3; // Arduino'nun 3. digital pinine bağlanmıştır. int input2 = 4; // Arduino'nun 4. digital pinine bağlanmıştır. const int receive_pin = 9; void setup() { delay(1000); vw_set_rx_pin(receive_pin); vw_set_ptt_inverted(true); vw_setup(2000); vw_rx_start(); pinMode(input1, OUTPUT); pinMode(input2, OUTPUT); } void loop() { uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN; if (vw_get_message(buf, &buflen)) { if(buf[0]=='1') digitalWrite(input1,HIGH); digitalWrite(input2,LOW); } if(buf[0]=='0') { digitalWrite(input1,LOW); digitalWrite(input2,LOW); } }

RF_TRANSMITTER_BUTTON #include //kütüphanemizi ekledik. const int buton1 = 7; int butondurumu = 0;

void setup() { pinMode(buton1, INPUT); vw_set_tx_pin(12); vw_setup(2000); } void loop() { butondurumu = digitalRead(buton1); if (butondurumu == HIGH) { char msg[1] = {'1'}; vw_send((uint8_t *)msg, 1); vw_wait_tx(); delay (100); } else { char msg[1] = {'0'}; vw_send((uint8_t *)msg, 1); vw_wait_tx(); delay (100); } }

Step 3:

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    2 Comments

    Really cool idea! Thanks for sharing and welcome to the community!