Smart lighting , smart home appliances, smart security system – more and more smart appliances come to our homes. But to manage them, you still need a person. And to make it easier to manage all these devices, you need one control center.
It is just such a panel for controlling smart home devices that a master DIYer presents in this article.
Tools and materials: -Raspberry Pi 3A +; – 3.5-inch touch screen; -Micro SD card 32 GB; -USB-microphone; -USB-speaker; -USB-hub; -Jumper wires; -Microswitch; -Screwdrivers ; -Engraver; -3D-printer; -Wire stripping tool;
PuTTYRaspberry Pi ImagerIP Scanning ToolNotepad ++ Step One: Speaker
First you need to prepare your speaker.
Removes the rubber feet from the bottom of the speaker. Loosen the screws and remove the indoor unit from the case.
Disassembles the indoor unit and pulls out the speaker. Expands the hole in the lid and pulls out the USB cable.
Step two: microphone
Now you need to prepare the microphone.
Drill a hole on the edge of the microphone housing. Then he removes the cover and takes out the board with the microphone.
Step Three: Installing Raspbian
Now you need to install Rassbury OS to your SD card. < br> Installs an SD card into the computer. Downloads and installs the Raspberry Pi Imager. After installation, it opens the program and selects 'CHOOSE OS' from the menu. Next selects Raspberry Pi OS (32-bit).
Clicks 'CHOOSE SD CARD' and selects the SD card installed in the computer. Then 'WRITE' and you need to wait for the process to complete.
Step four : network protocol
Next, you need to open the explorer and select the device named “boot”. Then click 'New' – 'Folder' – 'Shortcut'.
This will create a new file with SSH extension.
Next, you need to create a new text file called wpa_supplicant.conf, open it in a text editor and paste in the code snippet.
ctrl_interface = DIR =/var/run/wpa_supplicant GROUP = netdev update_config = 1 country = & lt; Insert 2 letter ISO 3166-1 country code here & gt; network = & # 123; ssid = & # 34; & lt; Name of your wireless LAN & gt; & # 34; psk = & # 34; & lt; Password for your wireless LAN & gt; & # 34; }
Information in brackets & lt; & gt; you need to replace with your data.
ctrl_interface = DIR =/var/run/wpa_supplicant GROUP = netdev update_config = 1 country = GB network = & # 123; ssid = & # 34; Home-WiFi & # 34; psk = & # 34; Password123 & # 34; }
Now you can remove the SD card.
Step Five: Connecting the Screen
Installs the screen on the Raspberry Pi and installs the SD card. Connects power supply.
Step Six: IP Address
Next download and install the IP Scan Tool.
After installation clicks “Scan”
Please note: other Raspberry Pi with unknown IP addresses should be disabled to avoid conflict.
When the table is full, the 'Manufacturer' column should read “Raspberry Pi Foundation”.
This IP address should be noted.
Step Seven: Connecting
To connect to the Pi, you will need to use PuTTY. You can install PuTTY from here.
After installation, you need to enter the Pi's IP address and click 'Open'. When you open a window that says 'PuTTY Security Alert', press 'Yes'.
Then, when prompted to enter a username, enter 'Pi' and press Enter. Then enter “raspberry” as a password and confirm.
Next, install the driver.
Enter the following commands into the PuTTY terminal:
< code>cd ~ sudo rm -rf LCD-show git clone https & # 58; //github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/sudo ./LCD35-show sudo reboot
Now the device should reboot, and an image should appear on the screen.
After that, you need to remove the memory card and install it in the PC.
Next, you need to open the config.txt file on the “boot” disk and scroll down to the end.
Then add the following lines to the file:
hdmi_group = 2 hdmi_mode = 87 hdmi_drive = 2 hdmi_cvt = 320 480 60 1 0 0 0
After this operation, the map must be reinstalled in the Pi and turned on.
< img class = "aligncenter" alt = "Universal panel for smart home control" src = "https://usamodelkina.ru/uploads/posts/2021-04/1617830715_1-54.jpg"/> Step seven : Final Assembly
Removes the screen from Rusbury. Then he mounts 4 wires as in the photo below.
Blue = Ground
Brown = Ground
Purple = Ground
Yellow = GPIO 16
Red = GPIO 20
Orange = GPIO 21
Then the wires need to be brought out and the screen installed in place.
Since the Raspberry Pi 3A + only has one USB port, a USB hub needs to be installed. To do this, cut the rubber around the USB plug and place the device between the Pi and the screen.
Next we need 3D printed parts. Files for printing can be downloaded here.
Then from the 3 tactile buttons you need to cut off two pins. Install buttons in the holes of the holder.
Connects one pin of each button to ground, and the other to GPIO 16, 20 and 21, respectively.
Installs the holder into the case cover and fixes it with glue. GPIO pin 16 should be on top.
Installs Rassber with a screen in the lid.
To the appropriate seats installs a microphone and speaker. Then it connects them to a USB hub.
Step eight : Setting up Google Assistant
Now you need to set up Google Assistant.
First you need to open the Google Action Console and add/import a project.
Then click Next and click Save Features. The next step is to format the USB stick and copy the credentials file to the USB root.
Then go to this address and load the example config.ini, change the values of modelID and projectID to match the values from the Google Assistant service.
& # 91; config & # 93; ; Enable/Disable debug mode, 0 = disabled, 1 = enabled debug = 0 & # 91; assistant & # 93; ; Assistant can be & # 39; googleAssistant & # 39; (for google assistant) assistant = googleAssistant; Enter IDs modelID = & lt; ModelID & gt; projectID = & lt; ProjectID & gt; ; File for hotword detection (COMING SOON); model = /file/model.pmdl<br>
& # 91; config & # 93; ; Enable/Disable debug mode, 0 = disabled, 1 = enabled debug = 0 & # 91; assistant & # 93; ; Assistant can be & # 39; googleAssistant & # 39; (for google assistant) assistant = googleAssistant; Enter IDs modelID = iot-control-panel-fgerg projectID = iot-control-panel-greqf; File for hotword detection (COMING SOON); model = /file/model.pmdl
Now you need to copy the edited config.ini file to the root of the USB stick and connect the USB stick to one of the P.'s USB ports.
Step Nine: Installing the main program
Now you need to scan the IP address, connect to it using SSH, as shown earlier, and execute the following commands:
cd ~/sudo apt update & amp; & amp; sudo apt upgrade -y sudo apt install git python3 libjpeg-dev libtiff5-dev libnotify-dev libgtk2.0-dev libgtk-3-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libwebkitgtk-dev freeglut3 freeglut3-dev portaudio19-dev libffi-dev libssl-dev python-rpi.gpio python3-rpi.gpio python3-wxgtk4.0 python3-wxgtk-webview4.0 python3-wxgtk-media4.0 -y sudo python3 -m pip install --upgrade pip setuptools wheel google-assistant-sdk & # 91; samples & # 93; google-auth-oauthlib & # 91; tool & # 93; PyAudio urllib3 & # 91; secure & # 93; sounddevice click tenacity futures pathlib2 google-assistant-grpc google-auth-oauthlib appdirs git clone & lt; a href = & # 34; https & # 58; //github.com/Bluebotlaboratories/Universal-IoT-Control-Panel.git" ; rel = & # 34; nofollow & # 34; & gt; https & # 58; //github.com/Bluebotlaboratories/Universal-...</a> cd Universal-IoT-Control-Panel python3 ./install.py
Then you just need to follow the installation steps.
After flashing the device, you need to install the back of the case and you're done. Now the panel will scan and connect to any smart device and can be controlled using the console.