The Pocket Science Lab from FOSSASIA https://pslab.io
This repository hosts the python library for communicating with PSLab. This can be installed on a linux pc/raspberry pi. With this, one can communicate with the hardware using simple python code.
The goal of PSLab is to create an Open Source hardware device (open on all layers) that can be used for experiments by teachers, students and citizen scientists. Our tiny pocket lab provides an array of sensors for doing science and engineering experiments. It provides functions of numerous measurement devices including an oscilloscope, a waveform generator, a frequency counter, a programmable voltage, current source and as a data logger. Our website is at: https://pslab.io
Please join us on the following channels:
To install PSLab on Debian based Gnu/Linux system, the following dependencies must be installed.
- PyQt 4.7+, PySide, or PyQt5
- python 2.6, 2.7, or 3.x
- NumPy, Scipy
- pyqt4-dev-tools For pyuic4
- Pyqtgraph For Plotting library
- pyopengl and qt-opengl For 3D graphics
- iPython-qtconsole optional
Now clone both the repositories pslab-apps and pslab.
- pslab-apps
- pslab
Note If user is only interested in using PSLab as an acquisition device without a display/GUI, only one repository pslab needs to be installed
$ cd <SOURCE_DIR>
and run the following (for both the repos)
$ sudo make clean
$ sudo make
$ sudo make install
Now you are ready with the PSLab software on your machine :)
For the main GUI (Control panel), you can run Experiments from the terminal.
$ Experiments
If a user wants to install the python library to have a command line interface to execute commands, he can do so by simply installing the dependencies and latest Python versions.
- Python 2.7 or Python 3.7 Link to Official download page
- Pip
- PySerial
- Numpy
- Install the latest Python version on your computer and configure
PATH
variable to have both Python installation directory and the Scripts directory to accesspip
tools. - Open up command prompt and execute the command
pip install pyserial && pip install numpy
to install the required dependencies.
- Download the PSLab-Python library from this repository and extract it to a directory.
- Browse in to that directory and create a new file named
test-pslab-libs.py
- Paste the following code into that file and save it.
from PSL import sciencelab
I = sciencelab.connect()
capacitance = I.get_capacitance()
print(capacitance)
- Plug in the PSLab device and check if both the LEDs are turned on.
- Now run this file by typing
python test-pslab-libs.py
on a command prompt and observe a numerical value printed on the screen along with PSLab device version and the port it is connected to.
To set up the development environment, install the packages mentioned in dependencies. For building GUI's Qt Designer is used.
First install sphinx by running following command
sudo pip install -U Sphinx
Then go to pslab/docs and run the following command
$ sudo make html