Introduction: Smart Serre

In this tutorial I'll be showing you how you can make a fully automated conservatory using a Raspberry Pi.

Let's get started.


The main components are the following: Raspberry Pi, mcp3008 chip, L293D chip, Soil Moisture Sensor, Dallas 18b20, Light Dependent Resistor (LDR) and if you prefer you can add a lcd screen (optional). You can see a detailed version in this excel document with links where you can buy the components.

Step 1: Setup

First things first, let's setup our Raspberry Pi, start by downloading an image on the micro SD-card. Then connect your Raspberry Pi to your computer using an ethernet cable. Now you can store the database in the Raspberry Pi. To do that I'm using 'MyQSL Workbench' but feel free to use another program. Start by making a new connection with the apipa address of your Raspberry Pi, then make the tables you can see in the picture. Once you have done that you'll have to fill the sensor table manually with all the sensors you're using.

Step 2: Connect the Components

First let's make the setup for this you will need a lot of jumper cables (male to male) and 2 220Ω resistor and if you choose to connect the lcd display then you'll also need a potentiometer.

Follow the scheme exactly, because 1 wrong placed wire could break your Raspberry Pi.

Step 3: Make the Conservatory

The next step is fairly simple, you just buy any conservatory (doesn't really matter which one, jus make sure it's big enough) and assemble it.

Step 4: Mount the Motor

This step may be a little trickier, we're going to assemble the motor so that it pushes the window open (the first picture is just a prototype). It's not the simplest in design but it works like a charm. I've connected a long screw to the motor and I've screwed a bolt on the screw. To that bolt I've attached a wooden stick and this stick pushes the window open. Because if the motor starts spinning, so will the screw, but because they're both fixed, they can't move which means that only the bolt (and the wooden stick) can move and so pushes or lowers the window.

Step 5: Mount the Water Valve

The valve is way easier than the motor, if currency flows through the valve then it opens, which causes the water to go through, if no currency is flowing through then the valve is closed.

I've attached a short pipe to the valve so you can attach a reservoir for the water, just don't forget to regularly check if there're enough water left.

Step 6: Website

Now we'll start with creating the website where you'll be able to see the last measurements and control the water valve and the window manually.

You can use my code for the website with this link

Step 7: Python Code

Now for the main code, I would advice to just copy my code, except if you know what you're doing of course. Use this link to go to my code