angel6700
Posts: 27
Joined: Fri Jun 01, 2012 5:19 pm

RF receiver 433MHZ

Mon Jan 14, 2013 12:07 pm

Hello,

after reading the article in the last "ThemagPi" magazine about sending a signal with a RF transmitter to a socket and switch it on or off, I found it very interesting.

They are the same as these:

http://www.ebay.com/itm/1pcs-433Mhz-RF- ... 3cc7431824

I have the same units he uses, and following their steps I could reproduce it. OK, just testing, I do not have the sockets, but I can send pulses and read in the receiver plugged to the sound card in the computer.
The only difference is that I'm using python instead of C++.

My question is: Could it be possible to connect the receiver to the GPIO of the RPi and read with it?

In that case, the pin should be an input but I do now know what I expect to read and if it is safe to connect it.

Thanks in advance.

HeavensBlade
Posts: 26
Joined: Fri Aug 03, 2012 10:45 am

Re: RF receiver 433MHZ

Mon Jan 14, 2013 12:29 pm

Hey
I bought such a set on ebay, too. It looks exactly the same so it should work.
I'm using only the transmitter but I tried using the reciever. I did it without any resistors. Just connected the two middle pins to two GPIO`s. I don't know where the difference is but they gave me different states but this may be caused by the speed the signal changed and the speed the script read the states. I was not able to see a clear sequence wich is needed to control stuff.
This is the Script that I used:

Code: Select all

import webiopi
GPIO = webiopi.GPIO

GPIO.setFunction(25, GPIO.IN)
GPIO.setFunction(24, GPIO.IN)

while True:
        fileHandle = open ( 'test.txt', 'a' )
        if GPIO.input(25):
                fileHandle.write ( '\nGPIO.output(25, 1)' )
        else:
                fileHandle.write ( '\nGPIO.output(25, 0)' )
        fileHandle.close()
Then I just added a few lines to the test.txt and renamed it test.py to send what the script just read.
What can I say? Well, unfortunately this is a way it's not going to work.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: RF receiver 433MHZ

Mon Jan 14, 2013 12:57 pm

The transmit unit in the ebay link is of poor quality and you may need to adjust to get the correct frequency and its bound to have frequency shift so you will need to readjust frequently.

If you are only after transmission out of pi all you need to do is attach a cable to gpio pin 4 and run the program in this thread:

http://www.raspberrypi.org/phpBB3/viewt ... 37&t=26485

It supports off-shelf products like Nexa/Status remote sockets.

User avatar
joan
Posts: 15249
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RF receiver 433MHZ

Mon Jan 14, 2013 1:31 pm

I used a receiver/transmitter pair and tested them between a couple of Pis. I used the serial links on either end as they are geared towards synchronising pulse streams. Example code and some discussion in theis thread http://www.raspberrypi.org/phpBB3/viewt ... 39#p252739

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Mon Jan 14, 2013 8:47 pm

Yes it works' but the sensitivity of the eBay receiver is very poor. Maybe as mentioned, the frequency is a bit off.

I posted some C code to read the data on the forum somewhere. I think this link will get you there.http://www.raspberrypi.org/phpBB3/viewt ... 17#p237517

Cheers,
Geoff

angel6700
Posts: 27
Joined: Fri Jun 01, 2012 5:19 pm

Re: RF receiver 433MHZ

Tue Jan 15, 2013 8:24 am

Hello,

Thank you all for your help.
I have tried with serial link as explained by Joan, and... ok, I see that I must learn a little of C...

Every try with minicom, or pyserial, send just nothing, but using the code provided by Joan:
http://www.raspberrypi.org/phpBB3/viewt ... 39#p252739
I capture some pulses remotely. So it seams that first I must understand the C code to see what it does :)

For the reception, which was the main part of my post, I have not tested with that code, but surelly it will work.
Thanks again.

d82k
Posts: 38
Joined: Sat Dec 08, 2012 11:17 am

Re: RF receiver 433MHZ

Sun Feb 10, 2013 8:23 pm

Hi,

I got a very similar receiver and trasmitter (http://shop.boxtec.ch/433mhz-link-pi-40971.html) (details: http://shop.boxtec.ch/pub/seeed/315MRFlink.pdf).
I would like to connect the receiver to the raspberry pi to record 433 signals. Next step would be to read temperature from my old oregon scientific.
How do I connect the receiver to the raspberry?
Where you able to log 433 signals received?

Thank you,
dk

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Mon Feb 11, 2013 7:28 am

My first bit of code with one of these devices just read the bits into an array for about about a second, then printed out all the 1s and 0s. I had the luxury of being able to control when the signal I was interested in got transmitted so I could compare the random noise to the real signal and saw a distinct pattern. I wrote the data to an array first, as writing to the screen is too slow when looking at these signals. I think the array was 100000 characters.

From that I was able to write the receiving software mentioned earlier in this thread. As it is, that software does what I need, but would need to be modified to receive the weather data you mentioned.

Geoff.

aideen
Posts: 17
Joined: Fri Jun 15, 2012 11:43 pm
Location: Cambridge, UK

Re: RF receiver 433MHZ

Mon Feb 11, 2013 11:49 pm

Have you looked at Hope's RF modules? Try a search for RFM12 combined with Raspberry Pi and/or Arduino, JeeNode, weather station, openenergymonitor .... All engrossing stuff. You'll find enough reading and inspiration to keep you busy for quite some time!

http://www.open.com.au/mikem/bcm2835/index.html might be of interest too.

leonardo
Posts: 9
Joined: Sun Dec 30, 2012 3:30 pm
Location: Italy, not my fault, I wasn't able to deceide where to born

Re: RF receiver 433MHZ

Wed Feb 13, 2013 8:06 pm

Hi
I have something like this and I'm trying too to get some info
this is the simple code I wrote to get something:

Code: Select all

#!/usr/bin/python

import RPi.GPIO as GPIO, time, sys
GPIO.setmode(GPIO.BCM)

GPIO.setup(4, GPIO.IN)

while True:
    input_value = GPIO.input(4)
    sys.stdout.write(str(int(input_value)))
    input_value = 0
with this I can get a lot of 1 and 0 depending on the state of the signal.

I'm giving to the receiver ONLY 3.3V (raspberry pi gpio port 1) because giving it 5volts I have a lot of noise and without any 433 signal I have a lot of false positives.
giving 3.3 I must be close to the receiver but if I give no signal I have a looooong list of 0

I have a lot of 433MHz devices, but at the moment I have no idea how to "undestrand" the signal!
any idea is velcome!

cheers, Leo

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Wed Feb 13, 2013 9:22 pm

There's a bit of a cheat you can do. Open a device and look what chips are in there. Type the chip numbers into Google and see if you get results indicating its some kind of transmitter. If so, try finding a data sheet for it.

Failing that, look for blocks of ones and blocks of zeros from your all app. The data is most likely encoded in the pulse lengths.

Geoff.

leonardo
Posts: 9
Joined: Sun Dec 30, 2012 3:30 pm
Location: Italy, not my fault, I wasn't able to deceide where to born

Re: RF receiver 433MHZ

Thu Feb 14, 2013 8:34 am

I agree but is not that simple.
I tryed to wait for a "1" before writing read data.
Using always the same device (a remote for lights), I have _SIMILAR_ sequences, but not _IDENTICAL_
this happens because I can have a sequence of ten "1" but it can be eight or eleven, depending of the load of the raspberry at the moment, I'm not using a realtime kernel, so the stream of "1" and "0" can be different!

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Thu Feb 14, 2013 11:54 am

Hi,

I found that the lengths of the strings did vary a lot. But in general there were noticeable patterns. I typically saw something like this...

1111111111110000
111111111100000
111111111110000
111000000000000
1111000000000000
111100000000000

So I guessed that a 1 in the transmitted data was a long string of 1s and a short string of 0s, while a transmitted 0 was the other way around.

I decode it by reading a timer, waiting for a change on the pin and reading the timer again. After the pair of transitions (down then up) in my case, I check the total length is acceptable, then check the length of time it was at 1 and add a bit to a string. If I get anything invalid, I start all over again at the beginning of my string. If I get 24 valid looking bits, I print them out then start all over again.

Regards,
Geoff.

leonardo
Posts: 9
Joined: Sun Dec 30, 2012 3:30 pm
Location: Italy, not my fault, I wasn't able to deceide where to born

Re: RF receiver 433MHZ

Thu Feb 14, 2013 1:23 pm

Uhm, Geoff, do you have a code useable for this? At the moment I wrote another portion of code that waits for a "1" before printing and gets data for a predefined length:

Code: Select all

#!/usr/bin/python

maxcount = 200

import RPi.GPIO as GPIO, time, sys
GPIO.setmode(GPIO.BCM)

GPIO.setup(4, GPIO.IN)

while True:
  pin = GPIO.input(4)
  if pin:
    count = 0
    while (count < maxcount):
      pin = GPIO.input(4)
      sys.stdout.write(str(int(pin)))
      pin = 0
      count = count + 1
      if count == maxcount:
        print("---")
could be interesting to merge the two solutions and see what happends!

regards, leo

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Thu Feb 14, 2013 2:44 pm


leonardo
Posts: 9
Joined: Sun Dec 30, 2012 3:30 pm
Location: Italy, not my fault, I wasn't able to deceide where to born

Re: RF receiver 433MHZ

Thu Feb 14, 2013 4:24 pm

Ok I got it, but at the moment I cannot get any data, I have a lot of devices can send 433MHz, I tried them all but nothing is read!!!
I connected signal to GPIO8, but nothing happens, only the message: gpio edge 8 both :(
Do you have any suggestion?
Thanks again, Leo

leonardo
Posts: 9
Joined: Sun Dec 30, 2012 3:30 pm
Location: Italy, not my fault, I wasn't able to deceide where to born

Re: RF receiver 433MHZ

Thu Feb 14, 2013 4:31 pm

Will post in the other thread sorry for going off topic here

d82k
Posts: 38
Joined: Sat Dec 08, 2012 11:17 am

Re: RF receiver 433MHZ

Mon Feb 18, 2013 8:25 pm

Hi,
I'm interested too in connecting my receiver to the rpi.
My goal is to get the code of a remote for 433mhz plugs which I cannot find.. I would like to keep transmitting the code from the remote and in some way record it with the rpi.

I have found this https://github.com/CurlyMoo/433.92-Rasp ... eceive.cpp , and it works "sometimes".. but it has to be modified in order to display raw data...

Does anyone have been able to read raw data from the receiver?
Thank you,
dk

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Tue Feb 19, 2013 9:43 pm

d82k wrote:Hi,
I'm interested too in connecting my receiver to the rpi.
My goal is to get the code of a remote for 433mhz plugs which I cannot find.. I would like to keep transmitting the code from the remote and in some way record it with the rpi.

I have found this https://github.com/CurlyMoo/433.92-Rasp ... eceive.cpp , and it works "sometimes".. but it has to be modified in order to display raw data...

Does anyone have been able to read raw data from the receiver?
Thank you,
dk

Check out the code in the thread a few posts up. There's the code i use for listening for my remotes. Later in there is some code to show the pulse lengths so the first example can be tweaked.

Geoff.

codedmind
Posts: 4
Joined: Thu Feb 21, 2013 8:57 am

Re: RF receiver 433MHZ

Thu Feb 21, 2013 8:58 am

Hy there,

Can this be done with rfm12b module that came with alpha eve board?

Thanks

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: RF receiver 433MHZ

Thu Feb 21, 2013 12:25 pm

Searching the forum for rfm12b shows lots of people doing this kind of thing with that module. It seems a bit overcomplicated for this, and it's surface mount, so not as easy to connect.

Geoff.

codedmind
Posts: 4
Joined: Thu Feb 21, 2013 8:57 am

Re: RF receiver 433MHZ

Thu Feb 21, 2013 12:29 pm

My problem is find how to connect and how to use... i only see library and things to arduino

E follow this image to make the connection
Image

But now i don't know how to test if the connections works and what to do analyze the spectrum

Thanks

codedmind
Posts: 4
Joined: Thu Feb 21, 2013 8:57 am

Re: RF receiver 433MHZ

Fri Feb 22, 2013 9:21 am

I have search a lot but can't find nothing so good as this post... i assume this is using rfm12b, my mistake.

I can't even no if therfm12b is active/connected in my raspberry :/

nellschmertz
Posts: 1
Joined: Tue Mar 12, 2013 3:19 am

Re: RF receiver 433MHZ

Tue Mar 12, 2013 3:20 am

Anyone knows more details about jammer kits? The audio jammer, 315 433 mhz remote block, Gps jammer and common cell phone jammer . happy to share more sources with you.

d82k
Posts: 38
Joined: Sat Dec 08, 2012 11:17 am

Re: RF receiver 433MHZ

Sat Mar 16, 2013 10:06 pm

Hoagie wrote:
d82k wrote:Hi,
I'm interested too in connecting my receiver to the rpi.
My goal is to get the code of a remote for 433mhz plugs which I cannot find.. I would like to keep transmitting the code from the remote and in some way record it with the rpi.

I have found this https://github.com/CurlyMoo/433.92-Rasp ... eceive.cpp , and it works "sometimes".. but it has to be modified in order to display raw data...

Does anyone have been able to read raw data from the receiver?
Thank you,
dk

Check out the code in the thread a few posts up. There's the code i use for listening for my remotes. Later in there is some code to show the pulse lengths so the first example can be tweaked.

Geoff.
Hi Geoff,

Finally I had time to look at the code you posted.
Thank you for your advices and your work. I have actually read your article on MagPi on controlling remote sockets. And I was able to make the transmission work, and using your code I was able to receive also data.
I have noticed that sometimes it places a "1" at the very beginning of the 24bit:
100000000000000000010101 instead of
000000000000000000010101
still did not understand why, but I think I can manage replacing it by hand.

Thank you,
dk

Return to “Automation, sensing and robotics”