Skip to content

Python flask web app to control a 4 channel relais module for raspberry pi

Notifications You must be signed in to change notification settings

itsmichaelk/relais_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi 4-Channel Relay Control with Flask

This project provides a web interface for controlling a 4-channel relay module connected to a Raspberry Pi. The web interface is built using Flask, a Python web framework, and allows users to turn each relay on or off individually, as well as turn all relays on or off at once.


Requirements

  • Python 3 installed
  • Flask module for Python installed
  • 4-channel relay module connected to Raspberry Pi

Installation

Clone this repository to your Raspberry Pi:

git clone https://github.com/yourusername/relay-control.git
pip install flask

Connect the 4-channel relay module to your Raspberry Pi as follows:

  1. Connect the VCC pin of the relay module to a 5V pin on the Raspberry Pi.
  2. Connect the GND pin of the relay module to a GND pin on the Raspberry Pi.
  3. Connect each of the IN pins of the relay module to a GPIO pin on the Raspberry Pi, using the pin numbers specified in the code (GPIO4, GPIO22, GPIO6, and GPIO26).

Start the Flask server:

cd relay-control
python app.py

Access the web interface by navigating to your Raspberry Pi's IP address in a web browser, followed by :8000 (e.g. https://192.168.1.100:8000). You should see a page with buttons to control each relay.

Usage

Click a button to turn the corresponding relay on or off.
Click the "All Off" button to turn all relays off.
Click the "All On" button to turn all relays on.

Credits

This project was created by itsmichaelk.

About

Python flask web app to control a 4 channel relais module for raspberry pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published