Control of Tenma DC Power supplies via serial
Switch branches/tags
Nothing to show
Clone or download
kxtells Merge pull request #5 from russkel/py3
added python3 support to library.

Since all the changes are related to prints and calls to encode I don't think the gstk script will have any kind of problem there.

Thanks :-D
Latest commit 519aa7f Oct 1, 2018

Tenma DC power supply controllers

Provides two basic controllers (tested on Linux) for a TENMA DC power supply via serial interface.

  • tenmaControl (command line utility)
  • gtkIndicator (GTK indicator to sit on tray)


What is this?

A small command line program / library to setup a Tenma 72-2540 DC POWER SUPPLY from your computer via SERIAL.

Coming back from holidays was hard. So I spent some time with a little game (tongue). You'll find a small explanation of the code in:


Python and the serial library:

pip install pyserial


  • Cannot read current consumption. (Function implemented, does not seem to work)
  • Always saves to memory 1. (Function implemented, POWER SUPPLY not behaving as expected. Restores all memories correctly though.
  • The physical buttons are blocked for a while after connecting.

Usage examples

Print the Tenma version

python /dev/ttyUSB0

Set the current and the voltage

For example: 2.2 Amperes 5V:

python -c 2200 -v 5000 /dev/ttyUSB0

Turn on the channel output

python --on /dev/ttyUSB0

Turn OFF the channel output

python --off /dev/ttyUSB0

Load an existing memory

python -r 1
python --recall 2

Create a new value for a memory 4

python -c 2200 -v 5000 --save 4 /dev/ttyUSB0

Print everything

python -c 2200 -v 5000 --save 4 --verbose --debug /dev/ttyUSB0


A very simple GTK indicator to control a tenma DC power supply from a graphical desktop. Provides ON, OFF and RESET facilities. Simply start it with: