In this project, I've designed and built a relay control panel based on the raspberryPi board and 3.5" touchscreen.
The project is designated for 12v systems such as cars and small trucks. Using the touchscreen, the user can define
what are the accessories he wishes to control and also decide on the representation on the display screen.
To implement this project the user should be lightly familiar with Python and Linux OS, and have basic knowledge of
electronics.
In this work, I've used 8ch relay board and actually controlling 6ch (due to wire selection).
The design also supports manual control using dip switch.
The materials that was used in this project are:
- RaspberryPi 3b+
- 5v 8ch relay board
- DIP Switch - 8 Position
- 12v step-down converter (12v --> 5v) (for example)
- 3D printer to print the case and cover
- 8 or more cord cable
- soldering and isolating equipment
-
Before starting using the raspberryPi please follow the instructions here. In this work we will use the NOOBS installer with Raspbian.
-
Prepare the touchscreen using it's own instructions.
I used 3.5" TFT touchscreen from Kuman. To install that touch screen I needed to run the following command in the terminal:git clone https://github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/ sudo ./LCD35-show
After rebooting the touchscreen will start functioning.
-
Create new folder named
TouchScreenRelayPanel
and copy all the files from the git repo to the folder.
Alternative method is to use git:git clone https://github.com/ronberenstein/TouchScreenRelayPanel.git
-
Install guizero. Open new terminal (Ctrl+t) and enter:
sudo pip3 install guizero
-
After Raspbian is installed we will need to add the main program (main.py) to the raspberryPi autostart using crontab (tip).
Open new terminal (Ctrl+t) and enter the following command:sudo crontab -e
Select to open using nano. Add the following line to the end of the file:
@reboot python3 /home/pi/Desktop/main.py &
close and save using Ctrl+x and enter Y.
At this point the program should run every time the raspberryPi is starts.
The raspberryPi+touchscreen case was created using 3D printing. CAD+STL files of the can be found here Alternative cases can be built using traditional techniques or using off the shelf electrical boxes.
We use the raspberryPi GPIO pins to control the relay board.
I used 8 cord cable (Ethernet CAT6 cable). 2 cords are dedicated to the 5v and ground inputs, leaving 6 cords for controlling the relay. By
using 10 cord cable, all 8 relay channel can be utilized.
The electrical connections are as follows:
By replacing the images of the button, new type of button can be created.
- I believe that the project can also be implemented using the raspberryPi zero.
Ron Berenstein - website
This project is licensed under the MIT License - see the LICENSE.md file for details