Spis treści:
Please make sure to read parts 1 and 2 of our tutorial here first:
After we have created a working prototype, we can start to build a fully functional device, encapsulated in a suitable casing and with a professional PCB layout.
Mounting and soldering on a PCB
We need some hardware to build the final device:
- PCB
- Raspberry Pi Zero W
- Memory card for the minicomputer
- 12V power supply
- DC jack
- Diode 1N5819 – 4 pieces
- Capacitor 100nF – 4 pieces
- Relay HLS8L-DC5V-S-C 4 pieces
- Measuring probe with DS18B20
- 5V voltage stabilizer
- 4.7k Ohm resistor – 5 pieces
- BC557C transistor – 4 pieces
- ARK 2-pin connectors – 5 pieces
- ARK 3-pin connectors – 1 piece
- 2 × 20 female goldpins
When you have all the elements ready, you can start the assembly. The board has a descriptive layer, thanks to which we know how to place and then solder the elements. The board with the elements soldered to it should look like this:
We have to solder two wires to the power socket and connect it to the ARK connector. The polarity is marked on the board. We also need to attach all three wires to the connector for the DS18B20 sensor, this time without the 4.7k Ohm resistor as it is built into the board.
We connect the wires coming from the sensor probe to the ARK connector as follows:
- red to 3.3V – VCC
- black or green to GND – GND
- white or yellow to the connector inside – the data pin
Finally, we have to attach the Raspberry to the plate. The connection is made by pressing the RPi pins onto the pins on the board. Finally, we have to connect the devices we want to control: a detailed description of the connection can be found in the article about access control.
Arrangement of the board in the casing
If all wires are connected as desired, we can continue. To ensure that the board works safely, we will install it in a suitable casing. Right at the beginning we will fix the board in the lower part of the casing, which can be screwed on any surface. We should try to fix the casing in such a place that it is as close as possible to the devices it is supposed to control. After screwing and inserting the board, we can put the upper part of the casing on and connect the power supply. After a while the server will turn on and we will be able to control the devices and read the temperature with its help!
Controlling devices from anywhere in the world
At the moment we have the possibility to control devices, provided we are connected to a network to which our Raspberry is also connected. In order to control these devices from any other location, our network must meet one condition – it must have a fixed IP address.
How can we check that our network meets this condition? It is very simple! Run the command line on the computer connected to this network and type:
“ipconfig /all”
Now we look for “DHCP ENABLED”. If the value is “YES”, unfortunately we do not have a fixed IP address and cannot make the project available to the network, but if we see “NO”, then we can go on.
Now we have to redirect port 80, it is used to transfer data in HTML protocol, and it will allow us to publish the local page. Unfortunately, there is not a single method to redirect port 80: each manufacturer of network devices has its own menu and switching methods, so we recommend to follow the manuals of these manufacturers. Just remember that we have to use the address of our Raspberry for redirection.
Now let’s type the IP address into the browser of the device that is not connected to the local network. In this step, we should be able to manage individual devices through a website that was previously only available on the local network – and now it can be accessed from anywhere in the world.
Ready! Now you can enjoy a fully functional, self-created Smart House system!
How useful was this post?
Click on a star to rate it!
Average rating 0 / 5. Vote count: 0
No votes so far! Be the first to rate this post.