Posts: 4
Joined: Wed Feb 26, 2014 8:13 am

RPI as race car dash/datalogger, need help with inputs

Wed Feb 26, 2014 10:16 am

My plan is to use a Raspberry Pi as the dash and datalogger on a 4-cylinder race car. The car is pre-OBDII, but I've got a fairly intimate knowledge of the car's electrical systems, I'm just trying to figure out how to interface them with the Pi. Please keep in mind that when I say 12v, what I really mean is ~12v DC, which in a car can spike between 8v and 20v DC, especially when starting and directly after.

The first "big" issue is dropping the input voltage. I can access the "tach" (really the cam position sensor) signal as a 12v* square wave coming from the ignition control module and going to the ECU, and the speed is (I believe) a square wave from the OE dash panel. To drop that to 3v3, I was going to use a resistor ladder designed to drop 12v to 3v3, and a zener diode for protection when the car's voltage spikes. My brother says to forget about the ladder and just use the zener. My idea has the advantage of also reducing any residual voltage, ie if "0v" is really 1-2v, it would get dropped to almost nothing, and it doesn't rely entirely on the zener. His idea has the advantage that it doesn't affect a low "high" voltage, ie when the 12v* is really 9-10v. Which one should I go with, or should I use a mix of the 2, ie a ladder designed to drop 9v to 3v3 and 12v to ~5v with the zener? Or is there a completely different method I should use?

The next problem is measuring resistance, for engine temp and oil pressure sensors. These are 1-wire sensors, and they ground through the engine block. Normally, I would say to hook up an A/D converter and measure the voltage drop, but this doesn't seem possible with the common ground. Am I just over-thinking this, or is there a special method needed to do this?

I would also like to record lap times using GPS. The track is fairly small, it's a 1/3rd mile oval. Are there any relatively inexpensive GPS units available that would be accurate to within a foot or so at around 70mph?

Finally, am I asking too much of the Pi's processor and memory? I'm planning on a PyGtk interface piped to a 7" touchscreen LCD, and in the background running a simple datalogging program (recording speed, throttle position, A/F ratio, etc, and possibly GPS info), and recording video and audio (using the Pi camera and adafruit mic).

Posts: 12
Joined: Thu Jun 28, 2012 3:57 am

Re: RPI as race car dash/datalogger, need help with inputs

Thu Feb 27, 2014 10:32 pm

For pulse inputs (i.e. cam sensor) I'd use a TVS diode and resistor at a minimum. An optoisolator is another option.
For the resistive sensors you want to read, if you fed say 5v to the sensor through a resistor of suitable value, you've got a resistor divider at the point between the sensor and resistor.

Most cheap GPS modules will give enough accuracy to determine your lap times (and give lots of other useful information) but they need a good view of the sky. Mount an external antenna on your roof if you can.
As for processing power, I've got an early rpi doing ~10Hz datalogging of engine sensors/parameters, GPS, 3 axis accelerometer, suspension travel and lap timing, a 20x4 alpha LCD dash and two way telemetry via wifi. It seems to handle that ok, but when I added recording with a camera module it wasn't coping very well at all.

Posts: 5158
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: RPI as race car dash/datalogger, need help with inputs

Thu Feb 27, 2014 10:41 pm

You are likely to blow the zenner if you connect it without a resistor. Over the zenner voltage the diode conducts much as if it was forward biased. The effective resistance of the junction will not limit the current to manageable levels. Use a series resistor.

An opto-isolator is a better choice where big transients are possible.

Posts: 4
Joined: Wed Feb 26, 2014 8:13 am

Re: RPI as race car dash/datalogger, need help with inputs

Fri Feb 28, 2014 11:45 pm

optoisolatos, that should have been obvious, I have some here. Thanks!

festy, is that a 256mb or 512mb pi?

Oh, and I figured out how to measure the resistance across the sensors, working in a small engine shop has made me rusty on my electronics formulas.

Posts: 4
Joined: Tue May 06, 2014 4:44 pm

Re: RPI as race car dash/datalogger, need help with inputs

Tue May 06, 2014 4:48 pm

I'm very interested in this sort of project as well. My sons race go karts and it would be a fun project to work on together.

@JustCoz37 & @festy, are either of you blogging about these systems? I'd love to see what you have

Posts: 4
Joined: Tue May 06, 2014 8:03 am

Re: RPI as race car dash/datalogger, need help with inputs

Tue May 06, 2014 8:36 pm

About the initial 8-20v spike,
maybe use a "low drop regulator" this is a chip which will drop an electrical signal from a certain range to a fixed output voltage, eg it turns your voltage range of 8-20v to a stable 5v. But you would have to find the right chip to meet your specs though. After a quick look i found: http://www.ti.com/product/tps7a4501
This is a list of components that can transform your voltage range. The minimum and maximum voltage is described by Vin(min/max) in the table.

Posts: 1
Joined: Sun Jun 08, 2014 8:47 pm

Re: RPI as race car dash/datalogger, need help with inputs

Sun Jun 08, 2014 8:50 pm

Has anyone had any success with this? I am looking for an inexpensive data logger that can have features like a vbox, camera inputs, gps, lap times, g force. I have no experience in programming a pi, but would be willing to pay someone to build one that meets my requirements.

Return to “Advanced users”