GithubHelp home page GithubHelp logo

mrwunderbar666 / rpi-vumonitor-python Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 29.74 MB

Using Audio VU Meters to monitor system activity on the Raspberry Pi

License: MIT License

Python 100.00%
python raspberry-pi vu-meter mcp4922 mcp4725 system-monitoring

rpi-vumonitor-python's Introduction

Description

Using Audio VU Meters to visualize CPU and Network usage of your Raspberry Pi.

A collection of python scripts that enable different methods of driving analog VU Meters from your Raspberry Pi GPIOs

Requirements

  • RPI.GPIO
  • psutil
  • Wiring Pi
  • MCP4922 Driver
  • MCP4725 Driver

4 Different Methods

Pulse Width Modulation and standard RPi.GPIO Library

Software PWM

In this version we use software PWM to pulse the VU Meters. I noticed that this method creates a lot of jitter and is quite inaccurate. Also the resolution is quite low, as my VU Meters already are at maximum level with a PWM Duty Cycle of 10 @ 200 Hz.

But this is also the most simple and straightforward method.

Requires:

  • RPi.GPIO
  • psutil (monitoring system)

Pulse Width Modulation and WiringPi GPIO Library

Hardware PWM

In this version we use hardware PWM to pulse the VU Meters. The wiringpi library supports hardware PWM, unlike the RPi.GPIO library.

This method has only little jitter and is more accurate compared to the software PWM version. Resolution is also better compared to the software PWM. I can get around 200 steps of duty cycle until the VU Meter is at its peak.

Requires:

  • Wiring Pi
  • psutil (monitoring system)

Dual Channel Digital to Analog Converter with custom Library

Using MCP4922 DAC

In this version we use an MCP4922 DAC to apply a constant voltage to two VU Meters. The MCP4922 is a Digital to Analog Converter with 2 Channels and 12 bit resolution.

It supports SPI, which is a bit painful to use at the beginning.

This method is very clean, has no jitter and highly accurate. The resolution is effectively at around 600 steps, because the DAC can adjust the voltage in 1mV steps.

I opted for this as my permanent solution

Requires:

Single Channel Digital to Analog Converter with Adafruit Library

Using MCP4725 DAC

In this version we use an MCP4725 DAC to apply a constant voltage to one VU Meter. The MCP4725 is a Digital to Analog Converter with 1 Channel and 12 bit resolution. It supports I2C, which is nice and easy to use.

Adafruit offers a breakout version and supplies some libraries for it.

This method is very clean, has no jitter and highly accurate. The resolution is effectively at around 600 steps, because the DAC can adjust the voltage in 1mV steps.

But has only one channel. So it is not a good solution if you want to drive several VU Meters at once. Requires:

rpi-vumonitor-python's People

Contributors

mrwunderbar666 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.