Difference between revisions of "Home-Automation-HAT"
From SB-Components Wiki
(→Pinout) |
|||
(31 intermediate revisions by the same user not shown) | |||
Line 27: | Line 27: | ||
</div> | </div> | ||
<div class="large-4 column"> | <div class="large-4 column"> | ||
− | [[File: | + | [[File:Home_Automation_HAT.png|thumb|left|alt=Home Automation HAT| Buy it From : ''[https://shop.sb-components.co.uk/products/home-automation-hat Click Here]'']] |
</div> | </div> | ||
</div> | </div> | ||
Line 33: | Line 33: | ||
== Pinout == | == Pinout == | ||
<table class="wikitable"> | <table class="wikitable"> | ||
− | <tr> <th> Relays </th> <th>BOARD </th> <th> BCM</th> </tr> | + | <tr> <th> Relays </th> <th>BOARD </th> <th> BCM</th> <th> Wiring Pi</th> </tr> |
− | <tr><td> Relay 1 </td> <td> 35 </td> <td> GPIO 19 </td></tr> | + | <tr><td> Relay 1 </td> <td> 35 </td> <td> GPIO 19 </td> <td> 24 </td></tr> |
− | <tr><td> Relay 2 </td> <td> 33 </td> <td> GPIO 13 </td></tr> | + | <tr><td> Relay 2 </td> <td> 33 </td> <td> GPIO 13 </td> <td> 23 </td> </tr> |
</table> | </table> | ||
== Installation == | == Installation == | ||
− | = | + | <span style="color:#FF0000">'''CAUTION: Be careful when working with the electrical product. Special supervision of parent/adult is required to keep children from hurting themselves.''' </span> |
+ | ==== Connection Diagram ==== | ||
+ | [[File:Home_Automation_Conn.png | 800 px]] | ||
+ | |||
+ | ==== Raspberry Pi (Using PiRelay App) ==== | ||
+ | PiRelay is an Android app you can use to Switch or Pulse the GPIO Pins of a Raspberry Pi connected to Relays. To use this app you will need to setup your Raspberry Pi and Relays. | ||
+ | App Download link: https://play.google.com/store/apps/details?id=com.jasonfindlay.pirelaypro | ||
+ | |||
+ | * To setup PiRelay on Raspberry Pi, run the below commands one by one. Must complete all commands to make it work with Raspberry Pi. | ||
+ | '''Commands to Install: WiringPi, Apache, PHP & Download the GPIO PHP File''' | ||
+ | |||
+ | <source lang="shell"> sudo apt-get update </source> | ||
+ | |||
+ | <source lang="shell"> sudo apt-get install wiringpi apache2 libapache2-mod-php -y </source> | ||
+ | |||
+ | <source lang="shell"> sudo wget https://pirelay.jasonfindlay.com/downloads/gpio.dl </source> | ||
+ | |||
+ | <source lang="shell"> sudo mv gpio.dl /var/www/html/gpio.php </source> | ||
+ | |||
+ | |||
+ | '''Setting Up Your Android Device''' | ||
+ | * Download Pi Relay app from the Play Store here: [https://play.google.com/store/apps/details?id=com.jasonfindlay.pirelaypro '''PiRelay App Download'''] | ||
+ | [[File:PiRelay-APP.PNG | 600px]] | ||
+ | |||
+ | * Make sure your Pi and Android Device are on the same network. Then in the app settings, you can define a custom Server URL. This is the network path to your Raspberry Pi. The default path is " http://raspberrypi/ ", however, you can define an IP address or a custom URL. To set up communication with your Raspberry Pi, click on '''≡ >> Pi URL Addresses''', then set Pi 1 : Your Pi IP Address (for eg: http://192.168.1.14) | ||
+ | * To turn on/off relays, Use Pins as Wiring Pi pinout shown above in Pinout table. | ||
+ | * To setup Relays, Click on '''≡ >> Number of Relays''', and set it to 2. | ||
+ | * Now again click on '''≡ >> Setup Relays''', Now click on any relay and set WiringPi Pin for '''Relay 1 as 24''', and '''Relay 2 as 23'''. You can also set Relay default status here. | ||
+ | * Now move back to the home screen and click on On/Off button to turn on/off relays. | ||
+ | |||
+ | ==== Raspberry Pi (Using Python) ==== | ||
+ | |||
+ | * Connect Home Automation HAT on GPIO header of Raspberry Pi. | ||
+ | |||
+ | * Clone or download the Home Automation HAT GitHub repository by running the below command. It will clone the repository on /home/pi location. | ||
+ | |||
+ | <source lang="shell"> git clone https://github.com/sbcshop/Home-Automation-HAT.git </source> | ||
+ | |||
+ | * Run the below command to enter the cloned repository. You can also use GUI to open cloned repository folder from the /home/pi location. | ||
+ | <source lang="shell"> cd Home-Automation-HAT </source> | ||
+ | |||
+ | * To test code, run the below command. It will turn on and off the relay at an interval of 0.5 seconds. | ||
+ | |||
+ | <source lang="shell"> python3 test.py </source> | ||
+ | |||
+ | * You can also run the GUI code by running the below command. It will open a window with 2 Buttons, You can use these two buttons to control the relays. | ||
+ | |||
+ | <source lang="shell"> python3 Home_Auto_GUI.py </source> | ||
+ | <br> | ||
+ | [[File:Home_Auto_GUI.gif | 500 px]] | ||
== Resources == | == Resources == |
Latest revision as of 05:34, 29 October 2021
Home Automation HAT
Home Automation HAT is a Home monitoring and automation controller HAT for the Raspberry Pi that can control up to 2 appliances/devices on a load of 250 VAC/7A, 30 VDC/10A, photo-coupling isolation Optocoupler EL357NC, allowing users to safely control high voltages or current devices. Home-Automation HAT makes appliances smart, which users can operate via the PiRelay app on their electronic device.
Features
- Compatible with Raspberry Pi 4, 3B+,3,2,Zero
- Relay Status Indicator
- Comes With Development Resources, including examples in Python
- COM, NO(Normally Open) & NC(Normally Closed) are available for each relay
- Connectivity of Relay With RPi Without GPIO
- Connectivity Using Stack Method
- Onboard Power LED Indicator
- Make Your Home IoT Enabled
- Relay Control Pins Selection Jumper
Specifications
- Operating Voltage - 220V AC (Via Terminal Block)
- External Load - 250 VAC/7A, 30 VDC/10A
- Relay Channels - 2
- Trigger Signal - 3.3/5V
- Optocoupler - (CTR: 50~600% at IF= 5mA, VCE = 5V)
- External Power Supply - Via Terminal Block
- GPIO - 40 Pins Stacking Header
- Load Connector - Screw Terminal Block for each Relay(Output)
Pinout
Relays | BOARD | BCM | Wiring Pi |
---|---|---|---|
Relay 1 | 35 | GPIO 19 | 24 |
Relay 2 | 33 | GPIO 13 | 23 |
Installation
CAUTION: Be careful when working with the electrical product. Special supervision of parent/adult is required to keep children from hurting themselves.
Connection Diagram
Raspberry Pi (Using PiRelay App)
PiRelay is an Android app you can use to Switch or Pulse the GPIO Pins of a Raspberry Pi connected to Relays. To use this app you will need to setup your Raspberry Pi and Relays. App Download link: https://play.google.com/store/apps/details?id=com.jasonfindlay.pirelaypro
- To setup PiRelay on Raspberry Pi, run the below commands one by one. Must complete all commands to make it work with Raspberry Pi.
Commands to Install: WiringPi, Apache, PHP & Download the GPIO PHP File
sudo apt-get update
sudo apt-get install wiringpi apache2 libapache2-mod-php -y
sudo wget https://pirelay.jasonfindlay.com/downloads/gpio.dl
sudo mv gpio.dl /var/www/html/gpio.php
Setting Up Your Android Device
- Download Pi Relay app from the Play Store here: PiRelay App Download
- Make sure your Pi and Android Device are on the same network. Then in the app settings, you can define a custom Server URL. This is the network path to your Raspberry Pi. The default path is " http://raspberrypi/ ", however, you can define an IP address or a custom URL. To set up communication with your Raspberry Pi, click on ≡ >> Pi URL Addresses, then set Pi 1 : Your Pi IP Address (for eg: http://192.168.1.14)
- To turn on/off relays, Use Pins as Wiring Pi pinout shown above in Pinout table.
- To setup Relays, Click on ≡ >> Number of Relays, and set it to 2.
- Now again click on ≡ >> Setup Relays, Now click on any relay and set WiringPi Pin for Relay 1 as 24, and Relay 2 as 23. You can also set Relay default status here.
- Now move back to the home screen and click on On/Off button to turn on/off relays.
Raspberry Pi (Using Python)
- Connect Home Automation HAT on GPIO header of Raspberry Pi.
- Clone or download the Home Automation HAT GitHub repository by running the below command. It will clone the repository on /home/pi location.
git clone https://github.com/sbcshop/Home-Automation-HAT.git
- Run the below command to enter the cloned repository. You can also use GUI to open cloned repository folder from the /home/pi location.
cd Home-Automation-HAT
- To test code, run the below command. It will turn on and off the relay at an interval of 0.5 seconds.
python3 test.py
- You can also run the GUI code by running the below command. It will open a window with 2 Buttons, You can use these two buttons to control the relays.
python3 Home_Auto_GUI.py
Resources
Github