Hi Oldbeaver, I can't answer your question about the fuel sensor, but perhaps I can help with advice about posting an image. The image needs to be uploaded to a public hosting site like flickr – the link to the image is put in those tags
In your case, you need to join your GNDs (the body of the car or tank, probably, unless the sender has a ground wire) to the ground on the Arduino. Then your 5v input should vary depending on the resistance of the fuel level sender.
My guess is that it is a little more complicated because the tank level resistor is most likely already connected to the 12 V system of the car.
I'd probably disconnect it from the gauge in the instrument panel. I have set this same thing up for a ski boat, but it was brand new and there were no gauges to disconnect.
On the loom, each sender had a 12V and Gnd wire, plus the wire for the resistive sender itself. We ignored the 12V because it's simply there to power the gauge. In a car, it may be slightly different but there's definitely a wire for each instrument where you can measure resistance across ground and no voltage exists (meaning they're not varying 12V depending on the resistance of the sender, it's done at the gauge). So, we just connected the grounds ..and then hooked up the resistive wire to an analog input pin on the Arduino as per that diagram with a fixed resistor and wollah.
In my last post, I said put it in the same place as the Photoresistor. Technically speaking, I had them the other way around. I put 5V through the fixed resistor and used the Sender's resistance to "balance" the divider on the other side. This way I didn't have to try and push 5V all the way to the sender and back (or at least that's how I justified it).
I'm doing the exact same thing.
The fixed resistance should be a value equal to 1/2 the sensors full resistance, right?
Sounds logical, but I'm no electronics guru. You can breadboard this using your fixed resistor and another couple of resistors (or a pot) to test your theory out, then you can be sure of the result. Care to prove the theory/clarify and post the results here?
Sounds logical, but I'm no electronics guru. You can breadboard this using your fixed resistor and another couple of resistors (or a pot) to test your theory out, then you can be sure of the result. Care to prove the theory/clarify and post the results here?
Sure, Im just now trying to figure the resistive sensors out - I have got the speed sensor working.
whatever it takes to get a 0-5vdc linear signal at the input, I guess. That is why I guessed 1/2 the sensor
The fact is that the fuel tank resistor is already connected to a 12V supply (13.8 when engine is running).
How can I deal with that?
I also have the additional problem: Arduino is supposed to work with 9V. However, when I power it from the car battery, it becomes very hot (the IC), and I have to unplug it. The battery provides about 12V when the engine isn´t running, and about 13.8 V with the engine running.
I think the overvoltage may be causing the heating.
Does anybody know how to handle these kind of problems?
Arduino should come with a way to change among several voltages in the power supply.
I havent yet, my arduino is sitting here on the table beside me, I have yet to actually put it in the car.
A resistor would cut the voltage down though
The fact is that the fuel tank resistor is already connected to a 12V supply (13.8 when engine is running).
Get that photo uploaded to Flickr/Photobucket etc so we can have a look.
However, when I power it from the car battery, it becomes very hot (the IC), and I have to unplug it.
I agree, heat is a very bad sign. Do you have it connected to USB and the battery simultaneously? I had this issue when I had both connected.
Which Arduino do you have? I thought they had a maximum input voltage of about 20V. I have used both Duemilanove and Nano, both were rated up to 20V. I've just double checked and it states "Input Voltage (limits) 6-20 V". Doesn't explain the heat!
Easiest method in my opinion would be a voltage regulator IC. It's extremely simply to set up and you will also have the benefit of a regulated power supply to the Arduino rather than a noisy signal from the car, which will fluctuate under load (air conditioner, sub woofers etc).
I'm choosing a 9V regulator because it's right between 7V and 12V, as defined for the Arduino (http://www.arduino.cc/en/Main/ArduinoBoardNano) but more importantly, to get 9V you only need at least 11.5V input as opposed to trying to get 12V regulated, you need at least 14.5V. You'll also be better off getting an IC which can handle more Amps and only running up to say 50% of that, to allow for manufacturing anomalies and also in layman's terms it means you probably won't need to worry about a heatsink.
With the 7809, you'll also need a 0.33uF and 0.1uF capacitor. Check the data sheet, page 4 to see how to wire it up.
The arduino has an LM7805 voltage regulator (it's the IC) and so you can power it with anything from 7 to about 35v. At anything 12 or up you'll be generating a lot of heat on that regulator. The solution is to bolt a heat sink to the regulator or otherwise screw the regulator to the chassis of the car so that there is more surface area to dissipate the heat.
You have 12V being supplied to the gauge directly from the battery via the ignition . Your fuel level sender is grounded and has 1 wire running to the gauge which is the resistor. You need to take the wire from the gauge and use it as one side of your "variable resistor". You use the car's ground circuit (aka the body of the car) as the other end of your "variable resistor".
Question is, do you want to leave the original gauge connected? If you do, I'd tap into the resistive wire when the ignition is on and see if you can measure a positive voltage or not. If you can't, you can safely use it as I describe above. If not, meaning there's power on that line from the gauge, you'll need to devise a plan using magical dragons to make them both work without frying your Arduino. I'll be very surprised if the gauge is sending positive voltage down there...
And by magical dragons, I mean the guys here on the forum like MikalHart, MikMo or RetroLefty who really know there stuff!
One thought I have is disconnecting the resistive wire and then using a digital potentiometer to simulate the resistance you see from the real sender.
The solution is to bolt a heat sink to the regulator or otherwise screw the regulator to the chassis of the car so that there is more surface area to dissipate the heat.
Good thinking. OldBeaver hasn't yet specified which Arduino he has, but neither of mine would be easy to mount a heatsink onto. The 7805 on the bottom of the Nano is an SMD IC. You'll have the same heat issue with another IC, but at least it's off-board and easier to deal with (one assumes!)
Was this a resistive sensor? When I did this, I was getting +6VDC pulses, so I just counted the rising edge. I did a quarter second sample each loop and averaged the sample over a few loops to get a nice smooth output. You?
[edit]Whoops, I read that and thought you were referring to the tacho. Nevermind![/edit]
@OldBeaver: Is this a "new" car? As in, the last 10-15 years? Because you can get all of this data and more from the OBD or OBDII port. If it is, I'd suggest you research the OBDuino.
The car is a 1989 Mercedes Benz (about 20 years old), to which I adapted a japanese 6 Cyl diesel engine with a japanese automatic transmission. I have to change the differential, though.
The engine is 2800 cc aspirated. It is running very well now, with a yield between 15 to 17 km/lt at a speed of 110 km/h on the road.
Now, I want to test a HHO generator I made, to see if it really increases fuel yield. (It takes energy to electrolize water).
That is why I want to set up a "real time" monitor, to switch the HHO generator on and of and see the truth.
I'll tell you this much. It takes more energy to split water than you get from burning it. It's just physics. So, it depends on whether you are doing electrolysis onboard or ahead of time and compressing the hydrogen. Either way it's very unlikely that you'll see favorable results. This is actually an area I have done a lot of research on. You are really better just going with either hybrid electric/fuel or straight electric.
Oh, and a shameless plug. If you need parts for your 1989 Mercedes please try www.kkmfg.com