Photographing water drops using Raspberry Pi – The web server

The python – flask – web server.

I told you that I will publish the program code to communicate with the Raspberry Pi via web interface. This is part one. I show you the requirements.

I decided me to use python and flask, because I know how can I control the Raspberry GPIO pins with python. And the web server is a python web server! We need no java or javascript, no php or other languages for our project.

We need python (already installed) and an additional package, named flask. Flask is a powerful framework for python. No worry, it’s easy to use.

To install flask, we need the python pip module. So, you must install two packages (as root, or using sudo):

      apt-get install python-pip
      pip install flask

The next step is creating the folder structure. For our project, we need a main folder. I name this folder waterdrops.
In this folder we need the following subfolder: static and templates.

    |-- waterdrops
           |-- static
           |-- templates

In the subfolder static we store images, which we use at the web page. The html pages are stored into the template subfolder.
The main program is stored in the main folder (waterdrops).

The files we use:
– index.html   (the main web page)
– layout.html  (the master web page )
– favicon.ico   (a small icon  like google, not necessary)
– wassertropfen.JPG (a picture for our web page)
– (the main python program)

    |-- waterdrops
           |-- static
           |       favicon.ico
           |       Wassertropfen.JPG
           |-- templates

So, that’s are all requirements we need.
In the next part I show you the complete program codes of the project.

Photographing water drops using Raspberry Pi

I finished the next part of another project: water drops photography.

There are a lot of amazing photos about this theme. I decided to try this self. I started with a simple equipment. First with an injection set, a flash light and a lot of time! The result was great! The next step was to buy a light barrier to trigger the camera and a solenoid valve to produce the water drops. The solenoid valve is already controled by the Raspberry Pi.
Now, I removed the light barrier and trigger the camera with the Raspberry Pi too.
This is the current state.

In the next days I will show you the circuit and the python sketch.Image