ASK AN ENGINEER is LIVE now! Click here to watch our weekly show with Ladyada!
0

Automotive application Using Boarduino
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

by BigMike on Mon Mar 10, 2008 12:13 pm

You can measure the distance travelled by attaching a magnet (s) to the stub axle and use a hall effect sensor to to count the revolutions of the wheel. If you keep track of time you can calculate the speed.

If you want to try a whack idea, you could use optical mouse technology - that way you#d actually be measuring distance travelled directly rather than indirectly.

Mike
BigMike
 
Posts: 7
Joined: Fri Mar 07, 2008 12:25 pm

by Frank843 on Mon Mar 10, 2008 2:08 pm

BigMike - thanks for your feedback. I was rolling over laughing when I read your whacked-out idea about using an optical mouse... ;-)
- What is the stub axle?

dcmk1mr2 - thanks for your feedback too. I think you have the same problem I have, a pre-OBDII car. Unfortunately, the links you provided took advantage of the OBDII data.

The main obstacles seem to be:
1) automotive power - granted, its 12V but need some filtering
2) having power to store data to EEPROM, after the ignition is off
3) speed sensor - I can either attach a Hall Effect Sensor or an Optical Sensor to either the existing speedo cable in the dash or to the rotor. Also, how do you keep the sensor attached to car tire wheel and not restrict its ability to turn or fall off when you hit a bump in the road.
4) output - an LCD may not be fast enough and may not be visible in sunlight, but a 7 segment LED is very limiting (can't display speed and odometer readings)
5) how to calibrate the sensor revolutions to MPH. I have an approach but still need to test it.

I think I have some idea of how to approach 1 but #2 and #3 are still "up in the air". I haven't decided what to do about #4.
Frank843
 
Posts: 29
Joined: Sun Feb 24, 2008 12:34 am

by dcmk1mr2 on Wed Mar 12, 2008 5:18 pm

Frank843

Don't think the obstacles are that bad:

1) Automotive Power - the power supplies shown in the schematics for the Mega Squirt and the MPG gauge are similar; they use an MOV transient/surge suppressor to knock off the big chunks and use capacitors and a three legged regulator.

2) Power to buy time to store data - the size of the capacitor at the regulator output and current used by your circuit set runtime. There were some other good ideas in previous posts for different ways to deal with this. You could generate an interrupt when input voltage drops below say 8-11V, and write your data to EEPROM. If you run out of juice before you're done, make the cap larger.

3) Speed sensor. You might want to investigate to see if you have a speed sensor before you add one to your car. (Yes, you mentioned that you have a mechanical speedometer). If you have an O2 sensor, you probably have EFI and an EFI computer. One of the EFI computers input is typically a speed sensor. It is probably a hall effect device that threads into the transaxle and gets 5V from the EFI computer. Its really a distance sensor as it produces pulses in proportion to wheeel rotations. Optical sensors are avoided as they get dirty in a car quickly.

4) Output - Vacuum Fluorescent Displays (VFD) work well. I thought the re purposed boost gauge was a nice touch and is fast and very visible in bright light. It was driven by an AVR PWM channel.

5) How to calibrate - Look for "measured miles" on local roadways. Count the number of speed sensor output pulses in the mile. You could also go bike computer style and measure wheel diameter...

I don't think lack of OBDII will be a problem figuring mileage (fuel economy). You can estimate fuel use by multiplying fuel injector on time by injector flow rate. (Flow rate is specified by the type of injector). There are current limiting resistors for each injector, so when each injector is pulsed, there will be a voltage on the resistor, making it easy to measure the on time. I thought the trip based measurements (cost/trip, fuel used/trip,...) on the Scangauge was a great idea.

dcmk1mr2
 
Posts: 3
Joined: Thu Jan 04, 2007 9:09 am

by BigMike on Thu Mar 13, 2008 7:56 am

Frank843 wrote:BigMike - thanks for your feedback. I was rolling over laughing when I read your whacked-out idea about using an optical mouse... ;-)


Hehe - i wasn't meaning an actual mouse, just the way the optical mouse works. Roughly speaking, an optical mouse "takes a picture" of the surface it is on, then takes another picture a short time later. It then comparse the two pictures and can work out how far the mouse has travelled in each direction by matching artifacts in each image.

If you had a camera pointing at the road taking pictures a short time apart you could do the same sort of computation to determine the distance and the the speed.

Check here for a bettter write-up:

Clickity click

I know its still not a completely practical suggestion, but not completely ridiculous either :D

- What is the stub axle?


I just meant the axle that is attached to the road wheel that turns as the wheel turns.

4 magnets ty-wrapped onto the axle will give 4 pulse per revolution of the wheel.

Another thought - if you have anti-lock brakes, there is likely to be a sensor and a toothed disk with a few hundred tooths. If you tap into that or place a sensor near the disk you could get a few hundred pulses per rev.

The picture of the motor bike wheel on this wiki page:

http://en.wikipedia.org/wiki/Anti-lock_braking_system

shows what I mean.

Regards,

Mike
Last edited by BigMike on Thu Mar 13, 2008 12:22 pm, edited 2 times in total.
BigMike
 
Posts: 7
Joined: Fri Mar 07, 2008 12:25 pm

by darus67 on Thu Mar 13, 2008 9:50 am

BigMike wrote:
I know its still not a completely practical suggestion, but not completely ridiculous either :D


Except most optical mice don't drive through rain and mud and snow and
oil and whatever other road grime :D
"He's just this guy. You know?"
darus67
 
Posts: 246
Joined: Wed Sep 26, 2007 10:25 pm
Location: Minnesota, USA

Automotive application Using Boarduino

by Frank843 on Thu Mar 13, 2008 12:18 pm

dcmk1mr2 - thanks for you input, really appreciate it

Don't think the obstacles are that bad:


I tend to agree but please see my comments below:

1) Automotive Power - the power supplies shown in the schematics for the Mega Squirt and the MPG gauge are similar; they use an MOV transient/surge suppressor to knock off the big chunks and use capacitors and a three legged regulator.


I thought the link to Mega Squirt had some very good information, especially with respect to the use of a voltage regulator.


2) Power to buy time to store data - the size of the capacitor at the regulator output and current used by your circuit set runtime. There were some other good ideas in previous posts for different ways to deal with this. You could generate an interrupt when input voltage drops below say 8-11V, and write your data to EEPROM. If you run out of juice before you're done, make the cap larger.


This particular item is not clear to me. For example, if I had a voltage regulator (say 7805), I would have 12V(+-5V) coming in, a capacitor (C1), the Vin of the Regulator, Ground, Vout of the Regulator, another capacitor (C2) and 5V being delivered to the AVR.

Of course I have simplified the scenario since I don't know how to upload a JPG.

In one of my earlier postings I stated that there needed to be two sources of power:
1) the primary power source (which is where I would put a capacitor to discharge after the ignition is turned off)
2) the power source that the interrupt would check to signal the AVR to save to EEPROM

I am assuming that your suggestion to monitor the 8V-11V would be on the #2 power source and tied to an AVR pin. Can a PIN handle such "dirty" voltage? I thought the whole idea was to use a voltage regulator to insulate the AVR.

So, in a sense, I need two clean sources of power.

Now, I could check the voltage on the Vout pin of the 7805, but it would mean tying 5v of "dirty" voltage to a pin(doesn't seem to be a very good solution)

I guess my concern is in protecting the AVR from both sources of power.
Is that necessary?

3) Speed sensor. You might want to investigate to see if you have a speed sensor before you add one to your car. (Yes, you mentioned that you have a mechanical speedometer). If you have an O2 sensor, you probably have EFI and an EFI computer. One of the EFI computers input is typically a speed sensor. It is probably a hall effect device that threads into the transaxle and gets 5V from the EFI computer. Its really a distance sensor as it produces pulses in proportion to wheeel rotations. Optical sensors are avoided as they get dirty in a car quickly.


I have an O2 sensor and the car does have electronic fuel injection, so this might work. Need to check....

If it does, how do you decode the sensor data. Without a spec sheet, that might be pretty tough. I think this is worth investigating.

In my investigation on the Internet, I have found instances of individuals using magnets on driveshafts (rear wheel drive), magnets epoxied to rotors (disc brakes, okay, may work), and other encoders on robots.

I have a speedo cable coming up from the firewall into the dash, so my original direction was to try to put either a hall effect sensor or an optical sensor on that cable. Unfortunately, because of amount of space available, this has not worked out so far.

4) Output - Vacuum Fluorescent Displays (VFD) work well. I thought the re purposed boost gauge was a nice touch and is fast and very visible in bright light. It was driven by an AVR PWM channel.


I'm not familiar with VFD's, can they be easily interfaced to an AVR? I looked on the web and didn't find any references. It seems that everyone is using LEDS or LCDs. If you have a link, I would surely appreciate it.

5) How to calibrate - Look for "measured miles" on local roadways. Count the number of speed sensor output pulses in the mile. You could also go bike computer style and measure wheel diameter...


Yes, I agree...

For the "measured miles" approach, I was going to try to put in a switch to put the circuitry into calibration mode. My thought was that by allowing the speedo to count the revolutions, it would minimize errors. Of course, that count would be written to an EEPROM and then recalled in the software for the ongoing calculation.

I don't know if this is a feasible approach, but anyone has any input, I'd surely appreciate it.

I don't think lack of OBDII will be a problem figuring mileage (fuel economy). You can estimate fuel use by multiplying fuel injector on time by injector flow rate. (Flow rate is specified by the type of injector). There are current limiting resistors for each injector, so when each injector is pulsed, there will be a voltage on the resistor, making it easy to measure the on time. I thought the trip based measurements (cost/trip, fuel used/trip,...) on the Scangauge was a great idea.


For now, I am focused on getting the speed, mileage(odometer), and perhaps trip mileage. The other stuff is gravy.

Thanks for you input.
Frank843
 
Posts: 29
Joined: Sun Feb 24, 2008 12:34 am

by BigMike on Thu Mar 13, 2008 12:24 pm

darus67 wrote:Except most optical mice don't drive through rain and mud and snow and oil and whatever other road grime :D


I bet they would if they could :D
BigMike
 
Posts: 7
Joined: Fri Mar 07, 2008 12:25 pm

Automotive application Using Boarduino

by Frank843 on Thu Mar 13, 2008 12:29 pm

BigMike,
Believe me, I originally considered the mouse technology.... ya gotta start somewhere, right?

Since my car has a cable to turn the speedometer and it has disc brakes, I have been considering using a hall effect sensor or optical sensor. Of course, if the sensor is going to be exposed to the "elements" (like darus67 stated) , the hall effect sensor would be my choice.

There are numeous references on the Internet relating to using such sensors on robots, but I am wondering about their ability to capture the pulses of an automobile moving at 60-70 MPH.

This might require some testing....
Frank843
 
Posts: 29
Joined: Sun Feb 24, 2008 12:34 am

by BigMike on Thu Mar 13, 2008 1:03 pm

Hehe - I so want to do distance measuring like that.

As another thought - mechanical type speedos used to work by rotating a magnet which attracted a piece of metal connected to the speedo needle whcih moved against a spring.

As usual a wiki article describes it better:

http://en.wikipedia.org/wiki/Speedometer#Eddy_current


You may be able to use a hall effect sensor at the back of the speedo to detect the rotation of the magnet.


It might be worth a try.

Regards,

Mike
BigMike
 
Posts: 7
Joined: Fri Mar 07, 2008 12:25 pm

by dcmk1mr2 on Sat Mar 15, 2008 10:22 am

Take a look at the Megasqirt Tach input page (I'm looking at V3.0 schematic in "the Megamanual"). A 4N25 optoisolator is used to protect a micro input from the coil primary circuit. There are probably a million other ways to do it, but this is very bulletproof and simple. You could input the unregulated 12V to the optoisolator, and generate an interrupt when power drops off.

Looking at the megasquirt V3 power supply, when "raw 12V" drops out, D10 turns off and the capacitors at the input can only discharge through the regulator. So the capacitors at the input and the output of the regulator both store energy that will run your circuit.

One other automotive power issue you need to deal with is when starting; power will turn on and can while cranking dip down to next to nothing momentarily.

A serial VFD - as easy to use as anything else, except on the wallet.

http://www.seetron.com/vfd420_1.htm

Check out the "A'pexi Rev-Speed Meter":
http://www.lightningmotorsports.com/apexielectron.htm

http://www.chetcodigital.com/vGauge/vGa ... Module.htm

If you only have a beer budget, could visit your friendly local Pick 'N Pull and scrounge up analog gauges. You can drive them with PWM output - a Ladyada Motor Shield would work great.

If you can get a hall sensor to work in the speedo assembly, it may be easier than routing wires from you EFI computer.

HTH

dcmk1mr2
 
Posts: 3
Joined: Thu Jan 04, 2007 9:09 am

by cell on Mon Mar 17, 2008 12:49 am

I hacked up an RC filter to generate a tach pulse from the negative terminal of my ignition coil.

http://jason.pepas.com/wiki/index.php?title=Tachometer

I turned this:

Image

into this:

Image

run that through an opto-isolator and you have a nice square wave.[/img]

cell
 
Posts: 44
Joined: Fri Nov 02, 2007 9:24 am

Power

by phearlez on Wed Mar 19, 2008 11:56 am

All this talk about cigarette lighters and radios - the one place you can be -sure- is going to have constant and switched power is the ignition wires. It's a pretty simple matter with a voltmeter to figure which is which and access is almost always possible.

phearlez
 
Posts: 3
Joined: Wed Mar 19, 2008 11:49 am

by sti robot on Fri Apr 11, 2008 10:38 am

I've been working on a somewhat similar project. It is basically a replacement for some aftermarket gauges (accelerometer, oil temp, oil pressure, lap timer, boost gauge, air temp gauge).

I did have voltage issues at the beginning of the project. I would go to a car event (autocross) and half way through the day the device would refuse to boot. When I got home I'd upload the sketch to the arduino and it'd work again. After adding a 12V voltage regulator I stopped having this problem.

I've been using the sparkfun serial LCD's...but the red ones are hardly visible in the daylight. I may switch to vfd's in the future.

You may find some of the info useful.

www.robotmeter.com/dokuwiki
http://www.iwsti.com/forums/interior-dr ... -wiki.html
sti robot
 
Posts: 5
Joined: Fri Apr 11, 2008 10:34 am

by Volt Dropper on Thu Apr 24, 2008 10:13 pm

Here guys, save yourselves a lot of time.

http://code.google.com/p/xarias/
Volt Dropper
 
Posts: 30
Joined: Thu Apr 24, 2008 12:58 am

Please be positive and constructive with your questions and comments.