Poseidon Syringe Pump

From MC Chem Wiki
Revision as of 17:43, 22 January 2019 by Ballen (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

Overview

This page is dedicated to the set-up of the Poseidon Syringe Pump (as originally constructed by the Pachter Lab at CalTech) for Advanced Physical Chemistry (Spring 2019). The project page is found here: Poseidon.

Obtaining Materials and Printing Parts

You can find the list of materials and vendors here.

Next, you must print the parts for the syringe pump apparatus.

The .stl files for the 3D printed parts can be found here.

Assembly of 3D-Printed Parts

The Pachter lab has created helpful videos on the construction of the pump apparatus once you have all the necessary materials and 3D printed parts.

Syringe Pump Assembly

Microscope Assembly (Optional)

Raspberry Pi Set-Up

If you are using a brand-new Raspberry Pi, you should see this page on set-up basics.

Once you have installed your Raspbian OS using NOOBS, you should connect to a Wi-Fi network. Then, open a terminal and run the following:

To update the Pi:

    sudo apt-get update

To upgrade the Pi:

    sudo apt-get upgrade

(If either of the above commands fails, then you have not connected to a Wi-Fi network yet... Do this and try again.)

To install a necessary GUI dependency:

    sudo apt-get install python3-pyqt5

To install a necessary library that will allow us to establish a serial connection between the Raspberry Pi and the Arduino:

    sudo pip3 install pyserial

We need to install a library called OpenCV, but first must get its dependencies by using the following commands:

    sudo apt-get install libatlas-base-dev
    sudo apt-get install libjasper-dev
    sudo apt-get install libqtgui4
    sudo apt-get install libqt4-qt3support
    sudo apt-get install libqt4-test

There is apparently some difficulty with loading OpenCV through the terminal... So we will put some extra steps into the process. We first must install an updated version of the Python Package Manager (pip) via the following:

    wget https://bootstrap.pypa.io/get-pip.py
    sudo python3 get-pip.py

Now officially getting OpenCV-Python is another series of steps:

    wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.4.1.zip
    wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.4.1.zip
    unzip opencv.zip
    unzip opencv_contrib.zip
    sudo apt-get install cmake
     cmake -D CMAKE_BUILD_TYPE=RELEASE \
     -D CMAKE_INSTALL_PREFIX=/usr/local \
     -D INSTALL_PYTHON_EXAMPLES=ON \
     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \
     -D ENABLE_PRECOMPILED_HEADERS=OFF \
     -D BUILD_EXAMPLES=ON ..

Now, open a new tab in the terminal (SHIFT+CTRL+T) and do the following:

    cd
    cd ..
    cd etc
    sudo nano dphys-swapfile

You will have to save the file using CTRL+O (this will write out the change to the file) and then hit enter. Now hit CTRL+X to exit the Nano Editor.

    sudo /etc/init.d/dphys-swapfile stop
    sudo /etc/init.d/dphys-swapfile start

This is done to facilitate compiling the OpenCV code using all four cores of the Raspberry Pi... Now, back to the other tab. Enter the following:

    make -j4

This should take care of the compilation. Since we have allowed all four cores of the Pi, this should only take about 2 hours... (Yes, I know that is a long time to wait - grab yourself a cup of coffee.)

WARNING: You had better put your heatsinks on the processors of the Pi before running this because it is going to use every bit of processing power that the Pi has... It's going to run at 100% for the entire time and give you a temperature warning.

Next, you simply need to run the installation:

    sudo make install
    sudo ldconfig

Now you should test the installation. This can be done by firing up a Python3 interactive console and using two lines of code...

To launch a python3 interactive console:

    python3
    import cv2
    cv2.__version__




Arduino Assembly

Raspberry Pi Assembly