Door Chime Button with Swann 433Mhz system

14 Apr

image

Eventually I want to use Ninja Blocks to control a number of things in my home but the Ninja Block hasn’t arrived yet.

I decided to have a play around with 433 Mhz receiver and transmitter while waiting for Ninja Blocks to arrive.

Using in this:

– Arduino Uno

– Swann Wireless MP3 doorchime

– 433 Mhz transmitter & receiver (ebay £5)

I used most of the advice from the Ninja bloacks How to on 433 Mhz radio and Arduino.

http://ninjablocks.com/blogs/how-to/7501042-adding-rf-433mhz-to-your-arduino

So first used RF Sniffer sketch to get the code for my doorbell. After taking not of this I then switch config to transmit. I used the Send Demo included in the NB How to and removed some of the extra bits and added a button from standard Arduino examples.

/*
Button for RF Send
Hacked togther from public samples from RC Siwtch library and @Justy modifications
*/

#include <RCSwitch.h>

#define CODE_Button 5594964 // Use whatever number you saw in the RF Sniffer Sketch

RCSwitch mySwitch = RCSwitch();

const int buttonPin = 12; // the number of the pushbutton pin

int buttonState = 0; // variable for reading the pushbutton status

void setup() {

// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
pinMode(7, OUTPUT);
Serial.begin(9600);

// Transmitter is connected to Arduino Pin #7
mySwitch.enableTransmit(7);

}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// send code:
mySwitch.send(CODE_Button, 24);
delay(5000);
}
else {
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: