Skip to content

adelorenzo/Simple-PHP-GPIO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Simple-PHP-GPIO

Control GPIO modules connected to a Raspberry Pi

This a very simple PHP scritp I wrote to control my bedside lamp with a relay module connected to a Raspberry Pi and my cell phone. It is very straight forward and simple to use.

Requirements

Software

sudo apt-get install lighttpd php

Yup, that simple. Once lighttpd (or apache2 if you prefer) and php are installed place the script in the /var/www/html folder. It is important that the correct GPIO pins are mapped so the script can work properly.

You can access the script on the http://RASPBERRY_IP/ where RASPBERRY_IP is the ip adress of your Raspberry Pi.

Ideally your Raspberry Pi is connected to the Internet so bootstrap css script is loaded from the Internet.

Hardware

A Arduino/Raspberry compatible module is required for the script to work. These modules are quite cheap and available on eBay.

  • Raspberry Pi 2/3

alt text

  • 4 channel Arduino/Raspberry Pi compatible module.

alt text

GPIO and Relay module connections

In order to the script work with the GPIO mapped properly make sure that the pins are connected as follows:

GPIO PIN Relay module PIN
2 VCC
6 GND
12 IN1
13 IN2
15 IN3
16 IN4

About

Control fans connected to a Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages