Show Posts
Pages: [1] 2 3 ... 10
1  Community / Exhibition / Gallery / Re: Arduino powered ECU for diesel engines on: December 18, 2013, 06:42:05 pm
I once bought an engine without original ECU unit at all. So i did have choice to find original ecu or bring own solution for that, and i did choose later option.

So here is it, running fine on test bench:

This engine (Audi 5cylinder TDI) has Bosch VP37 injection pump on it. I had to fully reverse engineer all controlling parameters for it.

Configuration can be done over USB real time (ANSI/VT102 text-mode user interface), there is also Debugging and Monitor software written in processing which includes meters display, data logging and of cource - terminal emulator for to connect the boards UI.

More information on my website:

Very nice Project. Please continue posting yr progress.
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Help needed for interfacing a car with Arduino on: March 19, 2010, 04:09:32 pm

I decided to use a voltage divider.

Some signals are coming and some are not.

At this moment, I am working on other things nothing to do with Arduino. I will remain so for a while.

When I come back, I will post my results. Sorry for that.

3  Forum 2005-2010 (read only) / Troubleshooting / Re: Help needed for interfacing a car with Arduino on: May 18, 2009, 05:58:52 pm
Ok, Mike to the good advice.

However, I am now worried about the possible damage to my Arduino.
It drives the LCD Ok, it computes based on analog inputs ok, but it do not process digital inputs.

For having a secure digital input, I am constructing a pulse generator with a 555 microchip. Then I will be able to test things properly.

QuickSander is worried about the voltage regulator build-in Arduino.
It is a valid concern. I would say that car voltage is rather stable and easy to regulate. Am I wrong?

4  Forum 2005-2010 (read only) / Troubleshooting / Re: Help needed for interfacing a car with Arduino on: May 12, 2009, 06:28:17 pm
Dear Mike,

Ok, thank you for the advice. In fact I was thinking just that: to test each sensor with a dedicated small program until I can manage its signal.

One thing I already did was to measure the voltages of the signals of four sensors (rpm, throttle position, fuel tank level and speed) and as you pointed, they are all ratios of the 12V of the battery.

As speed is a pulse as well as rpm, I need to write a small program that can handle these kind of signals.

Besides, I tried to wire a voltage divider in the car, to power all the sensors with 5V.  This didn´t work until it got dark and I paused that work. The voltage fell to 0.5 volts (too much resistance). I am thinking about trying with a pot, adjust the voltage to 5V and measure the resistance.

However, I was wanting to ask you about the voltage divider:

Should I make one voltage divider for the sensor´s signals or for the power vltage of the sensors themselves?

Of course the best way to know is testing.  I don´t know if all the sensors will work with 5V.

Ok to the treatment of spurious values, tks.

What I am missing is some source of pulsing signal to work at the desk with it, before connecting to the car.

There should be some circuits of this kind out there. Maybe a simple oscilator will make it...

In the previous email you talked about filtering noise from the car with a condenser. Didn´t you? What I missed was where to place the condenser: in parallel with the R1 or R2 resistor of the voltage divider?

When I make further progress, I will attach some picture of my work.

Thank you much for your valuable help.

Old Beaver
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Help needed for interfacing a car with Arduino on: May 08, 2009, 04:46:31 pm
Dear Mike,

Thank you much for your response. In fact I had already realize that voltage is not 12 volts. In fact, in my car battery is 13.8 v and 12.9 when I run the engine.

The voltage divider: yes, I have to study that way to down voltage to a max of 5 volts.

Noise: well, I haven´t think of that, but as soon as I read your mail I phoned a friend who will purchase those for me in the big city, along with resistances.

Vibration: ok, that is a point too. I have to secure the contacts.

Temperature: to be taken in consideration too. Ventilate. ok.

Signals are ratiometric. Well, I am confirming this at least in tank level signal, throttle position sensor. But I am not sure in speed signal and in rpm signal.

In the programming I am having two courious results:

a) rpm is giving me numbers even when I am not entering any signal yet. And this is in my desk, not in the car.  Tank level is behaving similarly.

c) Some values are supposed to be real numbers, with one decimal place. However, they are shown always as 4.0 ,  5.0,  6.0,  which is not normal.

Unfortunately I don´t know the wire language, just adapt routines I find in the net, or use some that good fellows like you give to me.

I made a new test of the program, and got this outcomes: If I assign tests values to rpm or throttle position, I get the assigned values.
So, it is not a printing problem on the lcd, but an input problem maybe.

I will continue testing until my resistances and condensers arrive.

Thank you much.


6  Forum 2005-2010 (read only) / Troubleshooting / Help needed for interfacing a car with Arduino on: May 07, 2009, 06:18:08 pm
Anyone that has tried to interface his car with Arduino? I know there are some, but cannot find their posts.

First of all, my program was supposed to work well (at least that was what I thought) at the desk, but when entering real car sensor signals, nothing seems to work.

I think it is corrupt somehow, because variables change their value all the time, even if I don´t input signals.

First, I want to test the program itself, to start with a strong basis.

Then, I will work with one sensor at a time, one by one.

Someone can give a hand with this?

Thank you in advance.

7  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't connect to Duemilanove on: January 04, 2009, 02:24:49 pm
Thank you much !
8  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't connect to Duemilanove on: January 01, 2009, 08:00:22 pm
I am changing email tomorrow ! And move from one home to another !

Oldbeaver, Chile, South America

Using Arduino for car interfacing. Starting to blik the led too !
9  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't connect to Duemilanove on: January 01, 2009, 07:57:52 pm
Hello Hillwalker !  Happy new year 2009 for you!

An off topic question: How can I change my profile? Where is that?

Please, help !
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: printing a double variable in LCD 4 bits on: November 17, 2008, 02:42:50 pm
Dear Mem,

The routine for printing decimals in an LCD display you posted, didn´t work for me.

The double definition of variables doesn´t show in my manual, only :


Besides, I have never progam in C before, only in BASIC.
So, I don´t know where should I put your routine: all instructions together, a part at the beginning, etc.

Consider I am using a display called GDM1602K Xiamen Ocular, using LCD4bit driver.

Hope you can help me a little more....

Any ideas?
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: Help setting up interface for 7 car signals on: December 14, 2009, 06:43:39 pm
It helps indeed.

Ok to all John,

Thanks a lot for the help.

I had a previous Arduino board clone, to which I had almost all signals working. However, the structure of the project was awful and had other problems. Besides, I burned several pins cause of higher than 5V signals. Finally, I decided to start over with a better construction.

Then several things that were working are not any more.

Ok to the impedance issue, tks for the advice.

Be sure no to activate the pullup resistors? Ok.

Well, for better understanding of your advice, I will study a little bit those concepts.

Thank you again, I will keep the Forum informed with my progress.

12  Forum 2005-2010 (read only) / Syntax & Programs / Re: Help setting up interface for 7 car signals on: December 14, 2009, 12:03:04 pm
Thanks a lot for the several responses.

I am going to answer any of them, in order.

To John Sidle,

Tks for the idea, use a zener diode to cut the voltage, however it will not cut the pulses. Right. I will need one zener for each signal. The problem here is the impedance, which is something I don´t know how to calculate when you connect two circuits.

Yes, the car voltage is over 12V, in fact, it is 13.8 volts when the engine is running. That is why I was using 2200 ohm and 1000 for the volt divider.

I work alone. I have to test speed with the car in motion, for example. not easy. The task of putting one resistor, take a raid, measure in motion, then put another and so on, is time consuming and difficult. Even dangerous.  That is why I want to start, at least, with the "correct" value instead of making so much experiments for each signal.

The same is for rpm and fuel flow, but at least in this case I can do the tests stand still.

The analog signals should be easier.

For easing the problem, I constructed a signal generator and used the notebook as osciloscope. With the osciloscope I can see the pulses in the sreen. But audio osciloscopes (PC computers oscilloscopes are audio based) receive too much interference even from the computer itself.

That is the reason I have asking for correct values for this. As Arduino pins are well known, their input impedance should be well known too by someone in the Forum.

I am a little confused because in other post you said I cannot use a zener and only a voltage divider with digital signals. Can you clarify this please?

Regard the position of the divider, I am aware of it, it is close to Arduino and not to the sensors.

Thank you much.

Mitch: I am trying to learn if zeners or voltage dividers. Anyway, using regulated 5 volts to energize the sensors is a hard task: the speed sensor, the fuel tank, the temp sensor, the rpm sensor. Only the two fuel flow sensors I installed would be easy.

Awol: Yes, you are right, I should use the special features for including code. And for including pictures too. However, for reasons unknown, the majority of ocasions they both do not work for me. I have lost so much time trying to do that! Something else I would like to show are circuits, diagrams, but I cannot. Sorry for that.

Maybe if you tell me exactly how to use these, step by step, I may learn once for all. Thank you for your comments.

PaulS: I will check the code. I made some editing for shorten the program. Anyway, lcd.print("title"), (variable) works fine with Arduino Ver. 17. I tried and voila!, it worked. Try it.

About voltage divider: in fact, car voltage is always over 12V, mine goes to 13.8 V with the engine running.

Ratio is the important thing, I am aware of that. And one can get the ratio with several resistors combinations, taking care of the current to avoid too high currents. I manage myself on that (Ohm´s Law). What is not in my electronics knowledge is "impedance". The only thing I know is that output impedance of circuits and devices are kept low and input impedances are kept high. The reason is to avoid that the input current is too high affecting the quality and values of the input signal coming from the previous circuit, they said.

However, I don´t know output impedances of sensors, nor input impedances of Arduino input pins, nor how to calculate them.
Maybe someone can teach us a little about it.

Thank you for your thoughts and time.

Thank you all.

13  Forum 2005-2010 (read only) / Syntax & Programs / Re: Help setting up interface for 7 car signals on: December 11, 2009, 04:37:29 pm
Dear All, and PaulS,

Ok, tks...

I have a scheme that represents my project. Don´t know how to attach it. It is in word.

But in brief it is has 5 parts:

The 7 car sensors. Output: 12V signals.
The voltage divider interface board. Output 5V signals
The Bares Bones Arduino board with the microprocessor
The 20x4 LCD display as visible output
The processing code

The signals are:


engine temperature sensor
fuel tank level sensor
throttle position sensor (pot)


engine rpm sensor
car speed sensor
fuel flow meter 1 sensor
fuel flow meter 2 sensor

The problem I am having is how to setup the 7 voltage dividers as to provide Arduino with a 5V or less signal, and, at the same time, not to fade (loose) the signals.

The ANALOG signals code I have at present is here:

// ============ ANALOG SIGNALS PROCESSING ==============
// ----------- Tank level reader, analog 3 --------

#include <LiquidCrystal.h>

// -------- reset pins, define pins, variables -----
float tank, x;                   // fuel tank level, aux
int throttle, y;                 // throttle position, pot
int temp, z ;                    // temp, aux

/* ------- create object to control an LCD GMD1602K -------*/
LiquidCrystal lcd(12, 14, 11, 7, 8, 9, 10);

void setup(){
 digitalWrite(5,HIGH);           // enables pull-up
 digitalWrite(1,HIGH);           // enables pull-up
 digitalWrite(3,HIGH);           // enables pull-up
 lcd.clear();                    // clear screen


  // ======= Execute program over and over ===========
void loop(){
  tank = analogRead(3)/3.3;     // read & correct sensor value
  lcd.setCursor(0,1); lcd.print("Tank:"); lcd.print(tank);    // display sensor value
  x = -0.0001846*tank*tank*tank + 0.0043404*tank*tank -0.258316*tank + 56.194;  //corrects to fuel tank shape (lt)
  lcd.setCursor(9,1); lcd.print(x);  // display shape corrected sensor value
  map(x,66.2,0,1,60); lcd.setCursor(17,1); lcdPrintFloat(x,1); // mapped & corrected fuel tank level value  

  // ======= Process trottle position analog 5 =======

  throttle = analogRead(5);                // reads throttle position pot
  y = map(throttle, 0,12,5,100);          // remaps signal value
  // ----------- print throttle position ---------
  lcd.setCursor(0,2); lcd.print("Tht:"), (throttle);  // prints signal value
  lcd.setCursor(10,2); lcd.print,(y);         // prints mapped throttle position

// =========== Temperature sensor Analog 3 =======

  temp = analogRead(3);           // reads temp of fuel return pipe
  int temp;
  // ----------- print temp of return fuel pipe ----------
  lcd.setCursor(0,3); lcd.print("Temp:"); lcd.print(temp);
  z = map(temp,0,100,0,100);              // remaps temp values
  lcd.setCursor(10,3); lcd.print(z);              
 // ============== END of Program ============
/* -------------- Function LcdPrintFloat ---------------- */  
void lcdPrintFloat( float x, byte precision){
  // precision is from 0 to 6 indicating decimal places

  if(x < 0.0){
    x = -x;

  lcd.print ((long)x);              //prints the integer part
  if( precision > 0) {
    lcd.print(".");                 //prints decimal point
    unsigned long frac;
    unsigned long mult = 1;
    byte padding = precision -1;
      mult *=10;                  //"amplifies" decimal values

    if(x >= 0)
      frac = (x - int(x)) * mult;
      frac = (int(x)- x) * mult;
    unsigned long frac1 = frac;
    while( frac1 /= 10 )
    while(  padding--)
    lcd.print(frac,DEC) ;

The DIGITAL signals processing code is here:

// ============ DIGITAL SIGNALS PROCESSING ===============

// ---------     Millis between pulses for Speed ---------
// --------------  Input on Digital 5 ----------

#include <DateTime.h>
#include <LiquidCrystal.h>

/* -------reset pins, define pins, variables ------------- */
int resetPin = 1;                     // pin 1 resets the time
int y, zz;                        // aux
int xx,yy;                        // aux var for pulse printing
volatile byte InCount1 = 0;       // declare this as a byte if the count is always less than 255
volatile byte InCount2 = 0;       // declare this as a byte if the count is always less than 255                            
                                  // so don't have to disable interrupts when using in loop
float ml1, ml2;                 // milli litres of fuel volume in each fuel flow sensor

/* --------   create object to control LCD    -------*/
LiquidCrystal lcd(12, 14, 11, 7, 8, 9, 10);

void setup(){
 // ---------------- Configure pin modes ------------------
pinMode(1, INPUT);                 // a button on this pin resets the time
 digitalWrite(5, HIGH);            // enables pull-up
 digitalWrite(4, HIGH);            // enables pull-up
 pinMode(2, INPUT);                  // define input pin
 digitalWrite(2, HIGH);              // Turn on pullup resistor
 attachInterrupt(0, count1, HIGH);   // call count1 when pin goes high
 pinMode(3, INPUT);
 digitalWrite(3, HIGH);              // Turn on pullup resistor
 attachInterrupt(1, count2, HIGH);   // call count2 when pin goes high
DateTime.sync( 0 );                        // set time to zero
 lcd.clear();                       // cleans display

void loop(){
// -------------- Process Speed sensor signal ----------------  
  lcd.setCursor(0,1); lcd.print("Pulse "),(pulseIn);     // print pulseIn signal for tracing
  zz=1800/pulseIn(5,LOW,1000);        // convert to speed
  lcd.setCursor(7,1); lcd.print("Speed " ), (zz);    // print speed
  constrain (zz, 0, 160);             // constrain to min & max values
  lcd.setCursor(14,1); lcd.print(zz); // print constrained speed
// --------------- input fuel flow pulses ---------------------

 if(digitalRead(2) == LOW)
     {DateTime.sync( 0 );      // reset time to zero if button pressed
 if(digitalRead(3) == LOW)
     {DateTime.sync( 0 );      // reset time to zero if button pressed
// --------------- print pulses count1 on LCD ---------------
  lcd.setCursor(0,3); lcd.print("Sig1:"); lcd.print(InCount1);                              // print pulse signal 1
  lcd.setCursor(7,3); lcd.print("Hz1:"); xx = constrain(InCount1,1,1000); lcd.print(xx);    // print constrained pulse count 1
  lcd.setCursor(14,3); lcd.print("ml1:"); lcdPrintFloat(0.166667*xx,1);                     // print pulses volume1 in mili liters            
  delay (100);
 // --------------- print pulses count2 on LCD ---------------
  lcd.setCursor(0,4); lcd.print("Sig2:"); lcd.print(InCount2);                              // print pulse signal 2
  lcd.setCursor(7,4); lcd.print("Hz2:"); yy = constrain(InCount2,1,1000); lcd.print(yy);    // print constrained pulse count 1
  lcd.setCursor(14,4); lcd.print("ml2:"); lcdPrintFloat(0.166667*yy,1);                     // print pulses volume1 in mili liters            
  delay (100);

  /* -------- Process of RPM sensor ----------------*/  
  lcd.setCursor(0,1); lcd.print("Signal: "); y = 60000/pulseIn(5,LOW,1000); lcd.print(y); // print signal pulses
  y= constrain(y,500,4000); lcd.print("Rpm:"),(y);                                        // print constrained signal pulses

 // --------------- Function count1 ---------------
void count1(){
 // --------------- Function count2 --------------
void count2(){

 // -------------- Function LcdPrintFloat ---------  
void lcdPrintFloat( float x, byte precision){
  // prints val on a ver 0012 text lcd with number of decimal places determine by precision
  // precision is a number from 0 to 6 indicating the desired decimal places

  if(x < 0.0){
    x = -x;

  lcd.print ((long)x);              //prints the integer part
  if( precision > 0) {
    lcd.print(".");                 //prints decimal point
    unsigned long frac;
    unsigned long mult = 1;
    byte padding = precision -1;
      mult *=10;                  //"amplifies" decimal values

    if(x >= 0)
      frac = (x - int(x)) * mult;
      frac = (int(x)- x) * mult;
    unsigned long frac1 = frac;
    while( frac1 /= 10 )
    while(  padding--)
    lcd.print(frac,DEC) ;

Both processing codes parts are compiling OK.


The main problem at this time is to define the resistors for the voltage dividers, as at present I get some bad signals or no signals and I don´t know for sure if it is a voltage divider problem or a wrong code problem.

At present what I have is a 2200 ohm resistor: (A 2200k B). In side A of this resistor I connect the input 12V signal. In side B I connect a 1000 ohm to ground. The output 5V signal is taken from the junction of both.

But one can get a 5V signal with several values of resistors. Which are the optimal ones? That is my problem. At least, this is one of them.

Please, help.

Thank you much in advance.
14  Forum 2005-2010 (read only) / Syntax & Programs / Help setting up interface for 7 car signals on: December 08, 2009, 05:42:39 pm
Dear all,

I am stopped with this problem. I don´t know how to make my voltage dividers to get optimal signals for Arduino from my car 12V sensors (ratiometric).

I started with 2k and 1k resistors to get 1/3 of the 12 volts, but am having trouble getting good signals.

Any help or suggestions?



15  Forum 2005-2010 (read only) / Syntax & Programs / Re: Sampling and processing data on: July 15, 2009, 01:27:05 pm
Dear AlphaBeta, Mem and the Forum,

Ok, tks to all of your explanations.

I will begin a new set of tests with one sensor at a time, today, to see if I can debug the multiple problems I am having with the car sensors and its processing.

This time, I will take advantage of the new knowledge I got from you people (AlphaBeta and Mem), from some books I got and from my own experimenting (trial and error, basically).

Let´s see if I succeed now. At least in part.


Pages: [1] 2 3 ... 10