arduino 433mhz Wireless Transmitter & Receiver

Hello world! Today i made a example for the FS1000A arduino 433mhz Wireless Transmitter and receiver set. I am testing these for my website and will set them for sale on the website soon. The example shows you how to turn on a relay, led and buzzer with a button using 433Mhz wireless communication. You could use this example as a panic alarm! You wear the remote on you, hit the button and alarm will go off. Simply add a alarm strobe with sound to the relay for example.

PS: Check if it legal to operate a 433MHz frequency in your country.

This is the set i used:
arduino 433mhz

Schematic Transmitter:
arduino 433mhz

Schematic Receiver:
arduino 433mhz

Parts list:
2x Arduino uno.
FS1000A Transmitter & receiver set (add 17cm antennas, i used jumper wires.)
Buzzer
KY-019 1 channel relay
1 x LED color of your choice.
1 x button Module KY-004
Jumper wires set MM/FF/MF
(optional) Lamp socket + lamp/Alarm strobe

Transmitter Code:

/*
Author: Danny van den Brande, Arduinosensors.nl. BlueCore Tech.
*/
 
 
#include <VirtualWire.h>
int Button1 = 2; 
boolean val ;
 
void setup() {
    Serial.begin(9600);
    pinMode(13,OUTPUT);
    pinMode (Button1, INPUT);
    vw_set_tx_pin(12); 
    vw_setup(4000);// speed of data transfer in bps, can max out at 10000
}
 
void loop()
{
  char *senddata="0123456789abcdef";
  val = digitalRead (Button1); 
    if (val == 0){
    Serial.print(val);
    digitalWrite(13,1); 
    vw_send((uint8_t *)senddata, strlen(senddata));
    vw_wait_tx(); 
    digitalWrite(13,0); 
    delay(1000);
    }
}

Receiver Code:

/*
Author: Danny van den Brande, Arduinosensors.nl. BlueCore Tech.
*/
#include <VirtualWire.h>

int Buzzer = 6;
int Relay = 2;

// here i set up the tones, you can change them @ void loop.
int tones[] = {261, 277, 293, 311, 329, 349, 369, 392, 415, 440, 466, 493, 523 ,554};
//              1    2    3    4    5    6    7    8    9    10   11   12   13   14
// You can add more tones but i added 14. Just fill in what tone you would like to use, @ void loop you see " tone(Buzzer, tones[12]); " below,  digitalWrite(Buzzer, HIGH);
// here you can change the tones by filling in a number between 1 and 14

void setup()
{
    Serial.begin(9600); //we wanna be able to read what we got
    vw_set_rx_pin(12);//connect the receiver data pin to pin 12
    vw_setup(4000);  // speed of data transfer in bps, maxes out at 10000
    pinMode(13, OUTPUT);
    pinMode (Buzzer, OUTPUT); 
    pinMode (Relay, OUTPUT); 
 
    vw_rx_start();       // Start the receiver PLL running
    for (int i = 0; i < Buzzer; i++)  ;
}
    void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
    if (vw_get_message(buf, &buflen)) // if we get a message that we recognize on this buffer...
    {
 
    String out = "";
    
 // we have data coming in, let's aknowledge somehow that we've received it

    digitalWrite(Buzzer, HIGH);
    digitalWrite(13, HIGH);
    tone(Buzzer, tones[2]);
    delay(100);
    digitalWrite(Buzzer, LOW);
    digitalWrite(13, LOW);
    noTone(Buzzer);
    delay(100);
    digitalWrite(Buzzer, HIGH);
    digitalWrite(13, HIGH);
    tone(Buzzer, tones[14]);
    delay(100);
    digitalWrite(Buzzer, LOW);
    digitalWrite(13, LOW);
    noTone(Buzzer);
    delay(100);

    digitalWrite(Buzzer, HIGH);
    digitalWrite(13, HIGH);
    tone(Buzzer, tones[2]);
    delay(100);
    digitalWrite(Buzzer, LOW);
    digitalWrite(13, LOW);
    noTone(Buzzer);
    delay(100);
    digitalWrite(Buzzer, HIGH);
    digitalWrite(13, HIGH);
    tone(Buzzer, tones[14]);
    delay(100);
    digitalWrite(Buzzer, LOW);
    digitalWrite(13, LOW);
    noTone(Buzzer);
    delay(100);
    
    digitalWrite(Relay, HIGH);
    digitalWrite(13, HIGH);
    
    for (int i = 0; i<buflen; i++)
    {
       out +=(char)buf[i]; // fill the string with the data received 
    }
    Serial.println(out); // simple enough
//    digitalWrite(13,0); //transmission ended
    
   }
}
Danny van den Brande

http://www.arduinosensors.nl

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

Your email address will not be published. Required fields are marked *