Repository for the PSLab Android App for performing experiments with the Pocket Science Lab open-hardware platform.
This repository holds the Android App for performing experiments with PSLab. PSLab is a tiny pocket science lab that provides an array of equipment for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. Our website is at https://pslab.io.
Sign up for the latest updates and test new features early by joining our beta program here.
- You can get a Pocket Science Lab device from the FOSSASIA Shop.
- More resellers are listed on the PSLab website.
- The PSLab chat channel is on Gitter.
- Please also join us on the PSLab Mailing List.
- First we need to get communication between Android App and PSLab working.
- Implement Applications and expose PSLab Hardware functionality to the user.
- Implement wireless connectivity
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- PSLab Android App Overview.
- Observing Sound Waveforms Using PSLab Device.
- Real-time Sensor Data Logging Using Pocket Science Lab.
- Generating and Observing Waveforms Using Pocket Science Lab.
| 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 | ✔️ |
| Luxmeter | 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 | ✔️ |
This is a Flutter cross-platform application that supports:
- Android (primary platform)
- iOS
- Linux (with USB device support)
- macOS
- Windows
- Web
The app interfaces with PSLab hardware devices via USB and provides scientific instrument functionality.
Flutter & Dart
- Flutter (stable channel)
- Dart (bundled with Flutter)
Java
- Java (LTS version required for Android builds)
brew install --cask flutterFollow the official Flutter install guide for Linux: https://docs.flutter.dev/get-started/install/linux
Follow the official Flutter install guide for Windows: https://docs.flutter.dev/install/windows
The instructions below explain how to install the Flutter SDK, set up Visual Studio Code with the Flutter and Dart extensions, and run the project using flutter run. These steps avoid Android Studio-specific instructions and focus on a minimal, cross-platform Flutter workflow.
Prerequisites
- A supported operating system (Windows, macOS, or Linux).
- A working internet connection to download the Flutter SDK and extensions.
- Install the Flutter SDK
- Download the Flutter SDK from https://flutter.dev and follow the platform-specific instructions. On Windows, extract the SDK (for example to
C:\src\flutter) and add thebinfolder to your PATH environment variable. On macOS/Linux, follow the steps on the Flutter website for addingflutterto your PATH. - After installation, open a terminal (PowerShell on Windows) and run:
flutter --version
flutter doctorResolve any missing components suggested by flutter doctor. If you plan to build desktop apps, follow the platform-specific toolchain steps suggested by flutter doctor (e.g., install Visual Studio on Windows for Windows desktop builds).
- Set up Visual Studio Code
- Install VS Code (if you don't have it) and open the project folder in VS Code.
- Install the following extensions from the Extensions view:
- Flutter (includes the Dart extension)
- Dart (if the Flutter extension did not install it automatically)
- (Optional) If VS Code cannot find the Flutter SDK, set the
dart.flutterSdkPathsetting to the SDK location in your VS Code settings.
- Prepare the project and run
- In the project root, fetch packages and generate any code:
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs # if the project uses code generation- Run the app on the default device (emulator, connected device, or desktop target):
flutter runIf you want to run on a specific device, list available devices and pass -d:
flutter devices
flutter run -d windows # example: run on Windows desktopNotes and troubleshooting
- If you see issues related to missing SDKs or tools, run
flutter doctorand follow the recommended fixes. - Building Android APKs or running on Android devices may require Android SDK tools. If you need Android targets later, install the Android SDK separately; Android Studio is not required for Flutter development but can simplify SDK installation.
- For fast iteration in VS Code, use the Debug panel (press F5) or the Flutter toolbar (Run and Debug).
flutter doctor
flutter --versionAndroid Studio is optional - you can use command-line tools instead.
- Install Android Studio
- Install Android SDK and accept licenses:
flutter doctor --android-licenses# Install Android SDK command-line tools
# Set environment variables
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-toolsAndroid Requirements:
- Android SDK (stable)
- Java (LTS version)
- See Android configuration in the project Gradle files.
Requirements:
- Xcode
- CocoaPods
- iOS deployment target is defined in the project configuration.
# Install CocoaPods
sudo gem install cocoapods
# Install iOS dependencies
cd ios && pod install && cd ..USB Device Access for PSLab Hardware:
# Install udev rules for PSLab devices
sudo cp linux/99-pslab.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
# Add user to dialout group for serial access
sudo usermod -a -G dialout $USER
# Log out and back in for group changes to take effectSupported PSLab Devices:
- PSLab v5: VendorID
04d8, ProductID00df - PSLab v6: VendorID
10c4, ProductIDea60
- Clone repository:
git clone https://github.com/fossasia/pslab-app.git
cd pslab-app- Install dependencies:
flutter pub get- Platform-specific setup:
# iOS (macOS only)
cd ios && pod install && cd ..
# Android - no additional steps neededThe app requires these permissions (configured in AndroidManifest.xml):
Android:
ACCESS_FINE_LOCATION/ACCESS_COARSE_LOCATION- GPS loggingRECORD_AUDIO- Audio oscilloscope functionalityINTERNET- Connectivity featuresREAD_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE- Data loggingandroid.hardware.usb.host- PSLab device communicationandroid.hardware.sensor.ambient_temperature- Temperature sensors
Hardware Communication:
- usb_serial
- flusbserial
Sensors & Hardware:
- sensors_plus
- light
- geolocator
- permission_handler
Audio Processing:
flutter_audio_capture(Git dependency) - Audio capture for oscilloscope
# List available devices
flutter devices
# Run on connected device
flutter run
# Run with hot reload
flutter run --debug# Android APK
flutter build apk --release
# Android App Bundle (for Play Store)
flutter build appbundle --release
# iOS (macOS only)
flutter build ios --release
# Linux
flutter build linux --release# Unit tests
flutter test
# Integration tests
flutter test integration_test/Common Issues:
-
USB permissions on Linux:
- Ensure udev rules are installed:
ls -la /etc/udev/rules.d/99-pslab.rules - Check user is in dialout group:
groups $USER
- Ensure udev rules are installed:
-
Flutter version mismatch:
flutter channel stable flutter upgrade flutter pub get
-
iOS build issues:
cd ios pod deintegrate pod install cd .. flutter clean flutter pub get
-
Android build issues:
- Ensure an LTS Java version is installed: java -version
- Clean build:
flutter clean && flutter pub get
-
Git dependency issues:
flutter pub deps flutter pub get
Follow the steps below to confirm that your local development environment is correctly configured.
flutter doctorResolve any critical issues reported by the command.
flutter pub get
flutter testflutter runRun the app on a connected physical device, emulator, or desktop target.
If you prefer Android Studio:
- Open the project directory in Android Studio.
- Wait for the Gradle sync to complete.
- Check the Build and Run windows for errors.
Note: If you encounter a Gradle sync error such as “failed to find …”, use the suggested action (for example, Install missing platform(s) and sync project) to allow Android Studio to download the required components.
Once the app builds successfully and launches on your target device or emulator, the setup is complete.
The currently supported Flutter, Dart, and platform versions are defined in the project configuration files (for example pubspec.yaml, Android Gradle files, and iOS project settings).
Permissions are declared in the platform manifests:
- Android: android/app/src/main/AndroidManifest.xml
- iOS: ios/Runner/Info.plist
The app may request permissions at runtime depending on the instrument/features being used (e.g., location, microphone, storage, USB).
To use PSLab device with Android, you simply need an OTG cable, an Android Device with USB Host feature enabled ( most modern phones have OTG support ) and PSLab Android App. Connect PSLab device to Android Phone via OTG cable. Rest is handled by App itself.
Please help us follow the best practice to make it easy for the reviewer as well as the contributor. We want to focus on the code quality more than on managing pull request ethics.
- Single commit per pull request.
- Reference the issue numbers in the commit message. Follow the pattern
Fixes #<issue number> <commit message> - Follow uniform design practices. The design language must be consistent throughout the app.
- The pull request will not get merged until and unless the commits are squashed. In case there are multiple commits on the PR, the commit author needs to squash them and not the maintainers cherrypicking and merging squashes.
- If the PR is related to any front end change, please attach relevant screenshots in the pull request description.
As a tip for new developers those who struggle with squashing commits into one, multiple commits may appear in your pull request mostly due to following reasons.
- Intentionally adding multiple commit messages after each change without just
git adding. - Updating the current branch with the remote so a merge commit takes place.
Despite any reason, follow the steps given below to squash all commits into one adhering to our best practices.
- Setup remote to upstream branch if not set before
$ git remote add upstream https://github.com/fossasia/pslab-app.git
- Check into the branch related to the pull request
$ git checkout <branch-name>
- Perform a soft reset to retain the changes while removing all the commit details
$ git reset --soft upstream/development
- Add files to the staging area
$ git add <file paths or "." to add everything>
- Create a new commit with a proper message following commit message guidelines
$ git commit -m "tag: commit message"
- If you have already made a pull request
$ git push -f origin <branch-name>
We have the following branches
- development All development goes on in this branch. If you're making a contribution, you are supposed to make a pull request to development. Make sure it passes a build check on Travis.
- master This contains the stable code. After significant features/bugfixes are accumulated on development, we move it to master.
- apk This branch contains automatically generated apk file for testing.
Please try to follow the mentioned guidelines while writing and submitting your code as it makes easier for the reviewer and other developers to understand.
- While naming the layout files, ensure that the convention followed is (activity/fragment) _ (name).xml like
activity_oscilloscope.xml,fragment_control_main.xml. - Name the views and widgets defined in the layout files as (viewtype/widget) _ (fragment/activity name) _ (no. in the file) like
spinner_channel_select_la1,button_activity_oscilloscope1. - The activity/fragment file name corresponding to the layout files should be named as (activity/fragment name)(activity/fragment).java like
ChannelsParameterFragment.javacorresponding to the layout filefragment_channels_parameter.xml. - The corresponding widgets for buttons, textboxes, checkboxes etc. in activity files should be named as (viewtype/widget)(fragment/activity name)(no. in the file) like
spinnerChannelSelect1corresponding tospinner_channel_select1.
The project is maintained by
- Padmal (@CloudyPadmal)
- Mario Behling (@mariobehling)
- Lorenz Gerber (@lorenzgerber)
- Wei Tat (@cweitat)
- Wai Gie (@woshikie)
- Neel Trivedi (@neel1998)
- Akarshan Gandotra (@akarshan96)
- Asitava Sarkar (@asitava1998)
- Vivek Singh Bhadauria (@viveksb007)
- Avjeet (@Avjeet)
- Abhinav (@abhinavraj23)
- Harsh (@harsh-2711)
- Yatri (@yatri1609)
This project is currently licensed under the Apache License 2.0. A copy of LICENSE is to be present along with the source code. To obtain the software under a different license, please contact FOSSASIA.






























