Tuesday, April 6, 2010

Going Live

Both the Arduino and the PC side software are now updated to process the speed and RPM signals coming from Live For Speed.

What's interesting, is that the Arduino (ATMega1280) being single-theaded, I had to write all the code in one function. So, there is only one thread which reads data from the serial port, and as soon as a complete package is received, it updates the control lights and speed / RPM signals.
The speedometer and rev counter are fed with clock signals, whose frequencies vary according to the speed / RPM to be displayed on the dial (the actual speed and RPM sensors on the real car read their values from the rotating wheels/engine crankshaft, thus sending clock-like signals to the instrument cluster). These signals are generated by means of two dedicated timers, also implemented in the same single thread.

Here's a video of the real thing working in LFS.

16 comments:

  1. This is awesome. Can't wait to see the finished project.

    ReplyDelete
  2. I am really interested in the sourcecode, would you mind posting it, too ?

    ReplyDelete
  3. Oh man I thought about this a while ago, after I obtained a spare Holden Commodore VP dash cluster... I'd love to look at how you did this!!

    ReplyDelete
  4. It just beautiful man,
    I admire what you did!

    ReplyDelete
  5. Yes, amazing idea.. really a good idea. when your done if you would post the source code. it would be much appreciated!! <3<3<3<3

    ReplyDelete
  6. I would love some more information on how you did this. I just so happen to have a spare 7 series instrument cluster that I would love to get working for something like this :)

    ReplyDelete
  7. nice work but you shouldn't redline the car until its warmed up at least... gauge cluster shows its 0!!!!

    ReplyDelete
  8. "the Arduino (ATMega1280) being single-theaded, I had to write all the code in one function"

    Can you rephrase this at all? At the moment it doesn't really make sense

    ReplyDelete
  9. Hi there, Alex!

    Great work, man!
    I´m currentlich working on an likewise project and was wodering if you could send me your code to get the data out of LfS to the Arduino (I´m using a Duemilanove).

    Kind regards, Tomasz

    my email: schmiest@fh-trier.de

    ReplyDelete
  10. Great Blog you got here Alex,

    Like many of the other commenters I would be grateful if you would post the source code.

    I am thinking about using the Arduino to control a stepper motor using this kit: http://www.electronickits.com/kit/complete/motor/ck1402.htm and to send tacho pulses via a simple levelshifter to the rpm gauge of a BMW 2002 instrument cluster from 1973.

    feel free to send the source to my email: xillur(at)hotmail.com

    Regards

    Kristian

    ReplyDelete
  11. I too would be interested in the code you used, specifically to drive the gauges. I just pulled some electronic gauges out of a junkyard today with a similar project in mind, and any help would be greatly appreciated.

    Awesome job on the project so far. Nothing cooler than combining computers and car parts :)

    ReplyDelete
  12. I´m making an project like you on my school project.

    Hall that I need is the program code that you use to program the ardoino ande the software to make that work whith the game please contact me .

    bruno.newtec@gmail.com

    ReplyDelete
    Replies
    1. LFS_External/OutGauge to get data from lfs and serialport1.write to send data to arduino (c# or vb.net)

      mrmaxx93@hotmail.com

      Delete
    2. also in arduino i use tone() to send rpm and speed signal to cluster

      Delete
  13. IF you could send us the code and the schematics it would be a good idea for me for practicing electronics and arduino programming as i´m learning

    ReplyDelete