Do you ever feel like laying in your bed and not wanting to get up? Do you ever feel like getting up to open your shutters is to much to ask for? Then I have the perfect solution for you. Introducing Smartroom, take control of your room with your mobile phone, tablet or even your computer!
In the next step I will be showing the list of supplies that you will need. Most important of all you will need to have a Raspberry Pi and your computer.
Step 1: Gathering All of Your Supplies
Most important, the supplies! I have placed everything in an Excel spreadsheet.
Step 2: Building the Housing
For the housing I used an MDF panel size 122 cm by 61 cm, you can find those at any DIY store. Cut them with a circle blade saw with the dimensions in the drawing. The panels are then glued together with the Soudal Fix All glue. Painting is optional but gives it a nice touch :), I used the types of paint as seen in the pictures above. For the curtains I made a single sheet of the thinnest fabric I had. I also had a plastic tube laying around with a 90 degree angle. I cut those in pieces for the sensors to fit in.
Step 3: Making the Circuit
This isn't the smallest electrical circuit but this is what makes this project fun. Try to avoid crossing jumping wires. The wires that don't go to the same breadboard should be longer. You can either solder two wires or connect male to female wires with each other.
Step 4: Download the Code From Github
You can download the code for this project on my Github, the link is https://github.com/howest-mct/1920-1mct-project1-V... Click on Code and download the backend and frontend.
Make an SSH connection between your PI and Visual Studio Code, if you don't know how, here is a little tutorial. https://code.visualstudio.com/remote-tutorials/ssh...
In VS Code, create a new folder and call it whatever you want, seriously, it doesn't matter. Paste all the files from the Backend in that folder. Part one done. Now navigate to /var/www/ on VC Code and paste the frontend files in there. The coding part is now done!
Step 5: Create the MySQL Database
The program I use for creating databases is MySQL Workbench. You can find the download link here. https://dev.mysql.com/downloads/workbench/
Create a wireless connection, refer to my settings, make sure that the SSH hostname is the IP address of your RPi.
Now go to the icon under File in the top left of the screen, click on it, it should open a plain SQL File. paste the smartroomdb.txt code in there and run it (the yellow lightning bolt). Now you are golden!
Step 6: Testing the Smartroom
Now that most of the technical parts are done, go to your just created folder in VS Code and start the app.py. There is a little starting icon on the top right corner. Now go to your browser and type in your RPi's IP address. You should see the site.
This website is created mobile first! So yes you can use this project on your phone. Just type in your RPi's IP address.
You can also let the project start when your Raspberry Pi starts. If you want to do this you will have to create a service of app1.py. Follow this tutorial https://www.raspberrypi.org/documentation/linux/u...
You will have to change main.py to app1.py and change the directory to the directory where app1.py is located. Test if everything works in the electrical circuit. If so, move on to the next step!
Step 7: Putting the Circuit Inside Your Housing
You have reached the last part, congratulations!
Two holes will need to be drilled in the walls. One where the dressing is and one underneath the desk. You can use a regular drill for that. After that the breadboard with the MCP3008 and the L293D go underneath the dresser and the other breadboard goes underneath the bed. Cable management is up to you. I used a couple of sticky pads that I found in my local DIY store (Hubo).
Step 8: Enjoy the Smartroom!
You are now fully set up to use the smartroom, no more getting up to open your shutters!
Participated in the
First Time Author Contest