Share it

Follow me

Twitter

Google+

LinkedIn

RasPiLEDMeter

RasPiLEDMeter is a project for the Raspberry Pi intended to provide a LED usage meter to the platform.

Current version : 1.1.1, August 14, 2012.

Software side

Software side of RasPiLEDMeter allows the Raspberry Pi to drive a LED usage meter. It contains a main application running in background and regularly launching script which get data needed to light on or light off LED. Of course, it's still possible to create your own scripts to fit your needs (more details available into “doc/README” file). Available sample scripts are:

  • dummy.sh: this script just light on 4 LED over 8. It's here to explain expected output format and know how the number of LED to light on is calculated.
  • filecount.sh : this script check for the number of files which name begins with “ledtest” into folder “/tmp”, then light up the correct number of LED.
  • cpu.sh : this script light up LEDS depending on CPU usage.

Requirements installation

You first have to install Python and the associated developer tools. With Debian / Raspbian, you have to execute as super-user the following command (you have to adapt it to the distribution you use):

$ apt-get install python python-dev

When the installation is done, you have to install a Python library in order to control the GPIO. It's RPi.GPIO (version 0.4.0a or newer), available here : http://pypi.python.org/pypi/RPi.GPIO. When you have downloaded the archive, you have to execute as super-user the following commands:

$ tar -xzf RPi.GPIO-0.4.0a.tar.gz
$ cd RPi.GPIO-0.4.0a
$ python setup.py install

When library installation is done, you may delete previously downloaded archive (“RPi.GPIO-0.4.0a.tar.gz”) and untared folder (“RPi.GPIO-0.4.0a”).

Electronic assembly

Needed components

  • 5 x green LED
  • 2 x yellow LED
  • 1 x red LED
  • 8 x 330Ω resistors
  • Enough wires to connect them all (…and in the darkness bind them)

330Ω resistors are used to protect LED (and GPIO). You may use 270Ω resistors if you want them to be brighter. Don't use to low value resistor, as you must not draw to much current from GPIO pins : no more than 16mA per pin, and no more than 51mA cumulated on all pins.

I used the Raspberry Pi Started Kit available at SK Pang, which provide a case for the Raspberry Pi and all needed components (I just had to buy another green LED).

Circuit diagram
Circuit diagram

More details

LED number Color Pin number on the GPIO header
1 green 7
2 green 11
3 green 12
4 green 13
5 green 15
6 yellow 16
7 yellow 18
8 red 22

Final assembly
raspiledmeter_assembly.jpg

See it in action

Download RasPiLEDMeter software

RasPiLEDMeter is distributed under the terms of the modified BSD license.

Download stable version Download on GitHub

  • Stable : last stable version of the application
  • GitHub : last source code of the application on GitHub (may be unstable, and sometimes break down completely)

v1.1.1 (August 14, 2012)

  • Compatible with Python 3.x.

v1.1 (August 13, 2012)

  • Rewritten using Python.

v1.0 (August 04, 2012)

  • First public version.


comments powered by Disqus