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.

Using an Arduino Microcontroller to log or do stuff

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

Timechg

20+ Year Contributor
229
4
Oct 7, 2004
Iowa City, Iowa
I opened the thread http://www.dsmtuners.com/forums/tuning-engine-management/452394-using-wideband-without-gauge.html

Being a broke @$$ grad student (the majority of the time) on a meager research salary doesn't help with owning a DSM. I am currently taking a class (took it last semester as well) titled 'Intro to Robotics'. It's really an art class for sculpture majors...but my prof wanted me to learn about microcontrollers to develop a mechanical soft tissue testing device for the lab. Here is a great tutorial site that the class uses to introduce the microcontroller: Arduino Tutorial - Learn electronics and microcontrollers using Arduino! I feel like anyone could pick this up (because the art majors do as well with no prior knowledge in programming or circuits). There is a huge wealth of knowledge on the web for anyone interested in using microcontrollers for a specific application.

The idea is to use Arduinos or other open source microcontrollers to build/do random crap/stuff that we want on our DSM's. Using the microcontroller you could log additional analog outputs like an EGT temperature, coolant temperature, boost pressure (with a pressure sensor) or whatever you can think of to use. You could also control boost with a solenoid using the arduino etc.

DSMTuners is an open forum with ideas circulating about DSM's, it would be nice to start a thread with microcontrollers being utilized, sharing code and for troubleshooting ideas.


Relating to the original post I opened:

If this works I could just use the Arduino mini board (~$16 bucks) or an Arduino Uno (~$35) and a bosch wideband O2 sensor (~$60), Illuminated LCD Screen (~$20) to log AFR's for a fraction of the cost. The LCD screen could also display values of other analog signals in real time as well (you wouldn't be limited to one input which is desirable). The only problem I can think of is how the LC-1 translates the digital signal so that ECMLinkcan read it.

From the LC-1 website:

Wideband
Voltage: 0 to 5V
Lambda: 0.5 to 1.5
AFR: 7.35 to 22.39


Arduino values reads 0 to 5V as values ranging from 0 to 1023.

Converting the O2 Voltage to volts instead of what arduino microcontoller sees:

Voltage = Arduino_vals * (1023/5)

Converting Voltage to Lambda:

Lambda = Voltage * (1.5/5)

Converting Voltage to AFR:

AFR = Voltage * (22.39/5)

One step conversions:

Lambda = (Arduino_vals * (1023/5)) * (1.5/5);

AFR = (Arduino_vals * (1023/5)) * (22.39/5);

---------------------------------------------------------------------------------------------------------------------------------------
Here is a picture of the board that I would use. The mini arduino board (and maybe add an LCD or LED screen to display values):

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



---------------------------------------------------------------------------------------------------------------------------------------
Actual Coding Part, very simple....maybe. Questions that I will have to test is the digital signal. The LC-1 controller is an analog to digital converter. The arduino can do this as well, but utilizes digital pulse width modulations (0 to 255, or 0 to 5 Volts...so another conversion may be necessary between lambda and PWM values). I will have to test this with the O2 sensor hooked up but not installed.


//analog read values for 5.0V is 0 - 1023

float Lambda = 0;
float AFR = 0;

void setup() {

Serial.begin(9600);

}

void loop() {
float val0 = analogRead(A0); //read analog value pin0
float val1 = analogRead(A1); //read analog value pin1

Lambda = (val0 * (1023/5)) * (1.5/5); //Conversion to Lambda from analog input signal
AFR = (val1 * (1023/5)) * (22.39/5); //Conversion to AFR fom analog input signal

analogwrite(2, Lambda); //write data on pin 2


//Serial.println(val0); not needed just to see values of analog on a serial monitor
//Serial.println(val1);
//If there is an LCD screen hooked up then you can input AFR values:
//Serial.println(AFR);

}



---------------------------------------------------------------------------------------------------------------------------------------
If it doesn't work then it doesn't work, but I think I can get it figure out.
 

Attachments

You must be registered for see attachments list
I have an Uno myself and have thought of implementing it in the car. A wideband sensor requires more than just doing adc. This is a good read. How 5-Wire Sensors Work (Tech Edge)

But for other analog things an arduino would be good.

I think it would work, the wideband sensor is sending out voltage as the output signal from the sensor into the LC1 controller (for example). The LC1 controller converts the analog signal to lambda linearly (it's in their manual). The link was great, but it's only for the internal components of the O2 sensor (I am only concerned with what's coming out of there). It depends on if the signal is altered internally before coming out....I'm going to give it a try anyway (I'll buy the entire kit if it doesn't work without the gauge)

This is an idea that I may try down the road. Have an engine bay temperature sensor monitor temps and have a sliding vent door that opens automatically if it get's too hot...and have a button to close it manually if it rains out.
 
I would just get the LC-1 and let it do what it does best. This has the warm up and fault detection stuff all built in.

To read most analog sensors (0-5V), it's as easy as reading the pin voltage.

For sensors that are resistive (oil pressure, air temperature, etc,), you can build a voltage divider with the sensor as one resistor. Power it with 12V and make sure to choose the resistors correctly so you don't ever exceed 5V on the Arduino pin.

For EGT, look into the MAX31855. This is a thermocouple to digital converter. There are some other options (for example, the TMP513) that can be used too.

For pressure sensors, I'd look using GM MAP sensors or going with something like Freescales's MPX4250AP.

For more info/ideas, you can see what I was trying to do with an Arduino Mega here:
http://www.dsmtuners.com/forums/dsm-build-journals/424827-97-eagle-talon-tsi-awd-project-vgt.html

That was before my student loans began repayment. LOL
 
Love this! Might motivate me to get another Duimenlauve (sp). Did a lot of work with a project RC car with one of those, would be nice to use them in my really big RC.. well drivable car. Thanks for this.

Wonder how stable those floats will stay with all of that division.
 
You should pre-calculate all the divisions of constants and multiply where possible. It saves clock cycles.

Good point on that otherwise the values would be delayed. The floats are all there because using int would round off numbers.

I am still going to give it the college try....and if all else fails I will have an extra wideband sensor for later down the road.
 
I've always just used doubles because I know some languages, the compiler converts the floats to doubles anyway.
 
No real updates on anything that I am working on. I found this microcontroller/mini computer:

Why everybody wants a slice of Raspberry Pi - CNN.com

It runs linux, has USB ports and video out. If Ecmlink ever comes out with software for ARM processors this would be the most compact setup to hook up to an external monitor (I have a crappy Jensen double DIN DVD player with video inputs)...but at the end of the day an android application on a tablet/cellphone would be able to do the same thing.
 
Add Value - Be Respectful - No Trolling - No Misinformation - Participate Often!
Support Vendors who Support the DSM Community

Latest Classifieds

Back
Top