Greetings everyone,
This is my first post on the Arduino Forum, so be gentle with me.
I am at the planning stage of a project that, when complete, will quantitatively display various things on a 1970 Cadillac Eldorado. For those of you not familiar with the Eldorado, which I expect to be most people, the instrument cluster on the dash consists of a fuel gauge and speedometer. That's it. If you are lucky, an idiot light will come on if your oil is low or the engine is on fire. And although there are aftermarket gauge clusters that you can bolt on your dashboard, hood or anywhere else, I wouldn't learn anything by simply bolting on an aftermarket part. Plus, they never look good.
To begin with, I'm sticking with the basic oil pressure, temperature and battery voltage. Of course, modern sensors are readily available for oil pressure and temperature. And reading the battery voltage is...reading the battery voltage. So generating analog values is not an issue. The original, stock "sensors" aren't sensors at all but simple switches that close at some threshold to tell you that you are about to turn your engine into a very large paper weight.
Then there are, of course, different types of modern sensors. Those that put out a variable voltage based on what is going on and those that change resistance based on what is going on. I have the latter figured out. What I haven't [satisfactorily] figured out is the route to take for the sensors that output a voltage range. Not because I haven't found a route, but because I have found several. And I'm having a difficult time deciding which will actually do what I want and as simply as possible.
For the moment, let's forget about what/how I'm going to use the end data and simply focus on not burning up the Arduino. I need to take a voltage range from 0 -14V+ (I've been told it can peak as high as 18V) and linearly scale it down to 0 - 5V. From there, I can use the Arduino's A/D converter to neatly turn the 0 - 5V into values of 0 - 1,023. And then, from there, I can worry about the next leg of my journey.
At it's most basic, I want to reduce fluctuating automotive voltage levels to TTL logic levels. I could build a simple voltage divider that results in my highest voltage being 5V. But that won't be very robust as spikes/peaks aren't common or expected sensor values. So I'm going to need to work a bit harder than that. "Normal" battery voltage levels in an automobile are typically between 13 and 14V. And even that goes up and down as various things occur within the electrical system. So I am likely going to have to average out sensor values over some period of time or filter out fluctuations beyond some threshold.
It's also probably worth mentioning that although I have played with controlling stepper motors with the Arduino and written a sketch or two, I'm certainly not an electronics engineer. In fact, that's part of the point of this exercise. It gives me a concrete project with a set of process control problems to solve. Although I won't actually be controlling anything, only measuring it (at least for now).
So, with all of the above in mind, how would those of you in-the-know approach this problem? How do I regulate the automotive voltage fluctuations without errantly regulating sensor values? Of course, car companies have already figured this out. However, as of yet, I have not.
Also, keep in mind that this is not a real-time, mission-critical application. Engine temp doesn't spike in two seconds. If it takes 1000ms to adequately filter and process an input, so be it. In fact, that's preferable to seeing an indicator bouncing all over the place (which is exactly what they did in my 1952 Buick). The thing that averaged my Buick's values out was your brain. That is, if you didn't have a seizure from watching the instruments.
Thanks for your time,
Brandon