A simple smart home system for everyone based on Raspberry Pi Zero – Part 3

Reading time: < 1 min.

Please make sure to read parts 1 and 2 of our tutorial here first:

PrzejdźPrzejdź
Previous
Next

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:

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:

 data-lazy-srcset=
A soldered board in a 3D-printed housing.

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.

Share:

Picture of Marcin Lesiński

Marcin Lesiński

Lover of electronics, 3D print and applied science. He has collected his knowledge since he was 14. He creates projects and guide books for clients in Botland. He spends his free time on automatic cultivation and prototyping. Rock music and British movies fan.

See more:

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.