The Central Hub for DSM Community and Information

For 1990-1999 Mitsubishi Eclipse, Eagle Talon, Plymouth Laser, and Galant VR-4 Owners. This is where the DSM platform history is documented and archived. Log in to help us in our mission, and to remove most ads from the browsing experience.

1g data log to SD card w/micro controller

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

eclipsh

20+ Year Contributor
1,608
65
Jun 16, 2005
Durango, Colorado
I've been throwing around an idea for a while now to build a data logger for the 1g that automatically saves files to an SD or microSD card when I drive. I've been told systems like this exist for OBD2 cars.

I'm thinking an Arduino micro controller would work great for this but I'm not sure if it can write to the card fast enough. Has anyone given this a try? If not I think I'll make it a summer project.
 
I think the arduino can do it fast enough. Its just setting it up to log only what you want as to get thefastest updates from the ecu
 
I'm thinking writing to the SD card will be the biggest delay. I need to look into how the serial communications operates for the 1g ecu; speeds, command protocol etc. I think a few switches to select logging options would be good. I think it is probably a given that RPM, TPS, and timing will be recorded all the time. I'd likely always record AFR and knock too. Adafruit sells a nice microSD breakout I'm planning to use for a school project. I'll see how it works out for that and ask them what the write times are.
 
You wouldn't need to actively write to the SD card. You could save data in a memory buffer and only write the data when you choose to and that would get around any latency issues w/ the write to the card. I'm actually working on something very similar on dsmecu.com.
 
You wouldn't need to actively write to the SD card. You could save data in a memory buffer and only write the data when you choose to and that would get around any latency issues w/ the write to the card. I'm actually working on something very similar on dsmecu.com.

So perhaps just set the buffer up and have a button you can push to log all the recent data when you notice a hiccup in your tune? Sounds reasonable. That'd probably be better than writing lots of logs to the card and hunting around later. I guess it all really depends on how long it takes to write everything. I know it is less than a second but I'm not sure how much less.

This is the micro SD breakout I was talking about earlier:

MicroSD card breakout board+ ID: 254 - $15.00 : Adafruit Industries, Unique & fun DIY electronics and kits

I'll post something up asking about write speeds in their forums and see what I get back.


EDIT: looks like write speed probably won't be an issue:

http://forums.adafruit.com/viewtopic.php?f=31&t=21728&p=113915
 
Eclipsh - exactly, that would actually save the sd card's life also. You could also just connect to a usb port on the thing and download the recent data and skip the sd card all together.
 
So I'm picking this project up now that the semester is over and I have a little breathing room. I found the protocol on the MMCD website.

http://mmcdlogger.sourceforge.net/

Serial communication is done using 1953 baud, 8 bit, 1 stop bit, no parity, TTL(?) levels.

A listing of the addresses, functions and units are also on the site. I'm terribly ignorant when it comes to writing code for serial communication but I'm starting to dig into it. I'm also going to post up a thread in the Arduino forums to see if they have some input on this.

I'm also debating on including an LCD screen to display some data. Standard LCD screens use small text though that would be difficult to read while driving a car.
 
I bought a cheap I2C LCD screen off eBay. White text on blue background. It's easy to read and has a decent refresh rate. I can write to it with I2C faster than it can switch the display between recognizable characters. It cost me $27 shipped.

I found it best to find code that uses what you want BEFORE buying a component, especially if you're new to these things. Then you have something from which you can base your code.

The cool thing is that once you get it logging the ECU, you can then add things like EGT sensors for cheap (~$50 each), pressure sensors (~$10 each), and accelerometers (~$10 for a 3-axis).

I hope to get back into my project too now that I've graduated.

On that note, if anyone knows the communication protocol for 98/99 MUTIII (handshake, protocol, etc) that'd be a great service to me.
 
Thanks. I looked into I2C LCDs but couldn't find one at a price I liked. This parallel load LCD is dirt cheap and easy to use in 4 wire mode. I just used three black on green ones for school projects. I just want bigger characters if I'm sticking it in the dash of my car. I don't want to be struggling to read it while driving. If I can find a large character LCD I'm cool with using that.

Here is the black on green one I have been using.

My senior project was building a portable incubator that included data logging to a MicroSD and building a user interface with an LCD. I have all that covered. My problem is the serial communication. I am a total rookie when it comes to that.

Also, what were you studying? I've got one more semester left before I have my general engineering degree.
 
I studied aerospace engineering figuring that would be the best way to get the fluids classes, but I really should have just gone mechanical. Oh well, I'm done with school now. I've been messing with an electronic VGT setup, but that got sidelined when the exhaust manifold I bought couldn't fit the turbo. I should have a new radiator in the next month or so and I'm building my own exhaust manifold to put the turbo where I need it. But now I'm getting OT.

I like my 20x4 display. The text is still fairly large, but it gives you a convenient layout to display 8 data channels. It's a serial display with a I2C to serial adapter.

You must be logged in to view this image or video.


I had plans for mounting my display in the center vents.

I went with the Mega 2560, and I have full intentions on eventually filling every I/O with some sort of sensor. ;)


For those curious, in the photo, I'm reading the voltage across a potentiometer, representing the input from a MAP sensor. It reads in one of 1024 "steps", which can be converted to a voltage (hence the 0.00488 V/step) then that can be converted to a MAP sensor reading based on an equation that relates voltage to a pressure.
 

Attachments

You must be registered for see attachments list
This is the micro SD breakout I was talking about earlier:

MicroSD card breakout board+ ID: 254 - $15.00 : Adafruit Industries, Unique & fun DIY electronics and kits

I'll post something up asking about write speeds in their forums and see what I get back.


EDIT: looks like write speed probably won't be an issue:

View topic - New sketch logs 40,000 samples/sec • adafruit industries • Customer Support Forums, DIY Electronics, Open Source Hardware, Arduino

So you two electronic geeks junkies.Is this the board you using.

Wes in your last picture it didn't look like the one in the link.

So where did you get your board.I know where to get the TFT display.Kina want more info on the board,and what it can do, or display on the screen?
 
The board you see in the background is a microcontroller. I'm using an Arduino Mega 2560.
Arduino - ArduinoBoardMega2560

It has 54 digital I/O pins, 16 analog I/O pins, 256KB of flash memory on board, 4 KB of EEPROM, and a 16 MHz clock speed. The programs for it are written with code very similar to C.

But that's just one example of the many microcontrollers out there.


From there, you add additional breakout boards to make what you need. A breakout board is a PCB with all the circuitry on board to power the additional chip. It usually then has pins in a 0.1" breadboard-ready spacing that provide easy connections for all the I/O. If the breakout board is complicated enough, they are sometimes built as "shields." These have the same pin layout as the microcontroller and snap right down, directly on it.

For examples of breakout boards, see: http://www.dsmtuners.com/forums/dsm...-talon-tsi-awd-project-vgt.html#post152848206

But for my SD logging, I chose a SD Card Shield Plus.
attachment.php


It combines 3 breakout boards into one. It provides an additional 16KB of EEPROM, and SD card interface, and a RTC (real-time clock) that I can use to date stamp all the datalogs. And it all connects to my Arduino with only 4 wires because of the I2C interface.
 
I've had an areduino for a few years now and an MSP430 (they're cheaper and made by TI). I've been working on a project very similar to this on my own and haven't released much details about it. You should check out dsmecu.com there's some people there that could help with the more technical bits.

So you two electronic geeks junkies.Is this the board you using.

Wes in your last picture it didn't look like the one in the link.

So where did you get your board.I know where to get the TFT display.Kina want more info on the board,and what it can do, or display on the screen?

The display will display anything you program it to display. Adafruit sells most of the break out shields needed to do this and many other tasks. The question is kinda like asking, "what can you do with this programming language?" The answer is.... anything.
 
Code.Yeah.I don't know anything about code.Can I pick code from a program,much like the displayed values when using link(reference only)?

On second thought,If i can't pick displayed values and such.I know a guy who could help me out.
 
I know I'm a little late to the game here, but I agree that an arduino can more than handle a task like this. Just use a buffer to make sure the write time doesn't lag it down and cause it to miss updates from the ECU. It shouldn't be that hard to write code for, either. I recently used a pair of arduinos with an old LCD I had that runs on a standard coax input to build a digital flowbench for here at home.

Code.Yeah.I don't know anything about code.Can I pick code from a program,much like the displayed values when using link(reference only)?

On second thought,If i can't pick displayed values and such.I know a guy who could help me out.

If you're not familiar with code, then it'll be a difficult undertaking. Arduino is pretty much like C in code format.
 
I should really send that email out before I attempt making one of these.

I'll pick my logging battles.This is better left to a profesional.So I can hook it up and not worry about messing something up.

I don't want to mess up what I just spent a couple hundred dollars on doing right!
 
I should really send that email out before I attempt making one of these.

I'll pick my logging battles.This is better left to a profesional.So I can hook it up and not worry about messing something up.

I don't want to mess up what I just spent a couple hundred dollars on doing right!

LOL. Unless your trying to push the envelope and max out a small setup, I doubt this stuff is any real benefit. It's more to satisfy the inner dork, in needing to collect as much data as possible.

The $5 homemade cable, and mmcd on a laptop is more than adaquate for 905 of all dsmers.... but for those of us who want to tinker, and have the ability to do work like this continue on.

I was thinking using a dataq instruments box to be able to aquire data at a faster rate than the oem hardware, and I allready have one that I use for my chassis dyno.
 
Add Value - Be Respectful - No Trolling - No Misinformation - Participate Often!
Support Vendors who Support the DSM Community

Build Thread Updates

Latest Classifieds

Back
Top