Page 1 of 1

Remote controlled power outlets 433Mhz

Posted: Wed Oct 16, 2013 10:11 pm
by Lexenstar
I am relatively new to using the Raspberry Pi's GPIO features. I am using the Raspberry Pi model B rev. 1 (the one with 256MB RAM).
I bought this transmitter and receiver: These
And 5 BH9936 remote controlled outlets from DBTech: These

What I want to do is I obviously want to control the outlets from the Pi. Using this tutorial I have now read out my remotes' codes (they're like 3232771 and so on).

My problem now is transmitting these codes: I tried using "./codesend 3232771" of 433Utils (described in the tutorial), it returned "sending code[3232771]" but nothing happened. I connected the transmitter according to this picture and also tried switching between the 5V and 3.3V power as well as I checked whether I am using the right GPIO and checked the "codesend" file for the right GPIO port before compiling it.

What am I doing wrong? Anyone got suggestions?

Thank you very much,

Re: Remote controlled power outlets 433Mhz

Posted: Thu Oct 17, 2013 10:22 am
by techpaul
Could be any number of reasons for mismatch from encoding to the transmitter/receiver pair you got are AM (Amplitude Modulation) and the remotes might use FM (Frequency Modulation) or other forms so you may receive a code. The code may be the best decode that can be made of that transmission but wrong.

When sending you are then sending something the other end does not understand.

Re: Remote controlled power outlets 433Mhz

Posted: Thu Oct 17, 2013 11:11 am
by redhawk
The DB-Tech wireless remote switches look very similar to my Status remote switches (the remote control certainly does) so it's likely to be of similar technology.
There already exists a program for the Pi that can control these kind of remote switches using a program call pihat -
It uses the same dirty hack as the poorman's Pi FM (square wave modulated) transmitter although as I understand you can also connect the TX board to the same GPIO pin as well.

As for ninjablocks webpage he appears to have omitted the fact that the GPIO input pins are 3.3v tolerant and yet has connected his RX board directly to the GPIO.
This in my opinion is a serious flaw in his design because these RX boards are powered by 5v and provide 0v / 5v TTL levels which could potentially damage the GPIO input pin.

The data transmitted from these types of devices use simple OOK (on off keying) the length of the pulse usually represents binary 0 and binary 1.
Since there's no agreed standard for representing binary data the timing can be different from brand to brand.
Fortunately pihat source code is easy to modify to adjust the pulse lengths although it does mean you'll need to sample the original remote control signal to try to faithfully recreate this on the Pi.

Richard S.

Re: Remote controlled power outlets 433Mhz

Posted: Thu Oct 17, 2013 5:20 pm
by Lexenstar
thanks for the responses.

I figured out the GPIO input is for 3.3v - thats why I plugged the receiver in to 3.3v and it worked fine even though it is made for 5v.

I downloaded PiHAT and tried figuring it out a little but according to the tutorial and the arguments the program takes it only works with Nexa remote switches. I can not seem to find an option to put in those codes I received earlier either.

Is there a way I could modify the 433Utils' codesend for that? (in terms of pulse length if that might be the problem).
In codesend.ccp it says

Code: Select all

 - The provided rc_switch 'send' command uses the form systemCode, unitCode, command
   which is not suitable for our purposes.  Instead, we call 
   send(code, length); // where length is always 24 and code is simply the code
   we find using the RF_sniffer.ino Arduino sketch.
which is exactly what I am doing.


EDIT: I figured out how to change the pulse length of codesend. But how do I now find the right pulse length?

Re: Remote controlled power outlets 433Mhz

Posted: Sat Oct 19, 2013 6:18 pm
by grahamed
Have a look at ... CPlug.html - see how he looks at received rf waveforms, Connect receiver to pc mic input, run Audacity (or mac or Linux with similar software). Check original against supposed copy.

Re: Remote controlled power outlets 433Mhz

Posted: Wed Nov 20, 2013 2:56 pm
by dinogeek
I want to try to command the same plug.
I' m wondering if finally you arrived to do it with your Rasp?

Re: Remote controlled power outlets 433Mhz

Posted: Thu Nov 21, 2013 4:04 pm
by TKPi
Might be something as simple as distance between transmitter and receiver. I had that issue while working with my RF modules. How far is your receiver from your transmitter? Does your transmitter have an additional antenna to increase its range?

Re: Remote controlled power outlets 433Mhz

Posted: Fri Nov 22, 2013 11:06 pm
by thienson30
1 RF Transmitter and 1 Raspi control up to 1000 Power Outlet/RF Relay Receiver/Channels(Garage/Fan/Gate/Sprinkler...etc). This PI is running on 2TB Hard drive.

Re: Remote controlled power outlets 433Mhz

Posted: Tue Dec 10, 2013 4:48 pm
by Lexenstar
Hey, thanks for the answers. No, I have not got it to work yet :( I kind of gave up for a while but I might give it a try with the software mentioned in the video.

Another issue is whenever I plug in both - transmitter and receiver (and check for the receiver to work by using the remote) - and I transmit a signal, no matter what, it is never being received. So either I'm doing something completely wrong or I have a faulty transmitter. I have looked at dozens of pictures of how to plug in the cables but I have never received anything from my transmitter.

Anyone else got any success on this model?

Distance is not the factor, I have put them right next to each other.

Re: Remote controlled power outlets 433Mhz

Posted: Tue Dec 24, 2013 7:07 pm
by TKPi
I have the same remote and I tied the audacity route but could not decode the signals due to bad waveforms. So I just hacked the remote instead to enable internet controlled outlet switches. See my blog post here: ... ation.html

Re: Remote controlled power outlets 433Mhz

Posted: Wed Jan 01, 2014 3:15 pm
by grahamed

I am sorry to hear you had problems with the" Audacity method" - it can be rather fiddly and the results are obviously not as good as using proper kit but in general can be usable. The two pix attached show the on and off signals for the same Maplin RSL386T remote, one using attenuator-soundcard-Audacity and the other a logic analyser. Both are as received by the same 0£75 (approx 1 USD) eBay generic 433 receiver.

Re: Remote controlled power outlets 433Mhz

Posted: Thu Jan 16, 2014 6:00 pm
by TKPi
I was able to solve the issue on my end. I have the same RF remote from DBTech and I originally tried to send the code that I received using the RCswitch library for Raspberry Pi. Nothing seemed to work initially but when I tried the advanced receive demo sketch on my Arduino, I noticed that the pulse length was 207. The data seemed to match what I had on my Raspberry Pi. So I modified the send.cpp for the Raspberry pi and added this before sending the code.

Details are here: ... emote.html

After this change, I was able to control the RF remote outlets using a simple,cheap 433 MHz RF transmitter (the one from ebay).
Hope this helps.