Data Acquisition in Jupyter notebook on Raspberry Pi
Project description
JupyterPiDAQ
This software allows live collection and plotting of analog data in a Jupyter notebook. The package was initially developed to provide an inexpensive laboratory system for teaching based on the Raspberry Pi. However, as the development has progressed the data acquisition board drivers have been separated out of the user interface, so that the software has potential to work on other computers running Jupyter with A-to-D board specific connector code. Presently the compatible A-to-Ds are for Raspberry Pis: Adafruit compliant ADS1115 boards (example, also available from other vendors); and the π-Plates DAQC2 plate. A demo mode will run on any computer with a Jupyter notebook install and Python 3.6+.
Sensors: Like many commercial educational packages the software knows about the properties of some sensors, so can collect data directly in the units appropriate for the sensor, in addition to the raw voltage signal returned by the sensor. Not all sensors are compatible with all boards. We attempt to keep this list of known sensors up-to-date, but the code may provide additional sensors not listed here:
- ADS1115 compatible (board can provide 3.3 V of power/reference to
sensors):
- voltage reading (V, mV) from any sensor that puts out a voltage in the range +/-3.3 V.
- built-in thermistor (V, mV, K, C, F).
- Vernier SS temperature probe (V, mV, K, C, F).
- DAQC2 compatible (board can provide 5.0 V of power/reference to sensors):
- voltage reading (V, mV) from any sensor that puts out a voltage in the range +/- 12 V.
- Vernier SS temperature probe (V, mV, K, C, F).
- Compatible with standard Vernier probes. Calibrations being added.
Author: Jonathan Gutow gutow@uwosh.edu
License: GPL V3+
Installation
Installation is meant to be done into a virtual environment from the PyPi repository. There are two modes "Production" for end users and "Development" for those who want to improve the package.
NOTE: If a binary distribution (whl or wheel) is not available for your
platform, some of the required packages may need to be compiled. This will
require the python header and development files for your platform. To get
on most *nix platforms use the command sudo apt install python3-dev
.
Production
Development
Basic requirements: Python 3.6+, associated pip and a Jupyter notebook. See: python.org and Jupyter.org.
- If not installed, install pipenv:
$ pip3 install --user pipenv
. You may need to add~/.local/bin
to yourPATH
to makepipenv
available in your command shell. More discussion: The Hitchhiker's Guide to Python. - Navigate to the directory where this package will be
or has been downloaded to. Use
pipenv
to install an "editable" package inside the directory as described below:- Start a shell in the environment
$ pipenv shell
. - Install using pip.
- If you downloaded the git repository named "JupyterPiDAQ"
and have used that directory to build your virtual
environment:
$ pip install -e ../JupyterPiDAQ/
. - If you are downloading from PyPi (not yet available)
$ pip install -e JupyterPiDAQ
- Either should install all the additional packages this package depends upon. On a Raspberry Pi this will take a long time. It probably will not run without at least 1 GB of swap. See: Build Jupyter on a Pi.
- If you downloaded the git repository named "JupyterPiDAQ"
and have used that directory to build your virtual
environment:
- Still within the environment shell test
this by starting jupyter
$ jupyter notebook
. Jupyter should launch in your browser.- Open a new notebook using the default (Python 3) kernel.
- In the first cell import all from DAQinstance.py:
from DAQinstance import *
. When run this cell should load the DAQmenu at the end of the Jupyter notebook menu/icon bar. If you do not have an appropriate A-to-D board installed you will get a message and the software will default to demo mode, substituting a random number generator for the A-to-D. Because of the demo mode it is possible to run this on any computer, not just a Pi.
- Start a shell in the environment
- If you wish, you can make this environment available to an alternate Jupyter
install as a special kernel when you are the user.
- Make sure you are running in your virtual environment
$ pipenv shell
in the directory for virtual environment will do that. - Issue the command to add this as a kernel to your personal space:
$ python -m ipykernel install --user --name=<name-you-want-for-kernel>
. - More information is available in the Jupyter/Ipython documentation. A simple tutorial from Nikolai Jankiev (Parametric Thoughts) can be found here.
- Make sure you are running in your virtual environment
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for JupyterPiDAQ-0.5.0rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a8c5acce08b35c6dac88e768b6bf4d734163af4cdb9f333b833ca14a859a09f |
|
MD5 | aa8a370ef456feaeb9f76b145a19f2bd |
|
BLAKE2b-256 | 5fe7e60df36ab8a4970ba26ccbcd08a65a2e751418bc57cf9e89dd4cb9163958 |