All Projects → ankitaggarwal011 → Piscope

ankitaggarwal011 / Piscope

Licence: mit
Turn your Raspberry Pi into an Oscilloscope/XY Plotter with Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Piscope

Q3lite
Q3lite, an OpenGL ES port of Quake III Arena for embedded Linux systems.
Stars: ✭ 64 (-58.71%)
Mutual labels:  raspberry-pi, embedded-systems
Mraa
Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
Stars: ✭ 1,220 (+687.1%)
Mutual labels:  raspberry-pi, i2c
Raspberry Pi Diy Projects
Collection of Do-It-Yourself Projects on Raspberry Pi 2 / 3 & Zero W with diverse HATs and pHATs.
Stars: ✭ 70 (-54.84%)
Mutual labels:  raspberry-pi, diy
Tinderboxpedal
Bluetooth "Universal Remote" Footpedal for Digital Guitar Amps, on ESP32 or Pi Zero W
Stars: ✭ 48 (-69.03%)
Mutual labels:  raspberry-pi, diy
Reflowduino
Arduino-compatible wireless reflow oven controller ecosystem of open-source hardware
Stars: ✭ 154 (-0.65%)
Mutual labels:  electronics, diy
Morpheus Stm32
A small 3D printer controller board for use with a "blue pill" STM32F1 generic board. Inspired on http://reprap.org/wiki/SinapTec
Stars: ✭ 49 (-68.39%)
Mutual labels:  electronics, diy
Security Camera
🔦 Motion detecting security camera using a raspberry pi, webcam, and slack
Stars: ✭ 76 (-50.97%)
Mutual labels:  raspberry-pi, diy
Luma.oled
Python module to drive a SSD1306 / SSD1309 / SSD1322 / SSD1325 / SSD1327 / SSD1331 / SSD1351 / SH1106 OLED
Stars: ✭ 560 (+261.29%)
Mutual labels:  raspberry-pi, i2c
Rpi Examples
Raspberry Pi examples
Stars: ✭ 107 (-30.97%)
Mutual labels:  raspberry-pi, i2c
List of robot electronics
A curated list of awesome open source electronic resources for robotics
Stars: ✭ 106 (-31.61%)
Mutual labels:  embedded-systems, electronics
Lsquaredc
A library for I2C communications for Linux devices (Beaglebone Black, Raspberry PI, and possibly others).
Stars: ✭ 42 (-72.9%)
Mutual labels:  raspberry-pi, i2c
Ha4iot
Open Source Home Automation system for .NET
Stars: ✭ 146 (-5.81%)
Mutual labels:  raspberry-pi, i2c
Androidthings Drivers
Android Things open source peripheral drivers
Stars: ✭ 30 (-80.65%)
Mutual labels:  raspberry-pi, i2c
Magicmirror
let's make a magicMirror
Stars: ✭ 57 (-63.23%)
Mutual labels:  raspberry-pi, diy
Fprime
F' - A flight software and embedded systems framework
Stars: ✭ 8,642 (+5475.48%)
Mutual labels:  raspberry-pi, embedded-systems
Swiftygpio
A Swift library for hardware projects on Linux/ARM boards with support for GPIOs/SPI/I2C/PWM/UART/1Wire.
Stars: ✭ 1,188 (+666.45%)
Mutual labels:  raspberry-pi, i2c
Rppal
A Rust library that provides access to the Raspberry Pi's GPIO, I2C, PWM, SPI and UART peripherals.
Stars: ✭ 463 (+198.71%)
Mutual labels:  raspberry-pi, i2c
Mycroft Precise
A lightweight, simple-to-use, RNN wake word listener
Stars: ✭ 481 (+210.32%)
Mutual labels:  raspberry-pi, embedded-systems
Gopi
Raspberry Pi Go Language Interface
Stars: ✭ 82 (-47.1%)
Mutual labels:  raspberry-pi, i2c
Periph
Go·Hardware·Lean
Stars: ✭ 1,700 (+996.77%)
Mutual labels:  raspberry-pi, i2c

PiScope: Turn your Raspberry Pi into an Oscilloscope/XY Plotter

An oscilloscope is a laboratory instrument commonly used to display and analyze the waveform of electronic signals. In effect, the device draws a graph of the instantaneous signal voltage as a function of time.

A XY Plotter is an instrument to plot a voltage variable with respect to another voltage variable. This is in contrast to the oscilloscope which plots a voltage variable with respect to time.

This python library can turn your Raspberry Pi into an Oscilloscope or XY plotter. Simply, interface an Analog to Digital Converter with your Raspberry Pi and use the library to view the analog signals on your Raspberry Pi. Currently, the library supports Adafruit ADS1015 breakout board.

Raspberry Pi with ADS1015

Motivation

Oscilloscope are costly, bulky. I wanted to monitor analog sensors on Raspberry Pi and I didn't had an actual oscilloscope. Not exactly precise, but it could be very helpful for most applications.

Dependencies

Hardware

  1. Raspberry Pi B/B+/2

  2. ADS1015 Breakout board Analog to Digital converter

Software

  1. Python 2.7

The following python modules are needed in order to use this library:

pylab
matplotlib
Tkinter

In order to install these dependencies on Raspberry Pi, one can use the following command:

sudo apt-get install python-numpy python-scipy python-matplotlib python-tk

Interfacing ADS1015 with Raspberry Pi

  1. Connect Adafruit ADS1015 to Raspberry Pi

GND to GND, 5V to 5V, SDA to SDA, SCL to SCL, ADDR to GND (I2C address 0x48)

  1. Check the devices connected to the I2C bus using the command below

The Adafruit ADS1015 should be shown at:

$ sudo i2cdetect -y 1

If you need help in interfacing, check out the official documentation from Adafruit:

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/

https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code

Usage

To turn your Raspberry Pi into an Oscilloscope using this library, just clone the repository and use the following code:

from PiScope import Plotter

piscope = Plotter()

piscope.setup([0]) # Here, the channel used on ADS1015 is channel 0.

piscope.plot()

OR

Use example_oscilloscope.py available with the repository.

$ python example_oscilloscope.py

To turn your Raspberry Pi into an XY Plotter using this library, just clone the repository and use the following code:

from PiScope import Plotter

piscope = Plotter()

piscope.setup([0, 1]) # Here, the channels used on ADS1015 are channel 0 (X) and channel 1 (Y).

piscope.plot()

OR

Use example_xyplotter.py available with the repository.

$ python example_xyplotter.py

Dry Test

In case you don't own a Raspberry Pi or ADS1015 yet, but want to see the library in action, I have included a dry test example, which doesn't require any hardware. You can simply run it on any Linux/Windows platform.

Use example_drytest.py available with the repository.

$ python example_drytest.py

Example results

Oscilloscope

XY Plotter

API

from PiScope import Plotter

Import the module in your main file.

piscope = Plotter()

Create oscilloscope/XY Plotter

piscope.setup(channels)

Setup the channels of ADS1015 being used for oscilloscope/XY Plotter.

channels is the channels of ADS1015 which are to be used, Type: List/Array of 1 or 2 Integers.

e.g. In case of an oscilloscope, channels is a list with one element representing the active ADS1015 channel (channels = [channel_number]).

e.g. In case of an oscilloscope, channels is a list with two elements representing the active ADS1015 channels (channels = [channel_number_X, channel_number_Y]).

piscope.plot()

Plot the analog values on the oscilloscope/XY Plotter.

Contributors

Author: Ankit Aggarwal

If anybody is interested in working on developing this library, fork and feel free to get in touch with me.

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].