473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Noobie Starting New Project

I've have an idea for a personal project. I want to access my car's
OBD-II port via serial to query engine paramters and represent them on
my PC monitor. The various methods to represent them would be any of
the following: analog gauge (speedometer), digital readout, and X Y
Plots/Charts (HP vs RPM, timing advance vs time, etc) - all on the same
screen. Its probably been done before, but I have a Subaru, which
allows me to use Subaru Select Monitor Protocol, which is faster (and
easier to implement) than OBD-II. I also have a small 7" Widescreen VGA
LCD in my dash, so I need to make sure everything is visable on a small
screen and "unsqueeze" the image.

I hope to keep developing the project to do a "virtual dyno", taking
physical estimates of the car to calculate HP, torque as well as
logging data to a text file, and other ideas like possibly
incorporating GPS thru another serial port and maybe even some
accelerometers (for Tilt and g's)

I did find software that kinda does some of what I want, but its a case
of "if you want it done right..."

I've started using python 2 weeks ago to generate a "command line" file
parsing program to allow me to take memory data from my excel file
(saved as text) and generate FORTH commands for my ISOPOD (embedded
DSP).

I realy like the python language and all the modules that are
available, but before I start, I just wanted to get some advice on
which modules I should be using for the GUI and making charts, or if
anyone has any examples that might help me along.

Sep 22 '05 #1
2 2015
Having looked in these sorts of areas before and having a general
interest in it, I'd like to make some suggestions.

I wouldn't go an implement OBD-II yourself in Python, especially not in
a serial port. There are in fact (at least) 4 different OBD-II
protocols that I won't rattle off the names of here because I can't
remember them. You have to do strange things like setting the serial
port to 5 baud, send a start byte, then set it to 10400 baud and wait
an indeterminate amount of time for a reply etc. More info here
(http://www.andywhittaker.com/ecu/obdii_software.htm). People have
done it like this with varying degrees of success on specific car
models (VAG-COM for VW and Audi cars for example) but never a generic
solution.

There is an implementation (http://freediag.sourceforge.net/) which
works with various interfaces and protocols but it's not been touched
since 2003. I could never get this working in my car as it doesn't
support the OBD-II/CAN protocol. You could wrap this if you think it
will work for you (UNIX only, no Win32 not even under cygwin).

There are devices which plug into OBD-II and have a dongle on the end
which does the OBD-II protocol detection and decoding for you and just
gives you a serial stream out. These are much more reliable (and much
more like what the "real" car industry uses). There are many but
here's one supplier
(http://www.gendan.co.uk/viewcategory.php?category=117). Googling for
scantool will find the rest. Using python to either implement the
proper serial protocol used by these or wrap their existing libraries
(if they come with one) would, I think, be a much quicker and
potentially more successful approach.

As for other sensors, I found a great USB accelerometer
(www.phidgets.com) which I've used in python. They supply a library
with a COM interface so I used the pythonwin COM module to access it.
They also have a more traditional C library (with source) if you want
to wrap it with python, you'd need to do this if you want to use their
Linux or Mac OSX libraries. Phidgets make a whole set of cheap sensors
including temps, pressures etc. all accessible through USB.

GPS is easy and there are numerous ways to implement NMEA or Garmin
simple text protocols. Or you could use GPSD
(http://gpsd.berlios.de/).

I've been about to start a similar project, just using an accelerometer
with temporal speed corrections using GPS for a little while now. I've
got the maths sorted and the framework I just haven't decided on some
of the finer details I was going to do it in C++ but python seemed a
much better choice. The only thing that concerns me is a lack of a
good timer but I must admit I've not looked into it too hard.

I hope this gets you started.

Cheers,

Robin

Sep 22 '05 #2
Well, I'm not too worried about the serial communications aspect, I've
developed perhaps a dozen different RS-232, 422, 485, and even SPI,
CANBUS interfaces in the past year for embedded systems. And also, the
Subaru protocol is easier than OBDII, no need to change the baud to 5,
its fixed at 4800 8 N 1 and you can make it faster with a simple
command.

Although I did not make it clear, my real questions were with Python's
graphics. There are so many GUI options and I wasn't sure which one
would be the best. I'm thinking that pyCard would be the easiest for me
to pickup, from what I heard on the Python411 podcasts. But based on my
hardware, could I expect screen refresh rates that can match the update
rate of the serial port? I'm thinking 10-20 updates per sec would be
the max I could get out of the serial port, depending on the max baud
rate (currently undocumented/unknown but at least 38.4k) I could set it
to.

And for plotting, there are pleanty of plotting/charing options out
there. I wanted to get some input on what I could use. I'm looking at
matplotlip and gnuplot, but there are so many others.

Sep 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Don Freeman | last post by:
Seems like whatever value I use for the first int field (starting position) the substring procedure negates it and triggers a String index out of range error. I've tried all sorts of work...
2
by: osgnamah | last post by:
Hi All; I am getting ready to launch a shareware program in the next few weeks and the last step is going to be creating a website. So the last few days I've been doing some web surfing in...
6
by: Aristotelis E. Charalampakis | last post by:
Hi all, this is a newbie question :-) I was wondering if there was a way to use the switch statement in a manner that each case statement includes more that a simple value. i.e.: switch (...
12
by: Capt_Ron | last post by:
Sorry to have to ask this but... I have a form that asks for SQL connection information. I want to close the form when I click Save and then open the login form. I can Hide the form but it...
1
by: Bit Byte | last post by:
I have several years programming experience (C/C++) and have only recently started looking at developing web apps - after playing with PHP for a while, I decided there weren't enough tools etc to...
1
by: sajaisosa | last post by:
Hey there I've been following through the book "Beginning Python from Novice to Professional", and I have learned a great deal. At the moment, I am trying to expand upon the chatroom project near...
2
by: askalottaqs | last post by:
well well where do i start?? :D ok im working on the Maya SDK, using VC++ EE, and i got a bunch of questions if any may know.. (i hope im posting in the right place :S) 1- what does the ...
0
by: 7Percent | last post by:
Hi, I am just starting using python I was wondering if someone can help me with URL extraction and store it as a variable. Like theres a "<a href="www.google.com"><img src="google.gif"></a> How...
1
by: lg | last post by:
Hello, I'm pretty new to usenet and totally new to python, so.. hopefully i won't offend anyone with my naivete. I work at a non-profit organization where we use mailman for our email lists,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.