Saturday, January 9, 2010

Launch of Development of the PakTrakr application

Sorry for the long wait between posts.  I spent a week at the insanity called Disneyland, then had a very relaxing week between Christmas and going back to work on January 4.  I didn't do any physical work on the car in that time, but I did spent a lot of time on the development of of a program that reads the data out of the PakTrakr battery monitoring system that I'll be buying later on in the process.  The PakTrakr has a small dashboard display, but it also outputs a data stream each second on a serial port.  My idea is to read that raw data and build an application that would show the data in an improved manner, and also derive important user information like distance to "empty".

See this blog post for the details on my choice of device.

I first had to download and install the free software development kit.  Then I started playing with sample code, and slowly build up the features of my application.  After a couple of weeks of learning, searching and experimentation, I've got a lot of stuff done.  I ported the PakTrakr parsing code from Doug Teeple.  I then built the application skeleton based on a series of tabs.  The first tab will exploit the GPS and mapping functionality to track the progress of each trip:


The next tab will show the readings of the battery pack as a whole, in analog gauge format.  I couldn't find any gauge controls in the Android toolkit or on the web, so I wrote my own.  There's a Percentage of Charge gauge, pack temperature, pack voltage and another custom gauge I wrote that shows the flow of current into the pack during charging, or out of the pack during driving:


The next tab will show the details on each battery in the system, with voltage readings and any errors:
The next tab will show a list of current and past problems with the batteries.  I'm still working on that so there's nothing to show.


The last tab will show the settings controls.  Right now, most are used only during development of the code, but others will be used in the course of running the app during driving and charging.


More updates on the code as things progress.

13 comments:

  1. Hey Mike,
    This town is certainly big enough for two electric 914's (and hopefully even more). Good luck. Drop me a line if you need some advice. Love the software add-ons. That's brilliant. I look forward to a tandem ride in our electric Porsches through the mean streets of San Luis Obispo!

    ReplyDelete
  2. I look forward to that Steve! I have to do some range testing before I head down from Paso to SLO. I'll have to fully charge up at work to be able to make it back up the Cuesta Grade!

    ReplyDelete
  3. WOAH! This is just what I was looking for! I was going to go with the EV dashboard on a windows ce gps device (already bought it in fact) but using my android phone (EVO 4g) would be SO MUCH MORE CONVENIENT!!! I would love to test this out as you develop it, if you need bug hunters. I'm currently still building my EV from a 1986 Mazda RX7, working on metalwork/fabrication right now. Please keep posting on the development of this app, it's looking amazing!

    Will the individual battery breakdown be separated by remote? Please feel free to email me, I would love to talk more about this project!

    jason@frankencar.org

    ReplyDelete
  4. Jason,

    I have EVO envy, but I think my trusty little Droid will have to carry me for a while...

    I was going to separate the batteries by physical location as in the screen shot above, but if you think showing by remote would be good, I'll think about it.

    Currently the battery layout is hardcoded to the 914 and it will take some generalization of the user interface, source code and settings to make it customizable for any car. In the short term I think it would be easier to make a custom version for your layout.

    Email me a description of the physical battery layout and Paktrakr remote battery layout when you get a chance.

    ReplyDelete
  5. This Is Great! The Perfect app for my Android Device and EV. I was thinking of using the EV dashboard on a windows ce gps device,but I'd prefer to have this instead. If you need any BETA testers I would be more than happy to test this out in EV.

    p.s. Keep up the great work and please let me know when it will be available for download/testing.

    Victor Andrade
    vandrade89@gmail.com

    ReplyDelete
  6. This Is Great! The Perfect app for my Android Device and EV. I was thinking of using the EV dashboard on a windows ce gps device,but I'd prefer to have this instead. If you need any BETA testers I would be more than happy to test this out in EV.

    p.s. Keep up the great work and please let me know when it will be available for download/testing.

    Victor Andrade
    vandrade89@gmail.com

    ReplyDelete
  7. Victor, glad to see another Droid user with an electric car. My car is likely 1 month away from rolling under its own electric power, so I'll be able to make the last real-world fixes, then I'll contact you and Jason about testing in your cars.

    ReplyDelete
  8. Our High school program has an small electric car with pak-trakr setup that would benefit greatly from this! is the source openly available?

    ReplyDelete
  9. Zane, as we discussed over email, I'm happy to contribute my code to your project. I sent you a zip file of the Eclipse project. Let me know what you think and if you make any improvements I'd appreciate the updates back to make the code better.

    ReplyDelete
  10. Hi Mike,

    Excellent work! I'm converting a -73 Fiat 500 R myself and since I own a paktrakr 600 I would love to test your app. Is it possible to get a copy of the app? I use a HTC DESIRE HD with Android 2.3.5.

    Please se my blog at luigi500.blogspot.com

    Best regards

    rikard.westlund@gmail.com

    ReplyDelete
  11. Rikard, I tried to use the app in my first real drive of the car yesterday and found a bug with the data flow handling. I will try to get it fixed soon and publish the app in the Android Market for folks to download for testing.

    ReplyDelete
  12. hi.
    im working with an oem that is developing an all electric pickup. we are currently thinking about installing 1-2 car pcs, running android os. we want to have digital gauges in front of the driver.
    my question(s) are:
    how to read the data from the controller/batteries, route the data into the pc, and display the data in the form of gauges? ive downloaded the android sdk. (note: ive been programming computers since 1979, so im adept at reading/writing code).
    thanks in advance for any help you can provide.
    johan@hilltopauto dot biz

    ReplyDelete
  13. Johan, there are three issues here: hardware, communication path, and software.

    Hardware: How is the data output by your controller and battery pack? They hopefully put out via an RS-232 serial port or CanBUS.

    Communication Path: An Android phone can read data easiest over Bluetooth. You will need to find an adapter from the controller and battery pack output to Bluetooth, as I've done above. An Android-based PC likely has RS-232 serial ports or USB and you'll need the correct cables or adapters.

    Software: Once you're getting data into the device, you'll need to parse it based on the protocol defined by the device. You'll need the protocol definition to properly read and interpret the data stream. If you don't have the documentation you'll have to reverse-engineer it. You can then use this data to drive the gauges.

    I hope this helps. Feel free to email me directly if you need more help.

    ReplyDelete