My Domotica

14000

Intro: My Domotica

My Domotica is a system that makes your house safer and easier to control. I build this project because I am interested in home automatisation and I like doing it. You can control the temperature, alarm and a light with the site. The light automatically turns on and off with the help of a motion detector. At last there is a smoke detector for the safety.

STEP 1: Tools Required

  1. Soldering iron
  2. File
  3. Drill
  4. Screws
  5. Woodwork tools

STEP 2: Circuit Diagrams

LCD screen

On the LCD screen you can see the ip-adress to wich you can surf to go to the site. You can also see the temperature on the screen. The 74HC595 is a shift register used to control the LCD screen. If I dont use a shift register, the LCD screen would take up to much IO pins.


TMP36

The TMP36 is a temperature sensor. The temperature sensor has an analog output, thats why I use the MCP3008.

MCP3008

The Raspberry Pi can't read analog signals so that is why we use the MCP3008. The MCP3008 is an analog to digital converter(ADC). This is used to convert analog signals that come from sensors and convert them into digital signals.


MQ-135

The MQ-135 is a smoke detector that can give an analog and digital output. I use the analog output and connect it to the MCP3008

Mini PIR

The mini PIR is a pyroelectric infrared motion sensor. The sensor gives an analog signal when it detects movement. It can detect movements from 3 meters far. This sensor is also connected to the MCP3008.

Buzzer

The buzzer is used as an alarm. It is connected to a 110 Ohm resistor. If you give the buzzer a digital signal it will make a loud sound.

Raspberry Pi Fan

This is the fan to control the temperature. If the temperature is to high the fan will turn on. The fan is controlled with an BC547 transistor. This is because the fan runs on 5v but the RasPi(Raspberry Pi) can only supply 3v so I used a transistor.

Lamp

The lamp is controlled by a relais that switch 230v and 30A. It is a 5v -230v relais, this means you give a 5v signal. Like I said before the RasPi can only suply 3v so that is why I use a 3v-5v step up module. I can use a transistor here because the transistor can't deliver enough current.

STEP 3: Making the Circuit

First off I started by reading the temperature sensor and putting that on my site. Once that worked I started by connecting all the other electronic devices. I use 2 breadboards to connect the components with the Raspberry Pi.

If you look at my diagrams you can recreate the whole circuit.

STEP 4: Setting Up the Pi

Before I started programming I had to set up the RasPi.

Step 1: Connecting the RasPi to the internet:

use the command:

"wpa_passphrase >> /etc/wpa_supplicant/wpa_supplicant.conf"

Replace by the name of your wifi at home and by your wifi password.

Then use the command "wpa_cli -i wlan0 reconfigure" to reset the network card of the RasPi. If you then use

"ping www.google.com" you should get a connection.

Step 2: Full update/upgrade:

  • Use the command "apt update" to update the RasPi.
  • Then "apt upgrade" to upgrade the RasPi. If they ask if you are sure press 'y'.

Step 3: Installing apache:

  • "apt install apache2 -y" to install apache, webserver.

Step 4: Install MariaDB:

  • U can find a lot of tutorials to do this so I will just leave a link here.
  • MariaDB is used for the database.

STEP 5: The Code

I use Visual Studio Code for my coding. You can find my code here

STEP 6: The Database Schematics

The database is very simple and is easy to understand. Each component is listed in the component table and then every measurement is stored in the meting table with the componentid of the right component.

STEP 7: Making the Case

Step 1: Drawing and cutting

First off I started by drawing the case on my wood with a pencil. When that was done I cutted it with a saw and used a file to smoothen the edges so I don't get splinters.

Step 2: Painting

Once everything was cut I painted the inside of the house white and the outside red. The roof is kinda black.

STEP 8: Putting It All Toghether

Step 1: Screwing it together

Once the paint was dry I started by screwing everything together so it looks like a nice house.

Step 2: Mounting everything in the case

Then I assembled everything in the case and made wholes so every component fits perfect.

STEP 9: Decorating

At last I decorated a little bit because it was kinda empty. Then I was done. I finished my project. I can control the temperature with my site, turn on my lamp (wich it automatically does because of my motion sensor) and control my alarm.