loading

The main reason I made this project is the lack of a trip computer that is designed for LPG powered cars.

I named it Bi-TripCo as it can measure the fuel consumption for both fuel systems of a Bi-Fuel car (LPG and Unleaded). (for a detailed view see the embedded video of step 9)

Some might say: "I can buy one from the market" or "ok, a similar one, no big deal!". Don't rush.There are many (or some) tools out there, that can calculate the consumption of conventional fuel systems, which are very easy to use: just plug it into the OBD port of your car - unless you have an older car which does not have one, like mine. And, of course, there are some very good implementations based on Arduino, which can calculate many things related to the Unleaded fuel consumption.

But those tools can not be used on an LPG powered car (not to mention the relatively high cost of some of them).

Not only, they are useless for an LPG system, but they also give wrong readings (or no readings at all) related to the petrol system. Even, the already installed trip computer on a modern car becomes useless, as soon as an LPG system is installed.

Therefore, this system is not only useful for older vehicles but also for new ones, with an installed LPG system and it is universal.

An LPG ECU produces different signals to drive the LPG injectors from the ones that the car ECU produces to drive the petrol injectors (see step 3). For that reason, the part of the code concerning the measurement of the LPG consumption differs from the one that concerns the gasoline (or petrol...? :-) ).

I am giving you 2 versions of the code (step 8): One with metric units (l/100km etc. see the last animated .gif above) and one with imperial/US units (MPG, MPH, Fahrenheit etc. see the 1st animated .gif above).

Bi-TripCo tested many times throughout the last months and found to be way too accurate. The error does not exceed 0.8% for the total amount of the LPG litres consumed, of which the correct measurement is the main requirement (In fact the last time I test it for about 1500km the error was ~0,02%!!!!! The trip computer measured 111,3lt of LPG and I filled up 111,32lt in total!!!)

Finally, there are parts in the code and the schematic that are useful to other projects too, like:

  • long (press and hold) and short button press
  • RTC time setting with external buttons
  • thermometer using a thermistor
  • ATmega328 timer interrupts
  • EEPROM read and write
  • use of an OLED display
  • external interrupts (more than the usual 2)
  • Hardware Debouncing buttons (see the schematic at step 8)

At this project is also implemented a clock (RTC) and a thermometer using an NTC thermistor.

  • As I have seen so far, no one of those who built a similar system does not give all the information you want to build it by yourself. For this reason, there are detailed steps with pictures and comments where needed.
  • Also, there are many comments in the code files, in order to understand what I am doing every time. I hope you will find them helpful and also useful for other projects too.
  • Finally, as you will notice there are many steps. This should not disappoint you if you plan to build such a system which, as you will see, it is relatively simple (see the schematic and you will understand what I mean).


This project was not easy for me too. When I firstly began to build it (almost a year ago), I knew basic things about Arduino. But after countless hours of searching, reading, studying, testing and of course failing ... I managed to build something. My first attempt was this one. Nice, isn't it! :-) Nevertheless, it worked good enough. I started to think which would be the best way to install it on my car and finally I ended with the one that I present you. I hope you will agree that it is a nice work and well adapted to the car. Certainly there is enough room for development and improvements...

After that, Instructables appeared. I thought that it was a good opportunity to share my work with other people. I believe that it is a good thing to share our ideas over the internet, as many competent people, with passion for their work, are doing. Thanks to them I managed to build this project and now I am very happy to introduce my work. Only this way we can become better and move forward. And Instructables is a good place to start...

Step 1: What You Will Need...

The things that you will need are:

  1. Arduino Uno board or compatible...(I use an Arduino Duemilanove only as a programming board which is the same with Arduino UNO)
  2. +Optional: 2nd Arduino Uno for testing at home (I used as a second one a Leonardo...).

Components:

  1. Atmel ATMEGA328P-PU microcontroller with Arduino Uno bootloader, 16MHz crystal + 28 pin DIP socket
  2. DS3231 RTC IIC(real time clock module) -(please read step 5 for some modifications you have to make at this module in order to work properly) - do not use the DS1307, is useless.
  3. 0.96" OLED Display module(you can use your preferred display with some easy modifications in the code - I used this one because it fits well at the dashboard of my car)
  4. Voltage regulator LM7805 or MCP1702-5002 LDO Low Quiecent Current Regulator (it's a little more expensive but it is better for the life of your car's battery - while it is not running of course)
  5. 10kohm NTC thermistor
  6. 5.1V zener diodes (x4 - easy to find at a local store or ebay)
  7. Resistors (local store or ebay)
    10kOhm (x6), 47kOhm (x1), 100kOhm (x2), 10MOmh(x1),
  8. Capacitors (local store or ebay)
    Ceramic: 22pF (x2) -- MKT: 47nF (x2), 10nF (x1) -- Electrolytic: 10uF (x1), 1uF (x1)
  9. Push Buttons (x2) - (local store or ebay) like this one or this one or... depends on where you want to put the buttons and what you prefer -- buy some more if you want to test it on a breadboard
  10. Prototype PCB - something like this one is enough or buy a bigger one and cut it to the preferred size (or you can build a PCB if you have the ability but it is not necessary)
  11. Cable wire connectors like this or this or what suits best for you (they give you the ability to take off the trip computer from the car and make changes to the program)
  12. Electric wires, long enough to make the necessary connections

Tools:

  1. Multimeter (helps to find the signals we need from the car and make and make some basic measurements)
  2. Wire cutter or striper
  3. Soldering iron, wire and paste
  4. Isolating tape or heat-shrink tubes
  5. Optional: Breadboard and connection wires if you want to make some tests or to play around before you build the entire circuit.

Software:

  1. Arduino IDE
  2. Notepad++ (code editor)
  3. LCD Assistant (helps to display our own graphics on the screen)

As you can see the components are quite cheap.
The total cost can be kept easily below $15 (without the Arduino Uno and of course the tools).

Step 2: Principles of Operation and Signals Needed From the Car

1st signal: Injector driving signal

The total amount of fuel that an injector flows is proportional to the time that the injector is open.*

So, in order to calculate the fuel litres consumed we have to measure the time that the fuel injectors open. Then, using a coefficient, we can correspond that time to how much fuel the injector flows. We don't need to record the total time from all the fuel injectors. The signal (see the first picture above) from one of them is all we need.

The measurement of the total opening time of all 4 injectors is not only complicated, but it is also useless, because the total time is 4x the time that one injector opens. The factor 4x can be put in the coefficient that we mention above.

Mathematically we can write:

Litres of fuel burnt = Total milliseconds that an injector open X some coefficient (in litres/ms)

Don't bother about the coefficient. It is not so difficult to find it.(Step 10: Calibration... will help you on this)

(Everything mentioned above are applicable both for LPG and petrol. See next step for a difference between the signals for the one and the other fuel system)

You can find the corresponding wires easily at the engine compartment. Is the wires that go to the injectors connectors. See step 4.


2nd Signal: Speed Sensor

The second signal we need is from the speed sensor (2nd picture) of the car (known as vehicle speed sensor - VSS). This sensor produces pulses every specific distance. So, measuring the pulses and multiplied them with the distance travelled per pulse, we can calculate the total distance travelled.

Mathematically:

Distance = "Pulses from VSS" x "Distance between pulses"

See step 4 in which you can find info on how you can find the VSS signal.


3rd Signal: Ignition signal

The third signal is from the ignition switch. This signal is needed in order to put the trip computer and the display in sleep mode so as not to consume current while the car is parked.(see again step 4)

So, with the gasoline injector signal we must do 7 external connections in total:

  1. LPG injector driving signal (see step 4)
  2. Petrol injector driving signal (see step 4)
  3. VSS signal (see step 5)
  4. ignition signal
  5. 12V - battery voltage
  6. GND
  7. 1 connection for the thermistor (the other terminal of the thermistor goes to the chassis of the car - ground)

That's all...


(* that is not exactly true but for this project it seems to work quite well.)

Step 3: How an LPG Works + Driving Signals for LPG and Gasoline Injector and a "problem"...

(You can skip this step if you want, but I suggest to read it...)

In the picture 1 above you can see a simplified diagram of how an LPG system is installed and how the injectors work.

At first, lets see how the car ECU controls the petrol injectors:

The two terminals of the injector is the terminals of a coil. The one terminal of the injector is constantly connected to 12V. The second terminal is controlled by the ECU. When the injector is closed the second terminal is open and if you measure the voltage at this terminal you will find 12V. The injector opens when the ECU grounds this second terminal (current flows through the coil) for the amount of time needed (some ms every time) and the voltage will be 0V. So, when the voltage is 0V at the second terminal of the injector, the injector is open, and gas is flowing through it. The driving signal for the petrol injector is like the one at the 2nd picture above. The 3rd picture shows the signal that my car's ECU produces to drive the petrol injectors.

LPG injector:

As you can see (1st Picture above) the LPG ECU is interposed to this second terminal of the petrol injector (the wire of which is cut). With this connection the LPG ECU determines the time that petrol ECU "wants" to open the petrol injector and grounds the LPG injector for the correct amount of time.

LPG injector opening time = Petrol injector opening time X some coefficient, which is not constant and is related to the revs of the engine and in some degree to the temperature of the gas.

The problem...*

This is the main difference that I mentioned in the intro.

As you can see from the measurements (pictures 3, 4, 5 and 6) the driving signal of the LPG injector is not clear as the one for petrol injector. That's why the part of the code that records the time that LPG injector is open is different and more complicated than that for the petrol injector opening time.

Idea behind the part of the code that records the LPG injector opening time:

We always record the time a change occurs at the LPG injector signal.

We have 2 variables for this: injTime1 and injTime2

injTime2 is the time of the current change of the signal

injTime1 is the time of the previous change of the signal

We make the calculation (injTime2 - injTime1).

This interval can not be bigger than the duration of the first LOW (picture 4) which appears each time the injector opens.

So, we check that and if it's bigger we don not take it into account. (If it is bigger this means that this is the long HIGH between 2 subsequent LPG injector openings).

If the (injTime2 - injTime1) is within the acceptable interval limits we add it to the previous one.

Also we have a down limit (8us) for noise cancelling.

Below is the part of the code that is just described (see .ino file for more comments):

this is called every time a change occurs to the LPG injector signal

void LPG_injector_time()

{

injTime2 = micros(); //records the time a change occurs at the LPG injector signal

//check if the (currentTime - preciousTime) is within the limits

if ((injTime2 - injTime1)<6000 && (injTime2 - injTime1)> 8) //6000 can be less than that

{ LPG_injector_open_duration = LPG_injector_open_duration + injTime2 - injTime1;

//this is for 1sec interval. Every second we calculate the amount of LPG burnt using a coefficient (litres/us or gal/us) and then we reset the "LPG_injector_open_duration" variable to zero. This is useful for the instant consumption.

}

injTime1 = injTime2; // hold the current time that a change occurs in order to use it at the next time a change occurs.

}

After this we calculate the Total LPG used with the following formula:

used_LPG = used_LPG + (LPG_injector_open_duration * LPG_injector_flow);

LPG_injector_flow is the coefficient we mention above and we can set it while the system is installed at the car.

This gives us the ability to make the calibration more easily.

(*Ok, this is not really a problem. This is how low impedance injectors work, as I found then. But the first time I saw it, it didn't do good impression to me!!!! :-) )

Step 4: Connections + Finding the VSS Wire...

LPG and Petrol Injectors' driving signal wire.

We can take the signals we need from the following wires (see picture 1 and 2 above):

LPG injector signal: Wire A

Petrol injector signal: Wire B or C

While the engine is turned on the signal that we want must not be steady at 12V. The 12V wires for all the injectors usually have the same colour. So, you can easily identify it, without making measurements.

Also, we don't care which injector. So, you don't need to take LPG injector signal and petrol injector signal from the same cylinder.

At the second picture you can see the connections at my car (Honda Civic 1997 MB1).

As you can see I used an ethernet cable to bring the signals inside the car.

VSS Signal

(picture 3 and the embed video )

I think that VSS wire is the most difficult to find. If you have a service manual of your car it will be quite easy. If you don't, with a little internet searching on Google and specific forums, I am sure that you can find it.

Even if you were not able to find it on the internet, you can find it using the multimeter (be sure it is not at the auto-range function). You can measure the signals that goes to the pins of the ECU. If you find one which alternates between 12V and 0V (or 5V and 0V like mine, which is a Honda) while you move the car quite slowly, then you have find your car's VSS signal (this method I followed to make sure that the cable, I found, was the right one). You don't have to start the engine but you have to turn the ignition key to ON, and you have to push the car forwards or backwards for around 2 meters. And this is the best way to find the signal so as not to be confused with the injector's signal. See the video and I am sure you will get the idea.

As you can see, I used a T-tap connector for the VSS signal, but in fact, this is not so good idea. If you are able, solder the cables together. The signal will be more clear to read with less noise. With the first chance, I will solder it too.

Another location of the VSS signal is at the wire harness that goes to the odometer of the car, behind the instrument cluster. You have to take it off, to find it. I managed to take some photos and a video for that too. See the pictures above.

(You can find the VSS signal at the engine compartment but I think it is more difficult to find it there and make the connection).

Ignition Signal

It is not necessary to make the connection directly at the ignition switch wire harness. Probably, we can find many wires under the dash at the driver's side, which have 12V while the ignition is on and 0V while it is off. The sure thing is that you can find one from the wire harness that goes to your car's audio system. I get this signal from an optional connector that the under-dash fuse box of my car has.

Precautions: Every time you cut a wire or solder something at your car's wires, take care so as to be sure that you will not make any short circuit. If needed, cut only 1 wire at a time. It is a good practice to disconnect the ground pole of the car battery beforehand. Personally, I didn't cut any wire of the car. I only stripped some.

Step 5: DS3231 Real Time Clock Module Modification and Temperature Sensor Settings...

RTC modifications:

There are some easy modifications you have to make to the RTC module in order to work flawlessly.

Look at the picture above. Desolder the diode and the LED indicated.

The module has a charging circuit for use with a rechargeable LIR2032 coin cell. In order to use a normal non-rechargeable cell, you have to remove the diode beside the chip (see picture). If you don't do that, after some time, it will give you wrong time and the battery will be destroyed.

Also in order to consume the less current possible, I desolder the LED.

Temperature sensor (thermistor) settings:

I borrowed the code from Adafruit.

In order to take proper reading from the thermistor we have to know some values about it. These are:

  • Nominal resistance at 25 degrees of Celsius
  • And the B coefficient.

Look at the code for more details. These values are provided by the manufacturer of the thermistor.

For the thermistor I proposed, these values as you can see, are: R = 10kOhm and B = 3435.

How to use the thermistor of an old thermometer

Initially I used the thermistor from a broken digital thermometer like this one. But I had to make some tests in order to find the right values. The nominal resistance is easy to find.

Just measure the resistance at a known temperature. My thermistor has 47kOhm resistance at 24 degrees of Celsius. So, I put these values. Also the value of the resistor that I used was around 47kOhm. It is better to make a measurement to be sure what is the exact value, because they have some tolerance.

The B coefficient determined by making some tests using a refrigerator and a good working thermometer. I connect the circuit that you can see at the Adafruit link, that I gave you, and then I compare the readings from the Arduino and the digital thermometer. I made changes to the B coefficient until the 2 readings became the same.

Step 6: Graphics...

The graphics are created with the help of the LCD Assistant program.

The steps to create a graphic are:

  1. Find (or create) a black and white (or grey-scale) picture with x and y dimensions which are multiple of 8, eg.16x16, 16x32, 24x24, 32x32, 32x64, ....128x64 not bigger.
  2. Open it with a picture program (like windows paint)
  3. Save it as monochrome (2 bit) bitmap (bmp image) with one word as a name
  4. Open the LCD Assistant
  5. File --> Load image... and select the image that you just created
  6. At the settings -- Byte Orientation -- Select Horizontal
  7. File --> Save output
  8. Save as .txt file
  9. Open the .txt file with Notepad++ (or any other text editor)
  10. Copy the contents to your sketch adding the word PROGMEM before or after the brackets in order to save the data array in flash memory of the microcontroller.
  11. Go to the point of the code that you want to put the graphic and add the following line: display.drawBitmap(x_position, y_position, nameOfBitmap, widhtOfBitmap, heightOfBitmap, WHITE);

where "x_position" and "y_position" indicate at which pixel of the display will be the upper left pixel of the bitmap.

(See the pictures above and the code).

Step 7: Libraries and Necessary Modifications to Them...

Instructions on how to install libraries into Arduino IDE see here.

You will need to make some modifications to the libraries. My preferred editor is the Notepad++.

Libraries:

Modification #1: Once you install the Adafruit SSD1306 library go the library folder (usually: Documents\Arduino\Libraries ) and find the file: Adafruit_SSD1306.h. Open it using the Notepad++. Uncomment the line #define SSD1306_128_64 and comment the other two. This defines the size of our display.

Modification #2: At the same file. Find the line: #define SSD1306_I2C_ADDRESS 0x3C. If this address does not work for you, change the 0x3C with the address of your OLED display (usually there is one alternative - 0x3D). If this also does not work connect your OLED display to the Arduino as seen at the schematic and then you can find the address using i2c_scanner (by Frode Grimstad Bang) or this scanner (by Nick Gammon).

  • EEPROMex library by Thijs Elenbaas: enables the reading from and writing to EEPROM with an easier way. We need this to store the values. The Bi-TripCo does not lose the measurement, if we disconnect the power supply.

Modification to EEPROMex: The library has a protection in case we make some mistake at our sketch and accidentally make continuous writes at the internal EEPROM, which will result to destroy the EEPROM (max ~100.000 writes). If you do not make any change to the code or you are sure what you have done then you must do the following in order to be able to take advantage of all the writing cycles.

Find the file EEPROMex.cpp and comment the line#define _EEPROMEX_DEBUG.

  • RTClib by Adafruit: Real Time Clock module Library

Step 8: Schematic and Code Files...

  • Here are the schematic diagram and the code files for both versions (metric and imperial/US).
  • As you will notice, I tried to keep the code in the boundaries of the Arduino language. For that reason, I think that the code is quite simple and straightforward.
  • Also, I am giving you a code file for the Leonardo to play around. If you connect the circuit that you see above, you will see that some readings (instant consumption and current speed) are not completely steady. This is happening because we read the values every second and the number of pulses that occur are not exactly the same every second. There is a way to smooth out these readings, if we take the average of the last 2 or 3 seconds. Nevertheless, if you see the total LPG litres, total Unleaded fuel and travelled distance you will notice that the measurements are absolutely right.
  • Inside the code file for Leonardo, you can find which are the necessary modifications in order to use a second Arduino UNO instead.

As I mention in step 3 we need to do 7 external connections in total:

  1. LPG injector driving signal (see step 4)
  2. Petrol injector driving signal (see step 4)
  3. VSS signal (see step 5)
  4. Ignition signal (see step 4)
  5. 12V - battery voltage
  6. GND
  7. 1 connection for the thermistor (the other terminal of the thermistor goes to the chassis of the car = ground)

You have to be sure that you are making good connections. I wasted a lot of time on debugging problems which proved to be bad connections (eg. not working at all or freezing).

Before you upload the code, change the "Full_tank" variable to the capacity of your vehicle's LPG tank.

Step 9: Operating Instructions

As you will see, I gave more emphasis on readings related to the LPG, since this is the main fuel of a bi-fuel car. With some easy modifications in the code you can have the same readings for the petrol system, too.

Every time the ignition key is turned to ON, the Bi-TripCo wakes up, the logo screen appears for 2 seconds and the next screen is the screen that you saw before you turn the key to off.

The very first time that you 'll switch the ignition on, the first screen is the Instant LPG consumption.

At this screen press and hold button no 2 to go to "LPG Coef." setting menu where you can change the LPG coef. according to your measurements.

When you turn off the ignition key it stores the recorded values and enters the sleep mode.

Button no. 1:

Short press function only

  • Changes the misc screens forward
  • Changes Hour at the "Time Setting" menu
  • Changes the value of the selected digit at the "LPG Coef." menu.

Button no. 2:

Short press (the changes are made on release):

  • Changes the misc screens backwards
  • Changes the Minutes at the "Time Setting" menu.
  • Change the selected digit at the "LPG Coef." setting menu.

Long press (press and hold for 3 seconds):

  • When you see the Time and temperature screen goes to "Time Set" menu.
  • At the "Time Set" menu goes back to the screen, that shows Temperature and Time.
  • Long press at the Instant LPG Consumption screen goes to "LPG Coef." menu.
  • Long press at the "LPG Coef." menu stores the new value of the LPG coefficient and goes back to the Instant LPG Consumption.
  • Long press at Average Speed, Distance travelled, LPG litres used and Unleaded Fuel Used resets the corresponding reading to zero.
  • Long press at either Average LPG Consumption or Average Unleaded Consumption resets both of them.
  • Long press at Remaining Fuel in tank resets the tank to the full capacity of the tank and remaining distance is reset with respect to the current average consumption.

The sequence of the screens is:

  1. Instant LPG consumption (l/100km or MPG -- when speed = 0 shows the instant consumption in l/h or Gal/h )
  2. Average LPG Consumption (l/100km or MPG)
  3. Instant Speed (km/h or mph)
  4. Average Speed (km/h or mph)
  5. Travelled Distance (km or miles)
  6. Remaining distanceto empty (km or miles - in conjunction with the average LPG consumption and the remaining LPG litres in tank)
  7. Total LPG Burnt (litres or gallons)
  8. Remaining LPG (litres or gallons)
  9. Outside Temperature and Clock (Celsius or Fahrenheit) -- when the temperature is below 3 degrees of Celsius (or 38 Fahrenheit) it shows a warning (a snowflake at the upper left corner of the display.
  10. Average Unleaded fuel consumption (l/100km or MPG)
  11. Total Unleaded Fuel burnt (Litres or Gallons)

Step 10: Calibration...

After you successfully install the Bi-TripCo to your car and seems to work, you have to calibrate it.

The first time that you turn the ignition key to on, the first screen will be the instant LPG consumption.

At this screen long press Button2 to set the LPG Coefficient.

A good value to start is:

a. For those who use l/100km set LPG Coef. = 1200

b. For those who use MPG version set it to around 3000

Initially, we care only for 3 readings:

  1. Travelled Distance
  2. Total LPG Burnt
  3. Total Unleaded Burnt

Any other reading will be completely false. Set the time if you haven't already done.

A. Determination of the vss_pulse_distance variable (distance related coefficient -- see the code)

If you want to make accurate calibration, you have to use a GPS or your phone's GPS with an app. The app that I used is GPS Essentials. Before you start to drive your car, open the app and go to settings:

  • set GPS update interval and Tracking update interval to Fastest.
  • Then go to units set your preferred unit system.
  • Go back and select Dashboard. Tap to + and add the Distance covered. Reset the value by long press on it.

At the Bi-TripCo go to the Travelled Distance and reset it to zero.

Turn on the GPS (and GPS Essentials) and drive your car for some distance. Take care to have a good GPS signal. A good distance to drive is around 20km (The more you go, the more accurate your calibration will be - my test route at some time was around 88km). It is obvious that at that time the 2 readings (from GPS and Bi-TripCo) will not be equal. It's ok.

After your test route, write down the readings from the GPS and the Bi-TripCo.

We will use the Rule of Three to calculate the correct vss_pulse_distance variable.

Assuming that the readings are:

GPS: 10km

Bi-TripCo: 12km

and the vss_pulse_distance variable with which you make the test route is the one that is at the code files that I used: 0.0003816033

then we have new vss_pulse_distance = old_vss_pulse_distance * (GPS_distance/ Bi-TripCo_Distance)

so, for the above values will have: new vss_pulse_distance = 0.0003816033 * (10 / 12) =0.0003180028

Take the Bi-TripCo off, correct the variable in the code and upload the code again.

Go for a test and see if it is ok. Now the 2 readings must be close enough.


B. Determination of the LPG (and Unleaded) Coefficient (LPG_injector_flow and unleadedFlow variables)

The following are applicable for both LPG and Unleaded Fuel.

  • Put the values, I mentioned above for the LPG Coef.
  • Go to your preferred gas station.
  • Fill up your tank to complete full.
  • At Bi-TripCo reset the value: Total LPG Burnt (or Total Unleaded Fuel Burnt) -- reset the Tank to full if you want, too.
  • Drive your car, as you usually do, probably for some days, until you consume enough amount of LPG (or Unleaded fuel)
  • Go back to the same gas station, at the same pump and fill up your tank again.
  • Compare the amount of LPG you fill up and the value that the Bi-TripCo recorded that you have burnt
  • Then do the following calculations:

eg. LPG litres filled up = 45lt

LPG litres by Bi-TripCo = 65lt

Initial LPG Coef. = 1200

  • Calculate the calibrated LPG Coef. with the following formula (Rule of Three again)

The calibrated LPG Coef. = Initial LPG Coef. * ( LPG litres filled up / LPG litres Bi-TripCo )

So in this case: LPG Coef. = 1200 * (45 / 65) = 0831

  • Go to Bi-TripCo and set the new value.

*For the unleadedFlow variable you need to upload again the code with the new value.

Fill up your tank at the same fuel station again to test the new value.

Now your Bi-TripCo is calibrated. Of course you will make some more tests, after the initial calibration, for longer distance and period, in order to be sure that everything is ok.

Step 11: Bi-TripCo on My Car - an Installation Idea

Here you will see pictures from the installation on my car (Honda Civic MB1 1.6iLS - an old, but reliable car) and mostly pictures from the modification I made to the original clock assembly, in order to place the OLED display in it.

That gave me also the ability to use the 2 pre-existed buttons, for the Bi-TripCo. I implemented the debouncing circuit inside the clock assembly (see the pictures).

The disadvantage of this is that I needed more external connections from the display to the "central unit" of the Bi-TripCo and that's why I had to deal with many connections problems. I wasn't too careful.

The cables, I used, are cat5 ethernet cables, for no specific reason. For that, I used RJ45 PCB connectors, which gives me the ability to take it off easily, in order to do some modifications or for development purposes.

I also used the case of an old ADSL modem to put it in, and I place it in the glove compartment.

The RTC does not fit inside, that's why it is outside of the case.

Also I used the MCP1702-5002 LDO Low Quiecent Current Regulator.

There is also a picture with the Honda logo that I used at first.

Finally

At the PCB pictures you can see some other components too and also some modifications that I have made (don't worry the schematic that I gave you is the right one). The extra components (you can see clearly a big transistor) it is used for the locking and unlocking of the doors. This extra circuit gives the ability to lock and unlock the car while the alarm is arming or disarming respectively. Also there is the ability to lock the car when the speed exceeds 10km/h and unlock when I turn the ignition key to OFF.

So, the number of the external connections in my case from 6 became 14!!! (mainly because the display and the buttons are not in the case with the main circuit) and the ethernet and RJ45 connectors was a good solution.

Thank you very much for your attention!!!

<p>Hello Nikos!</p><p>That's a nice project and i made it and it works like a charm, but i have some question: How can i &quot;see&quot; [km/l] instead [l/100km] at display?</p><p>Regards,</p><p>William</p>
<p>Thank you very much!</p><p>Below are the changes you have to make:</p><p><br>1. Line 415:<br><br>avg_LPG_consumption = traveled_distance2/used_LPG2;<br><br>2. Line 416:<br><br>distance_to_LPGstation = avg_LPG_consumption * LPG_in_tank;<br><br>3.Line 418:<br><br>average_L_100km_Unlead = traveled_distance2/used_Unleaded2;<br><br>4. Line 814:<br><br>instant_LPG_consumption = (vss_pulse_distance * vss_pulses)/(LPG_injector_open_duration * LPG_injector_flow);</p>
<p>I'll test it.</p><p>Thank you!</p>
<p>Hello! I made it! And it's working well! But I want to know your other modifications (like close the doors) or add the rear parking sensor with view of distance on OLED!<br>Another thing my friend, it's possible to see also the instant unleaded consumption and not only the average?<br>Many thanks again!</p>
<p>Well, as far as the locking of the doors concern, what I made, it is applicable on the specific model only and the models that have the same central locking system. Concerning the parking sensor I can not give a specific advice, because I haven't done something similar, but it is a good idea and I think not so difficult to implement.</p><p>For the instant unleaded fuel consumption consult the part of the code related to the instant LPG consumption (void LPG_Consumption() ) and make the appropriate modifications. Also you have to increase menunumbermax by 1 and build the new screen - case.</p><p><em>If you made it, hit the <strong>&quot;I made it!&quot;</strong> button above. It is good thing for the authors to see that someone helped from their projects! ;-)</em></p><p>If you need further assistance don't hesitate to contact me through private messages.</p>
<p>Hi Nikos! You've made a very nice project!</p><p>I've tried to do it too but came up with some problems. I did some changes to the code because I only wanted to do the Unleaded part. So I've removed some of the LPG code. My problem is that for some reason it doesn't work. I've checked the wiring and everything seems to be right. I've found the VSS and Unleaded signals and wired up only one button so that it could change screens.</p><p>I've posted the code here <a href="https://pastebin.com/MPTBmMDQ" rel="nofollow">https://pastebin.com/MPTBmMDQ </a> and if you or anyone else would take a look at it would be really helpfull.</p><p>Thanks in forward.</p>
<p>Thank you very much!</p><p>You must be more specific when you say that it does not work. Does the LCD<br>screen work?</p><p>Can you give a schematic of your circuit?</p><p>As I have seen, you made quite a lot of changes in the code. Also you changed<br>the screen with an LCD, you use only one button and you use the DS18B20<br>digital temperature sensor (I agree with that). </p><p>Also I saw that you have put some long delays (10sec or 50sec!!!). Long delays will make your<br>program unresponsive. <strong>Get rid of the delays.</strong></p><p>Anyway, from my experience, as<br>I do not have the time to check it thoroughly, I would advice you to make only<br>one change at a time. Begin with the LCD and leave the rest of the code intact. </p><p>If you manage to make the LCD screen to work properly then do the next<br>change and so on. Remember: <strong>one change at a time</strong>.</p><p>It is better to do the tests using the breadboard (see step 8).</p><p>If you want further assistance, send me a private message with your progress and anything you<br>want. I will try<br>to help you.</p>
<p>Hi Nikos! it's a very very beautiful project!! I have a question about it... How it's possible to change from [l/100km] to [km/l]?</p><p>Many thanks for reply!</p>
<p>Thank you very much!</p><p>Look at your inbox. I 've sent you a message with the changes you have to make.</p>
<p>Very cool what you did. I also have a 1997 blazer and she has a problem with the fuel marker. Would it be possible to make an application similar to this one on her panel in order to be able to dial? Would? What would it take? thanks</p>
<p>Here is a video that might help: https://www.youtube.com/watch?v=VAj-zeQGZec</p><p>The fuel level sender is on the swingarm on the side. It wipes a resistive panel that wears away and is likely why your gauge reads wrong... which is how I interpreted your troubles. Simply (not actually so simple) pulling it and playing with the sensor will confirm (or not) that it is the sender.</p>
<p><a href="https://www.instructables.com/member/SandraN30" rel="nofollow">S</a>andraN30...probably the fuel level sender attached to the fuel pump in the tank. They are replaceable. You can replace the sender only or the sender and fuel pump assembly. It is a pretty easy repair. Maybe you can get parts from a car junkyard.</p>
Ok, thanks congratulations
<p>I completely agree with NKemp. Find a used gauge or fuel gauge sensor. This must be an easy fix. See here:</p><p><a href="http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.X1997+blazer+fuel+gauge.TRS0&_nkw=1997+blazer+fuel+gauge&_sacat=0" rel="nofollow">http://www.ebay.com/sch/i.html?_from=R40&amp;_trksid=p2050601.m570.l1313.TR0.TRC0.H0.X1997+blazer+fuel+gauge.TRS0&amp;_nkw=1997+blazer+fuel+gauge&amp;_sacat=0</a></p>
<p>Thank you!</p><p>Everything is possible, but unfortunately this is another project!</p><p>It is better to consult a professional!</p>
<p>Okay, thank you for the feedback, but unfortunately we Brazilians do not have professionals trained for these DY and we can not pay, this is our reality, everything here is very expensive and what we earn from salary can not afford.</p>
<p>Amazing! Great attention to details and really instructional, will try harder to replicate it, thanks for the instructable!</p>
<p>Thank you very much for your kind words!</p>
<p>What are the dimensions of the OLED &quot;glass&quot;? </p><p>So often they quote the board dimensions or don't tell you what the dimensions are of (board or glass/display). My cutout is 1<br>3/4&quot; x 1 1/4&quot; and that is the size (or a bit larger) that would work.</p>
<p>I had the same problem. At the following link you can find the info you need:</p><p><a href="http://elecfreaks.com/estore/download/EF03155-Datasheet/UG-2864HSWEG01%20Drawing%20-%20090120B.pdf" rel="nofollow">http://elecfreaks.com/estore/download/EF03155-Datasheet/UG-2864HSWEG01%20Drawing%20-%20090120B.pdf</a></p>
<p>Hi Nikos, great idea and good job, currently i am using LPG on my Vehicle ,I will also try this.</p>
<p>Thank you! I will be glad if you 'll make it and see your work! </p>
<p>Nice Instructable. This is what I needed when I used to do propane conversion years ago and got away from it when fuel injection became the norm. Can you share info on the propane injection system also? </p>
<p>Thank you very much! I think that propane or LPG (propane/butane mixture) injection systems are the same. So, you can use what you will find in my instructable. I do not know if there is some difference concerning the injectors driving signals... You can write me a link with your system and I will give you a more confident answer.</p>
I do not have a propane injection system at this time. I am interested on adding one to a vehicle and was interested in the manufacturer and model of the system you are using. I have used and installed the carburetor mixer systems before.
<p>Well, my system is not widely used and I am not so happy with the settings and the options that it has. But I can suggest you another one: KME nevo, that a friend has on his car, from which I have also measured the signal that drives the injector and they are similar with the signals that my system produces. The code will work &quot;out of the box&quot; with any system with low impedance injectors (below 3 Ohms), which the majority (if not all) of the LPG systems on the market have.</p>
&Pi;&alpha;&nu;&epsilon;&pi;&iota;&sigma;&tau;&eta;&mu;&omega;&nu;. &Tau;&iota; &nu;&alpha; &lambda;&epsilon;&mu;&epsilon; &tau;&omega;&rho;&alpha;
<p>Very useful instructable, i voted for you.</p>
<p>Thank you very much for your support!</p>
<p>Amazing idea! I'm going to try to understand how much easy is to find the wires in my car!</p><p>(PS one video is private.. is it a bug?)</p>
<p>Thank you very much for your comment and your remark!</p><p>Now the videos and the links must be ok. Please inform me if there is any of them that does not work.</p>
<p>I have just started adventuring down this road of building a car computer with version 1 up and running. Your instructable is an inspiration - as I still have a long way to go and a lot to do.</p>
<p>Thank you! I am looking forward to see your project or that you hit the &quot;I made it!&quot; button!!! It's not difficult. The result will reward you!!!</p>
It is currently a bit Mikey Mouse. I was putting together a HiFi system to play my music from my PC via WIFI &amp; NFS, and a Raspberry Pi 3 with HiFiBerry through my Stereo-Receiver. I thought, hey I could put it in my car less my PC, WiFi &amp; NFS. and HiFiBerry. A two hour hack (I had to fix the lighter plug fuse, get ride of the video off the audio plug, move my music to a thumb drive and a clever use of &quot;ln -s&quot; so to the software the music is in the same place on all three machines (PC, Stereo Pi and the Car Pi)) and it is up and running and I can use rsync and NFS from the car at home to keep the music and play lists current, Well now I have an entertainment system in my car how about GPS and Open Street Maps (Adafruit has something it does yet work this the PI 3 no problem use my PI 2 B - put on a high gain WiFi antenna cool so I can keep my mail updated on the road) and why not capture, collect, manipulate and display car stats from the OBD. Everything you were doing is not so Mikey Mouse, most of the stuff I am doing is trivial by comparison as it is like plug and play but still a whole lot of fun. So far I haven't had to program anything though I might have to when it comes to the OBD (and I might hack a Python music project as I stumbled across some bugs) - I have been supporting Open Street Maps for years so I feel very confident that I will not have much trouble implementing it. Now, how about 3 Pi 0 W plus IR cameras to record the ride? Oh, a picture of my Pi currently sitting face down in the passenger seat would be a bit boring - I am thinking of a cool off the shelf mount though.
<p>Thank you !!! This project has pieces that I've not been able to find for a project I am pondering:</p><p>- The 12Vdc circuitry into Arduino</p><p>- Monitoring the injector and measuring its open time</p><p>I have a pre-OBD car that I'd like to monitor. It uses a &quot;frequency valve&quot; and its &quot;frequency&quot; can help define how the engine is performing. the frequency valve is simply an injector. So I'm thinking that just your petrol (gasoline) code will work to monitor the frequency valve. </p><p>Nice job.</p>
<p>Thank you very much! I am very glad that you find it helpful for your project!</p>
<p>Cool design, Clean performance. BraVo. I wanted to do 3.5 in color: D I wanted it without menu. https://www.youtube.com/watch?v=xu0rGxcluy8 Now I'm working on 32bit and SPI display. Because large displays are to slow: D</p>
<p>Thank you very much. I used this display mainly because it fits well and it looks like an original product. (I thing you have seen my first attempt, how &quot;nice&quot; it was!!!) I saw yours. The display looks great (a little slow indeed). I would like mine to be bigger, but I had to buy a 3D printer in order to make clean installation. But this would affect the total cost. And an instructable must be, in my opinion, something that anyone could build, without any special and expensive tools.</p><p>Anyway! You are doing great job, too. I will follow your progress!</p>
<p>I have only one problem. I count the fuel in liters but it differs from the avg fuell consumption by 20%. When to take over 100km and have 10l/100km i should have 10liters use. But i Have ~8l. I do not know if the problem does not inertia injection valve. Today I bought a smaller display 2.8 but with a touch. And I love 32 bit processors :D Mega Speed --&gt;&gt;</p>
<p>Check your system and be sure that travelled distance is correct (not the speed) and total litres consumed (nothing else). If these two values are correct then you have to check your code. If not, check connections carefully and then calibrate it again with the procedure I describe. </p>
<p>What a great Instructable.</p>
<p>Thank you very much larrymunney! I am very happy that you find it great. This is my first instructable and it took me around a month to complete it.</p>
<p>That's a serious project there mate. Nothing like the others I've seen.</p>
<p>Thank you xtoutou!</p>
<p>That's a neat setup :)</p>
<p>Thank you very much!</p>

About This Instructable

28,193views

258favorites

License:

Bio: I work as a physicist (physics teacher) in a small high school in Greece. Ever since I can remember myself, my main passion was - and ... More »
More by Nikos Stavrou:How to Build a Bi-Fuel (LPG & Unleaded) Trip Computer Using Arduino 
Add instructable to: