Inspired by Alex’s PIC based OBD-II reader I decided I needed another project. Since I had just bought a new car back in July I needed a reader that supports the new CAN protocols. I then had to go searching for an alternative device. I then found the ELM327 by ELM Electronics. ELM provided a schematic and board layout to support their chip. After ordering up a few of their chips it was on to making the pcb’s. After printing the pcb out on the laser printer and ironing it onto the copper, it was then etched with muriatic acid. The boards came out very nice, a few broken traces, but easily fixed with some solder. Then after about a hour at the drill press it was then time to start soldering up the components.
It took about 45 minutes to solder all the components up. For being my first pcb that I made from scratch, I was rather satisfied with the final result.
A few days ago I finally got the chip. I ended up having to go to UPS to pick it up, something about they couldn’t leave it at my doorstep, Mouser required a signature. I dropped the chip into my breadboard and within seconds it was communicating perfectly with my laptop. It took me a while to figure out how to read a byte though. The chip has pins for write and read enable that are normally controlled by some form of clock, however for my application all I want to know is when a bit goes high. Looking through the programming manual for the chip I discovered a function FT_GetBitMode, which returns the instantaneous value of the data bus. So I wrote a thread that continuously calls this function and if it gets a response of zero then it will call my gate trigger function. Right now I’m having some trouble getting everything to run smoothly, most likely due to some threading issues. However, it works well enough that I can now go about figuring out how to house everything so it can be used at the track. I need to come up with some small rechargeable 12 volt batteries to power the gates, and a long length of wire to link the receptor gate to my USB interface.
I’ve made a few more functional changes to the user interface as well. Hopefully within the next week or so I can get everything together and call this project complete.
The software is coming along rather well. I’m still waiting on the chip to come in, it should be waiting for me when I get home. I can then bust out the breadboard and finish things up. A friend also suggested that I make the software capable of doing lap times rather than times for single laps. So I think I will make the software function in 2 different modes. One of which, like it already is, stops the timer completely when the gate is tripped a second time. The new mode, would allow the timer to continue when the gate is tripped a second time and it will store the lap times for each lap, keep count of laps, and the overall time for all laps.
As a member of my university’s SAE Mini Baja team I decided we needed a better way to time our vehicle, the traditional stopwatch is a bit outdated. After attending an auto cross event this past weekend I thought why not build a timing gate system like they use to keep track of racer’s best times. I originally wanted to build a completely embedded system that does everything via a control box. I then decided that was too complicated and it didn’t leave a lot of room for improvements. I then decided that an interface that connected to a computer would be best, and have software handle the rest. So I started looking into what it would take to make such a device. I already had a set of infrared gates to make a timing gate out of. So all I had to figure out was how to connect those to a computer. Seeing as these gates would be used in remote areas the interface would need to work with a laptop, thus eliminating the use of Serial or Parallel ports. The solution would have to be USB. At work I’ve done a lot of work with FTDI products, so I looked into what they had to offer. Their FT245R chip seemed to fit my bill perfectly. It is a USB FIFO interface, which is essentially a Parallel port. With a parallel port you can essentialy have 8 I/O’s. The infrared reciever works like a binary switch so I essentialy just need one binary input for this interface. To make development easier I decided to use FTDI’s UM245R DIP module, so i don’t have to deal with surface mount chips and other components. I ordered this chip from Mouser earlier this week for $20.

I started programming the software interface in VB.NET 2005. So far the interface is pretty much complete. As of now it doesn’t interface with any hardware yet (although I have already programmed the functions to do so), I created some test buttons that emulate the trip of the infrared gate. The UM245R is supposed to show up on Monday, hopefully then I can get the breadboard out and finish up the software/hardware interface. Once I get the two talking to each other well the only thing left to do is tweak the software to my liking and start putting the timing box to use.