Ma project, Arduino in my car (speedo, rpm, showing messages on LCD)

Hi

I hope this is the right forum… also please, my english is not sooo good, greetings from germany!

I bought the Arduino Uno once, for playing with floppy drives :wink:

Now I connected it to a 16x2 LCD, this works, using the predefined script and played with it.
Actually it is only a playing with it, doing some stupid things, possible the result will be a nice gimmick in my car.
What I want to do ist, to build the Arduino with the LCD in my car’s dashboard and sow some informations, displaying short messages by using counter and input lines.

but, i am a c64 kid … have no idea of this programming language and i run to the wall by trying changing / writing the script.

So I hope, you please can help me …

My plan:
When ignition switch turns to the first position (“Radio/Stereo”) or more nice by unlock central door, the Arduino gets power and boots and displaying a “welcome message”

  • here I need no input line, just boot up and display, then waiting for input -

When switching to “ignition position” I want to display first a message for x seconds, then continue some things like,

Countdown (i found out to rewrite the counter, but at zero I need a IF line, and have not idea how to stop the counter getting in negative / large numbers)
Info: “Alternator!” (after motor runs, display message “Alt. ok” (in German “LiMa OK!”) (getting here a signal with an IR receifer LED)
Info: “Handbrake” , “R-gear”, “Water” and a lot other things with different priority
As I wrote, just actualy only playing, when finish, some really better ideas for displaying messages.

And, speedo and rpm.

So this is my code I rewrote:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.setCursor(0, 0);
  lcd.print(" RENAULT MEGANE");
  lcd.setCursor(0, 1);
  lcd.print("System bereit");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(14, 1);
  // print the number of seconds since reset:
  lcd.print(60-(millis()/1000));
}

As you can see, I did not really come forward. Only message and counter.

I also searched the web for speedo and rpm displaying, but each script only display one of these things, I need a point where I can adjust the speedy and rpm if neccesary (when in the car, using USB cable to laptop, sending new listing into the Arduino)

I was not able to get these scripts together

a huge project sure…

Is it still possible what I want to do, as the memory is not very large, can the Arduino handle all these options?

Back to my script in (code)
The counter works, counting from 60 to … negative number.
How can I make a IF loop to get at “zero” to stop it, doing an action (output or displaying other message)?
I cant get the lcd.print to get IF=0 or IF<1 then set a THEN or ELSE …

Here I need a complete getting knowledge of all these things ;(

thanks in advance, hope my english is not tooo bad :wink:

When switching to "ignition position"

How is the Arduino supposed to know that this has happened?

I want to display first a message for x seconds

You can't. You could display a message for 5 seconds or 10 seconds or 60 seconds, or two years. x is undefined, though.

A boolean variable can be used to determine if it is necessary to display the message. Set the boolean to true, initially, and set it to false when the required time has elapsed.

(i found out to rewrite the counter, but at zero I need a IF line, and have not idea how to stop the counter getting in negative / large numbers)

If you can't use a simple if statement, or can't find the reference page where the if statement is documented, then, I'm afraid this project is beyond your capabilities at this time.

Signing up for a C programming class would do you worlds of good.

The hardest part of this project is going to be getting the data that you want to display. Getting RPM and speed are non-trivial tasks. How to go about it depends on what kind of car you have, and how old it is.

Determining whether the alternator is functioning properly isn't that difficult, but be aware that cars are electrically noisy and the voltage is not compatible with the 5V Arduino, without some effort.

Determining what gear you are in is going to be particularly challenging.

Determining if the parking brake is set may, or may not, be easy. It depends on whether you can mount a limit switch in such a way that it reliably knows whether the brake is set.

Getting the LCD to behave in the car should be your first activity. It will not be easy.

PaulS:

When switching to "ignition position"

How is the Arduino supposed to know that this has happened?

Oh dear, you're at it again. But frankly, I find it entertaining. :smiley:

PaulS:

I want to display first a message for x seconds

You can't. You could display a message for 5 seconds or 10 seconds or 60 seconds, or two years. x is undefined, though.

Drôle.

PaulS:

(i found out to rewrite the counter, but at zero I need a IF line, and have not idea how to stop the counter getting in negative / large numbers)

If you can't use a simple if statement, or can't find the reference page where the if statement is documented, then, I'm afraid this project is beyond your capabilities at this time.

Signing up for a C programming class would do you worlds of good.

Likewise.

PaulS:
Determining what gear you are in is going to be particularly challenging.

True enough, but if you have the speedo and tacho information, some averaging should do it.

PaulS:
Determining if the parking brake is set may, or may not, be easy. It depends on whether you can mount a limit switch in such a way that it reliably knows whether the brake is set.

All of my cars already have this switch. Doesn't yours?

It is true that he will need interference suppression and voltage limiting/ surge suppression on all interfaces, and - even harder - to locate them in the wiring loom without the top secret knowledge that car manufacturers do not wish to divulge under any circumstances.

You can detect ignition by using a digital input and a voltage divider. I'm using this one http://store.mp3car.com/4_Channel_Input_Isolator_and_Voltage_Divider_p/com-118.htm

You can create your own though with some basic circuitry.

It is true that he will need interference suppression and voltage limiting/ surge suppression on all interfaces, and - even harder - to locate them in the wiring loom without the top secret knowledge that car manufacturers do not wish to divulge under any circumstances.

What's even more important (and can't say this enough): Don't mess with the original wiring, unless you know what you are doing, or have a death wish.

Really, the previous line is no joke. Don't tap of lines of primary systems in your car. Even if the voltage is low, these wires are designed to be like that. Using stuff like scotch locks will weaken the car's wires. If a fire occurs because of that your insurance may not pay. Modern cars have on board computers that cost thousands of dollars to replace if you short them. On older cars, the electrics are raw and spiky making -50v no exception.

If you know what you are doing, use proper soldering, or automotive grade connectors. And document the wiring modifications and keep a copy of the modifications in your car.

My two cents

All of my cars already have this switch. Doesn't yours?

No, my trike doesn't. I have to actually look at the parking brake lever.

Tapping into the existing wiring to monitor the parking brake switch requires care. The voltage is not going to be compatible with the Arduino without some extra components.

RobvdVeer:
My two cents

But - you didn't even mention the yellow wires!

But - you didn't even mention the yellow wires!

Because when you cut them, power to the clock stops, but not power to the display. Any movie producer knows that.

Thanks for replying, my only problem is the software part, but thank you for the hints :wink:

On hardwiring and the other parts, this is my smalest problem, "just a piece of cake" as you say (i think)

so, there is the bulb of the alternator, set an IR receiver LED next to it, will give me a signal. No direct wiring to the very hot lines.
Handbrake, brakes, and so on, there are all switches, i can isolate with optocopplers for example.
There will not be a big changing of the wiring in the car.
Picking up some signals ... that's it.
To support the arduino it's power is also no big deal.

The "ignition position" is also easy. But these are things, the come when the Arduino/LCD is running.
It has 6 analog inputs, and I have 4 digital (pin 6,7,8,9) free.
If it will be not easy to use the digital inputs, that doesn't matter, as I have 6 analog inputs.
Checking for the input "x" for "low" would be an activity the arduino has to pay attention :slight_smile:
(setting the inputs with pullups to "high" and an "low" signal will let the arduino know "hou, i got a job to do" :wink:

Rights, the rpm can also be taken from the clocks, to make sure no 'sparks' or other bad voltages reach the Arduino, it will be safest way to usw optocoppler. Then to an input of the arduino.
(RPM should be easy, 4 cyls, 4 ticks per revolution, divide them by 4, calculate by time, have the rpm/m)
same with the speedo clock. The car has an electronic (hall) signal (as RPM, but possible it needs to also check the time between pulses? I read of this once... needs to have a variable divider for tuning it to the right - a working script can be a foundation, but as I wrote, i have no clue how to assample these all parts together)

The car is actualy a Renault Megane 1997 MK1 (green like frogger :wink: ) but please - no tooooo bad jokes hehe
It is my "bad weather and transport" car. (my other really loved cars are classics) so I have this car now and want to do some stupid things :smiley:

I have the hardware here, but must tell them what to do for me :wink:

Sure other will find - when once finished - this also usefull and can use it.

You are right, when writing it is better to go to a C language lessons ... But I like to have an entry to this, if this wakes enough interest and motivation in me, and my small time gives me the chance, it is sure possible, to learn more.
But I am not a "sitting days by day there and read to much" - I learn by doing, experimenting with things.
I have my better skills on other things :wink:

I don't want someone to cook his brain for me and deliver me a ready listing, I just want to get some helpfull pieces, play around with them, and try to get my project running.

But - that's why I am here ... getting help

Danke - für nichts. Wie man sieht, viele Experten, aber keiner hat Ahnung oder ist fähig, Wissen zu vermitteln.
Wozu existiert dann dieses Forum? Könnte man es auch abschalten.
Eben wie immer sind sich die selbsternannten Götter zu fein, denen zu helfen, die Wissen erlangen wollen.
Man könnte ihnen ja zu nahe kommen. Typische Krankheit im Open Source Bereich.
Große reden, aber dann nicht in der Lage, ihr angebliches Wissen weiterzugeben.
Das ist echt armselig, aber es reicht nicht um hier Mitleid für Eure Allüren zu erwecken.
Wir jedenfalls werden unsere Unterstützungen in Open Source Projekte von nun an vollständig einstellen. Das Maß ist nun endgültig voll.

Und wer von Euch das nicht lesen kann, tja lerne deutsch! Wir sollen Euch auch verstehen, ihr hochnäsigen Evolutionskrüppel.

Are you ok?

In case anyone thought that this:

there_are_only_loser_in_this_forum:
Danke - für nichts. Wie man sieht, viele Experten, aber keiner hat Ahnung oder ist fähig, Wissen zu vermitteln.
Wozu existiert dann dieses Forum? Könnte man es auch abschalten.
Eben wie immer sind sich die selbsternannten Götter zu fein, denen zu helfen, die Wissen erlangen wollen.
Man könnte ihnen ja zu nahe kommen. Typische Krankheit im Open Source Bereich.
Große reden, aber dann nicht in der Lage, ihr angebliches Wissen weiterzugeben.
Das ist echt armselig, aber es reicht nicht um hier Mitleid für Eure Allüren zu erwecken.
Wir jedenfalls werden unsere Unterstützungen in Open Source Projekte von nun an vollständig einstellen. Das Maß ist nun endgültig voll.

Und wer von Euch das nicht lesen kann, tja lerne deutsch! Wir sollen Euch auch verstehen, ihr hochnäsigen Evolutionskrüppel.

was a translation of that immediately preceding it --

[quote author=translation of previous outgassing]
Thanks - for nothing. As you can see, many experts, but no one has idea or is able to impart knowledge.
Why then does this forum? You could also turn it off.
Just like always, the self-proclaimed gods are too fine to help those who want to gain knowledge.
You might get too close to them, yes. Typical disease in Open Source development.
Big talk, but then not be able to pass on, their alleged knowledge.
This is really pathetic, but it's not enough here to awaken compassion for your graces.
Anyway, we will adjust our complete support in open source projects from now on. The measure is now finally completed.

And who of you that can not read, well learn German! We should also understand you, you arrogant evolution cripple.[/quote]

What a schmuck. The conversation is finally starting to get somewhere now that some details of the test environment are made available, and you come out what that, there_are_only_loser_?
Consider yourself banned.

Danke - für nichts. Wie man sieht, viele Experten, aber keiner hat Ahnung oder ist fähig, Wissen zu vermitteln.

Ah, another forum meltdown.

Too bad. I was quite interested in this project. I'd kick him too with that attitude.