Tuesday, April 14, 2009

Electronics Calculator Released



This is not the usual post. Instead of hardware or even firmware, this one is about some electronics related software I recently wrote for my Nokia N810 Internet Tablet.

The N810 is a small touchscreen computer that runs a version of debian linux called Maemo. The hardware itself is very capable, and since I bought mine it has never left my side.

I immediately started using it for many electronic related tasks. I stored my PDF library of datasheets on the device where it is easy to look up a component without leaving the workbench or dragging over a laptop. If I don't already have the datasheet, I fire up the browser and go look it up. No need to write down the part number and walk over to a computer - I just look it up right there.

I also use a fantastic application called Xournal to make quick notes and drawings with the stylus. It is wonderful for quick schematic sketches ( that can later be exported as PDF files ).

I also found myself reaching for the N810 when I needed to do a calculation, but found the available calculators to be clunky for that purpose. I soon started using the many available javascript electronics specific calculators, but that was just a little too slow, and I usually thought there was a better way to do them.

Thus I started to create the Electronics Calculator for Maemo. I wrote it in Python because it is a very nice language that runs well on the N810, and it is considerably easier to develop and test in Python than in a traditional compiled langauge like C or C++. Java does run on the N810 (beta), but it is too resource intensive for me. It does have some major memory limits. Of course, I also wanted to learn Python. Gotta say I like it, but I digress.

The Electronics Calculator installs on the device and runs blazing fast. It is always there for a quick calculation or to figure out which resistor value I have on my prototype board.

Currently the calculator has tabs to calculate:

  • Ohms Law calculations: Enter any two of Voltage, Current, Resistance, or Power, and calculate the other two.
  • Capacitive Reactance calculations: Enter any two of Capacitance, Frequency, or Reactance, and calulate the other
  • Resistor Codes: Select the color bands, Enter the three or four digit SMT resistor code, or the resistance value, and calculate all the rest.
  • Capacitor Codes: Enter a capacitance value or 3 digit SMT code and calculate the other.

For details, see: http://electronicscalc.garage.maemo.org/

Oh yeah - its written in Python with the pygtk toolkit, so it will actually run on any platform that has Python, Pygtk, and the GTK+ toolkit. I actually build and test it in Windows. Its not easy to get all the pieces for the environment together, so I am going to see if i can use the py2exe tool to create a windows distribution for all you poor suckers that have not bought one of these excellent devices to run it on.

If you are using Linux, just go to the source repository and grab the current ohms.py file. You probably already have Python and GTK+ installed, so you can just make that one file exceutable and run it.