Tonight, the hack objective is to communicate with 433Mhz equipments using Raspberry PI. For this, I use a 433Mhz receiver from Itead Studio bought at hack spark for 4.5€ with an emitter. Cabling is simple : VDD on 5V (I tryed to use 3.3V supply voltage but as a consequence the reception range is limited to a couple of cm) , GND goes to GND and One of the data pin going to pin 13 (gpio21/27). This is following elements found on that site : ninjablocks
If you are looking for a RF433 shield for Raspberry, check this link to another article !
The first step is to install a fresh wheezy raspbian environment and get the basis element to work :
Install wiringPI :
WiringPi is a library used to control GPIO in C and much more
git clone git://git.drogon.net/wiringPi cd wiringPi ./build
Install 433Mhz tools
This lib is used to interface with the receiver
git clone git://github.com/ninjablocks/433Utils.git cd 433Utils/RPi_utils make
Now, just start the RFSnifer tool … and it works ! I’m receiving my PIR detector signal. I made a change in the RFSnifer tool to get the binary value to understand the coding. (I’ll push the code next time) It seems that the coding of each the PIR digit is made on 2 bits with a non connected value, a high value and a low value.
Here is what is received when no swicth are set :
Received 5592533 (00000000010101010101010111010101)
We can see 12 series of 2 bits. the default value when no jumper are connected is 01 for each of the bits pair. If the jumper is set to high, the bit-pair value will be 11 ; if set to low, the bit pair will be 00.
On the PIR system, the encoding chip is a CS5211AGP which really looks like this one.
- To get a better reception, the size of the antenna should be around 17,3cm
- To see reception, you can add a led between data and gnd (or vcc) with a 10K resistor in serie
- With RPI2 and RPIB+ the user level Interrupt access is not efficient and you can loose part of the frame. I recommand to take a look to my post about the use of a kernel driver.