Raspberry Pi 433MHz
Posted on Tue 19 June 2018 in RaspberryPi
I wanted to be able to send 433 signals to my plug sockets and light switches from the Raspberry Pi. I had a Pi 2b and some time spare.
After spending a few hours doing the usual research, I came up with the below, essentially;
• Hookup 433 Receiver/Transmitter
• Install WiringPi
• Install 433Utils
• Record Remotes
• Create Python Scripts
• Link py scripts to webpage buttons
These are my notes, they aren't exact. I have referenced useful pages.
Hook a 433 Transmitter/Receiver to the Pi
Good Guide: https://www.princetronics.com/how-to-read-433-mhz-codes-w-raspberry-pi-433-mhz-receiver.
I had a pair laying in a draw. I don’t remember where I got them, most likely eBay. They won't have been expensive.
Google 433 transmitter receiver raspberry pi.
They look like this:
I cant find where the GPIO pins are defined, however the below is referenced online often and worked.
Receiver
Ground PIN 6 GND
Data PIN 13 GPIO27
VCC PIN 4 5v
Transmitter
Ground PIN 9 GND
Data PIN 11 GPIO17
VCC PIN 2 5v
Install WiringPi
cd /
git clone git://git.drogon.net/wiringPi
cd wiringPi
sudo ./build
Install 433Utils
cd /
sudo git clone git://github.com/ninjablocks/433Utils.git
cd 433Utils/RPi_utils
sudo git submodule init
sudo git submodule update
sudo make
Run 433Utils
Run RFSniffer, point your remote at the receiver, one second pushes, one code per push.
record codes
/433Utils/RPi_utils/RFSniffer
send recorded code
/433Utils/RPi_utils/codesend 16604184
Python Script
socket1_on.py
import os
os.system ("/433Utils/RPi_utils/codesend 4527445")
Socket1_off.py
import os
os.system ("/433Utils/RPi_utils/codesend 4527444")
Webpage Links
I host a webpage with buttons on it. The buttons link to php scripts which call the python scripts.
Socket1_on.php
<?php
system("sudo python /pihome/public_html/socket1_on.py"); header("Location: http://192.168.1.100:4556/remote.php");
?>
Socket1_off.php
<?php
system("sudo python /pihome/public_html/socket1_off.py"); header("Location: http://192.168.1.100:4556/remote.php");
?>