Baseline for home automation projects with the Raspberry Pi
Raspberry Pi
Relay Module
Web Server (Apache) --> PHP --> Python --> GPIO Raspberry
Connection Devices
DEVICE 1 --> Pin7 (GPIO4)
DEVICE 2 --> Pin 11 (GPIO17)
- Do "sudo apt install apache2 -y" in the raspberry pi
- Do "sudo apt install php libapache2-mod-php -y"
- Copy directory GPIO to /home/pi
- Go to /var/www/html and remove the "index.html"
- Copy file php/index.php to /var/www/html (DocumentRoot Apache)
- Connect a 3.3V gpio in the vcc port of the relay
- Connect a gnd gpio in the gnd port of the relay
- Connect the Pin 7 (GPIO4) in the In1 port of the relay
- Connect the Pin 11 (GPIO17) in the In2 port of the relay
And now you can connect any device in the relay and control it via web :)