Go Down

Topic: Reading RF codes with receiver (Read 663 times) previous topic - next topic

Aeien

Hello all,

I'm trying to build a system to control my RF power sockets (flamingo SF-501) through my arduino and acquired a cheap 433mhz sender/receiver combo from seeed studio.

Through all forumposts and guides I decided the first step would be to decode the signal transmitted by the remote.
I tried using the RCSwitch library and the ReceiveDemo_advanced sketch, connecting the data-pin of the receiver to pin 2 on my Uno.

using the code below, I get no input at all when activating the remote near the receiver.
The remote is also 433.92mhz and is transmitting (the lights go on/off) .

The receiver is brand new and should be working, but I don't have any confirmation on this, as I don't receive any signal.

Can you give me any advice on how to proceed? I'm at a loss because there are so many variables involved.

Thank you very much for any advice!


Code: [Select]
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
 
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
  }
}

franks95

I am having this same issue with the same remote outlet brand and type. I can confirm my 433MHZ transmitter and receiver are working. But still when transmitting a signal using the outlet remote no logs are written in the serial monitor.

Aeien

#2
Jun 20, 2017, 09:56 pm Last Edit: Jun 20, 2017, 10:13 pm by Aeien
Franks95,

Use this library; click on the download link at the bottom:

https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home
Use the "NewRemoteSwitch" part.


Works like a charm for said power sockets.


Am using this library in an all-in-one binary clock + infrared remote for TV/amplifier + RF remote for power sockets,       all controlled through a home-made bluetooth app on my android phone. Works really well :)



Let me know if you need help!

Shreever

Sorry if I re-open this thread or anything, but I'm trying to control the same type of outlets. I however neglected to buy a receiver for my Arduino as I found a library that should be plug and play like. (I know silly of me, just forgot that I might have to read out the original remote).

So for my question, does anyone have some example code to use with the "NewRemoteSwitch" library? I'm assuming the on/off part should be roughly the same for all the SF501s?

Aeien

#4
Sep 04, 2017, 10:03 pm Last Edit: Sep 04, 2017, 10:12 pm by Aeien
It has been a while, but, using #include <NewRemoteTransmitter.h>:
Put this above void{}:
Code: [Select]

bool isOn = NewRemoteCode::on;
bool isOff = NewRemoteCode::off;
NewRemoteTransmitter transmitter(27293696, pinRF, 266);

where pinRF is the pinnumber used to send data to your RFsender

then use:
Code: [Select]
transmitter.sendUnit(channel, isOn);
transmitter.sendUnit(channel, isOff);

to send on/off commands. Channel should be the number (I know 1-9 work, dunno for 10 and up) of the particular power socket.  I use bluetooth input, where the input (the channel number) is stored in the int commonInput, so my actual code reads
Code: [Select]
transmitter.sendUnit(commonInput, isOff);
to turn a channel off.



To clarify: the powersocket will "learn" it's channel "created" by/for the arduino if you use any number from 1-9; just plug in the socket and send the "on" on the required channel while the socket is blinking. Be aware, though, that if your arduino does not function (which it will do occasionally), you will be unable to use the remote to turn on the socket, unless you unplug/plug it in again and re-learn.

Hope this helps, let me know if you need more help

Shreever

Awesome, that worked.

Been trying for a while now with the "RemoteTransmitter" library. But non of the predefined transmitter types corresponded to the SF501.

Thanks a lot :)

Go Up