Wiring Diagram and Example code for RPI 4-Channel Relay Shield
I just bought the "Inland RPI 4-Channel Relay 5V Shield for Raspberry Pi/ CE Certification" from Houston branch recently. It is a nice relay board to use on my Pi 3B+ and 4 following the reviewer code from one of the product review. But this HAT occupied all 40-pin without exhausting every GPIO pin. I would like to desolder the 40pin-connector (or jump-wire) and use only vcc, gnd, and actual signal pings to free other GPIOs. I was not able to find any resources for source code or wiring diagrams for the RPi 4-chan relay. Any help?
Best Answer
-
I'm not good with wiring, but I kinda help with the coding
Sample Code
#include <wiringPi.h> int main() { wiringPiSetup(); pinMode(7,OUTPUT); pinMode(3,OUTPUT); pinMode(22,OUTPUT); pinMode(25,OUTPUT); printf("relay testing!\n"); while(1) { digitalWrite(7,HIGH); delay(500); digitalWrite(7,LOW); digitalWrite(3,HIGH); delay(500); digitalWrite(3,LOW); digitalWrite(22,HIGH); delay(500); digitalWrite(22,LOW); digitalWrite(25,HIGH); delay(500); digitalWrite(25,LOW); delay(500); } }
Hope this helps!
Answers
-
Thank you! I research around and this product seems like a duplicate of one of the Keyestudio RPi 4-channel relay (part#KS0212).
I kinda see the front print layout matches the wPi 7, 3, 22, 25 (or BCM 4, 22, 6, 26), but it's hard to identify the Vcc and ground pins. Any suggestions? TIA
-
Wiring and electrical are not my forte unfortunately, but maybe this can help
Assuming the ground pins should be the same on the locations on the relay board.
Two suggestions:
This has a passthrough GPIO header
This converts the GPIO from 1 to 2
Categories
- All Categories
- 1 The Blog
- 1 What's Trending
- 7.4K The Community
- 3K General Discussion
- 102 New Members
- 789 Consumer Tech
- 197 Prebuilt PCs and Laptops
- 154 Software
- 30 Audio/Visual
- 50 Networking & Security
- 4 Home Automation
- 5 Digital Photography
- 12 Content Creators
- 28 Hobby Boards & Projects
- 75 3D Printing
- 83 Retro Arcade/Gaming
- 60 All Other Tech
- 287 PowerSpec
- 2.5K Store Information and Policy
- 140 Off Topic
- 40 Community Ideas & Feedback
- 596 Your Completed Builds
- 3.6K Build-Your-Own PC
- 2.6K Help Choosing Parts
- 303 Graphics Cards
- 324 CPUs, Memory, and Motherboards
- 134 Cases and Power Supplies
- 50 Air and Liquid Cooling
- 46 Monitors and Displays
- 88 Peripherals
- 57 All Other Parts
- 62 Featured Categories
We love seeing what our customers build
Submit photos and a description of your PC to our build showcase
Submit NowLooking for a little inspiration?
See other custom PC builds and get some ideas for what can be done
View Build ShowcaseSAME DAY CUSTOM BUILD SERVICE
If You Can Dream it, We Can Build it.
Services starting at $149.99