Skip to content

boy-who-codes/pslab-desktop

Repository files navigation

PSLab Desktop

Desktop application for the Pocket Science Lab (PSlab) open hardware platform.

Development Build Status Master Build Status Codacy Badge Mailing List Gitter Twitter Follow

This repository holds the PSLab Desktop application. It is using ElectronJS running ReactJS on top as UI renderer and uses Python scripts under the hood for device communication. The goal of PSLab is to create an Open Source hardware device (open on all layers) and software applications that can be used for experiments by teachers, students and scientists. Our tiny pocket lab provides an array of instruments for doing science and engineering experiments. It provides functions of numerous measurement tools including an oscilloscope, a waveform generator, a frequency counter, a programmable voltage, current source and even a component to control robots with up to four servos. Our website is at: https://pslab.io

PSLab Banner

Buy

Communication

Please join us on the following channels:

Project Overview

A number of instruments have already been implemented.

1. User Interface

The UI has been desgined to match the existing android app so that the user does not have to invest time on understanding the desktop app from scratch.

2. Oscilloscope

A four channel oscilloscope with a 25FPS refresh rate. Comes with features like variable time-base, fourier transform, sine/square fitting and XY plotting.

3. Logic Analyzer

A four channel logic analyser. It supports variable edge detection modes for the user to analyze digital waveforms.

4. Multimeter

It can be used to measure voltage, resistance, capacitance, wave frequency etc.

5. Wave generator

This can be used to generate sine/triangular and PWM waves of different frequencies and phase angles.

6. Power source

Three programmable voltage sources and one programmable current source that can be used to power external circuits.

7. Robotic arm

A neat UI that can be used to program four servo motors ( placed in a robotic arm ) using a timeline.

8. Data logger

Data can be captured and saved in a CSV file. We also have a playback feature in place that lets the user replay the data from the CSV file.

Features and Implementation Status

Feature Description Status
Home Screen Show status and version of PSLab device ✔️
Instruments Exposes PSLab instruments like Oscilloscope, etc ✔️
Oscilloscope Shows variation of analog signals ✔️
Multimeter Measures voltage, current, resistance and capacitance ✔️
Logical Analyzer Captures and displays signals from digital system ✔️
Wave Generator Generates arbitrary analog and digital waveforms
Power Source Generates programmable voltage and currents ✔️
Lux Meter Measures the ambient light intensity
Barometer Measures the Pressure
Accelerometer Measures the acceleration of the device
Gyrometer Measures the rate of rotation
Compass Measures the absolute rotation relative to earth magnetic poles
Thermometer Measures the ambient temperature
Gas Sensor Detects gases, including NH3, NOx, alcohol, benzene, smoke and CO2
Robotic Arm Controller Allows to control 4 servo motors of the robotic arm independently ✔️

Roadmap

The goal of the project is to provide a fully functional science application that works with PSLab and other open scientific hardware. Furthermore the application should be fully compatible and feature matching to the PSLab Android app. Current status of the development:

  • Implement all major instruments
  • Have an effective build system for linux and windows
  • Have a basic data logging feature in place
  • Implement interface for I2C sensors
  • Implement more minor instruments
    • Lux meter
    • Gas meter
    • Compass
    • pH meter
    • Accelerometer
    • Barometer
  • Make data logging and playback more robust
  • Code refactoring and architecture improvement

How to Contribute

Great you are interested in contributing! Please check the issue tracker for open bugs and feature requests and read the community guidelines of FOSSASIA to start.

Branch Policy

  • The development branch holds is the standard branch of the project. PRs are merged to this branch and tested on an ongoing basis.
  • The master branch holds the stable version of the project and merges the development branch regularly after it is tested thouroughly.
  • The install install branch holds autogenerated install images for Linux and Windows. It is generated through using a Travis script and created automatically on merged PRs in the dev and master branch.
  • The gh-pages is currently outdated, but is intended to hold information of the project from the Readme.md and /docs folder.

How to Install

The install branch of the PSLab-Desktop repository hosts all the installers that we support for different desktop platforms. You can either install the app directly from the debian .deb package file or windows installer file. "Stable installers" are generated and updated on a weekly basis and are created from the master branch automatically. "Development Installers" are generated and updated on every PR merged on from the development branch. These installers are used for testing purpose.

How to Install on Linux

Download the .deb file from the install branch and click the file to open it using your package manager or use the following commands in your terminal:

sudo dpkg -i <deb-file-name>

For testing purpose, you can install the snap package generated by the above command using:

sudo snap install --dangerous --classic <snap-package-name>

How to Install on Windows

Download the windows files from the install branch and execute the file to install the system on your Windows machine.

How to Setup the Project from Source on Your Development Environment

  1. Fork the project to get a copy of the repository in your github profile.
  2. Clone the copied project from your profile ( Not the original repository from FOSSASIA ).
  3. cd into your project folder.
  4. git remote add upstream https://github.com/fossasia/pslab-desktop.git This command will set up the upsteam link.

Installing development dependencies

While in your project folder

npm install

This command will install all the necessary dependencies required by the electron app to run. As this app uses the PSL library under the hood for device communication, you'll have to install it as well. The instructions to install it are provided here. After installation of PSL make sure you can property import it in Python3. Run the following command in your bash shell.

python3
>>> from PSL import sciencelab

If this command runs without throwing an error, then you are good to go.

Starting the app

All commands to start and debug the app are outlined in the package.json. To simply get it running run the following command while in your project repository.

npm start

And wait for the electron shell to open.

Creating Production Builds

We are generating production builds automatically in the install branch of the project. The build pipeline generates a debian file that can be installed on any debian based distro. A .win file is generated as well. You can also build the files yourself.

How to Build for Linux (Debian based OS)

While in the project root

npm run build-linux

How to Build for Windows

While in the project root

npm run build-windows

This command will produce a build and a dist directory inside the project folder. The build folder contains the optimized react files, while the dist folder contains the final electron installers.

How to Build for Other Platforms

While in the project root

npm run build

License

This project is Free and Open Source software. The project us licensed under the GPL v3. Copyright is owned by FOSSASIA. More details in the license files.

Maintainers

The project is maintained by

Packages

No packages published

Languages

  • JavaScript 86.0%
  • Python 12.3%
  • HTML 1.4%
  • Other 0.3%