arduino for shifting separatly controled overdrive in project car

Ok so heres the setup. 70 Chevelle with a new fuel injected engine. This is hooked up to the old Automatic Turbo400 transmission, behind the three speed transmission there is a Gearvendors overdrive. Now, heres my problem. Gearvendors sends you a controller unit for controlling the overdrive. There are two types that Gearvendors will send you , depending on whether or not your transmission is a Automatic or Manual. This controller unit has a manual mode for both the automatic and manual, and a automatic mode that kicks in after 45 MPH in just the automatic controller. Well basically I ordered this Overdrive so long ago Gearvendors is not going to help me out by doing an exchange of any kind. So I want to use one of my Arduinos to do this, plus I could add some added functionality that the Gearvendors controller doesnt offer.
Heres how the Gear vendors controller works:
Signal generator (two wires) from the transmission go to the Controller to tell it how fast the vehicle is going.
Now, you have two types of inputs: Manual mode and Automatic mode, and a on and off button.
in the manual mode, when the car is at a full stop the overdrive is off until you hit the on and off button. Then as you accelerate it goes, depending on your speed from first, first Overdrive, second, second overdrive, third, third overdrive. Then when you come to a stop again, you have to re-engage it with the on and off button.
On the automatic mode the unit just engages after 45 mph.
My question is what would i need and how would i setup the two signal generator wires into the arduino?
Also can you point me in the way of a tutorial that might be like this scenario so I can attempt to code it? As I have only gotten as far as having a led flash on my Arduino.

Do you want it to work like the manual setup 1st, 1st O/D, 2nd, 2nd O/D
OR do you just want it to switch on at 45mph?

I'm not clear if the manual mode can only be used with a manual transmission.

In any case it seems your first task is to figure out how to get your Arduino to detect the vehicle speed reliably. Don't bother thinking about controlling the O/D until you can do that.

Do you know what "comes out" of the two wires from the transmission in order to provide a speed signal? It might be a varying voltage or it might be pulses with a varying frequency - or maybe something else entirely.

...R

sorry let me clarify. Forget about the manual transmission setup, as that was only to let you know they sent me the wrong controller.
So:
two modes: manual and automatic
manual mode: hit switch when stopped, the overdrive engages at 25mph in first, 35 mph in second and 45 mph in 3rd . then shuts off when you come to a complete stop. you need to hit the on/off button to reengage it.
automatic mode: just turns on when car is over 45 mph. if you stop it comes on again at 45 mph

Now this manual mode sounds dumb to me. Why the F would you have it turn off when stopped? why not just have it turn off when you hit the on/off switch. But this is how Gearvenders sets it up. So I would Ideally like to have it setup so manual mode does what it does now but dosent shut off until you hit the on/off switch. and the automatic mode does exactly the same thing it does now.

psi3000:
two modes: manual and automatic
manual mode: hit switch when stopped, the overdrive engages at 25mph in first, 35 mph in second and 45 mph in 3rd . then shuts off when you come to a complete stop. you need to hit the on/off button to reengage it.
automatic mode: just turns on when car is over 45 mph. if you stop it comes on again at 45 mph

Thanks for the clarification. It reinforces what I already suggested as a first task.

Now this manual mode sounds dumb to me. Why the F would you have it turn off when stopped? why not just have it turn off when you hit the on/off switch. But this is how Gearvenders sets it up.

I have no opinion on this. It might be a good idea to check with your auto insurance company.

...R

Robin2:
Do you know what "comes out" of the two wires from the transmission in order to provide a speed signal? It might be a varying voltage or it might be pulses with a varying frequency - or maybe something else entirely.

...R

it is a pulse width modulation, so a sign wave.... so how would i hook that up?

OK i did some more research on PWM and it seems I would put the two wires coming off the generator into a input on the arduino making sure it doesnt go above 5volt. Then i would need to figure out at what speed the generator output whatever volts. Then I could code it as"if volts=0.0-1.0; turn off solenoid" (first gear) " if volts=1.0-1.5 turn on solenoid" (first/OD)"if volts=1.51-2.0; turn off solenoid" (second gear engaged) "if volts=2.1 - 2.5; turn off solenoid" (second gear O/D))
I know this is not the syntax but like i said i only have made a light turn on and off with the Arduino. I will have to do some research on how to code it exactly.

PWM in not a sine wave. It is a square wave at a fixed frequency in which the proportion of time when the signal is HIGH or LOW is varied. It is certainly quite possible that the output is a PWM signal - but are you sure and do you know the frequency.

I am not good at analogue electronics but if you want to measure the average voltage produced by a PWM signal you need to feed it into a suitable load that smooths out the pulses. Somebody else will have to explain how to do that.

If you don't do that the Arduino will just meaure 5v when the pulse is HIGH and 0v when it is LOW - which won't tell you anything.

Another possibility is to measure the gap between the pulses - perhaps with the pulseIn() function. This would probably be easier than trying to get a good average voltage.

Your general approach to the logic seems appropriate once you have a means to collect the speed data. You will find, when you come to write your IF statements, that it is easier if you start with the highest value and work down.

...R

I'm not sure how you determined the output is a sine wave, do you have an oscilloscope ?

Does the sine wave to below 0v I.e ground, or is it offset so its center is 6v?

Anyway, conversion of sine wave to square wave is generally easy.

If the value doesn't go below 0v, put a 1k resistor in series with the input and use a 5v Zener diode between the arduino input and ground

If it goes below zero, your simplest solution, is probably to use a bridge rectifier, but this gives you twice the frequency, but just divide by two in your code to get the original frequency.

Do lots of testing to ensure you don't have any electrical interference.

Cars are notorious for having lots of electrical noise that can reset your arduino

Once you can reliably detect speed.

Look at the section on this site about a Finite State Machine. It sounds complex but its not.

I don’t know if this will help, but here is an oscilloscope picture of the VSS (vehicle speed sensor) output on my 4L80E transmission. The 4L80E is basically a 400 with a built in 4th gear overdrive, so the VSS outputs are probably similar. This was taken at a speed of about 40 MPH

That certainly looks like a sine wave and NOT like PWM.

What would it look like at another speed?

If the frequency is proportional to speed all you need is a small piece of code to count how often the signal rises towards 5v.

...R

The sine wave appears to have negative and positive half cycles, so either the scope was in AC coupling or it truly does have negative half cycles, which would need to be dealt with.

Also the peak to peak voltage is only 1.5v, which is not enough to trigger a digital input.

I think you will need to build a small circuit to amplify and shift the signal levels to be 0 to 5V

Also, you need to measure whether the amplitude of the sine wave is less when the car is moving more slowly, or more quickly

rogerClark:
The sine wave appears to have negative and positive half cycles, so either the scope was in AC coupling or it truly does have negative half cycles, which would need to be dealt with.

Also the peak to peak voltage is only 1.5v, which is not enough to trigger a digital input.

I think you will need to build a small circuit to amplify and shift the signal levels to be 0 to 5V

Alternatively, use the analog comparator in the mcu. No need to shift the sine wave or amplify it. However, to improve noise immunity, you may need to add a little hysteresis. You can do this by connecting one of the analog comparator inputs to the sine wave source via a resistor of about 22K (to limit the current into the pin protection diode during negative half cycles), and the other one to ground via a resistor of about 100 ohms. In the analog comparator ISR, when you get an interrupt that tells you the input has gone negative, enable the pullup resistor on the other analog comparator input. When you get the interrupt to say that the input has gone positive, disable that pullup resistor.

With the GM ECMs that I have experience with the ECM grounds one of the two VSS leads. You only have to monitor the non-grounded lead.

There are no PWM GM VSS's. Only sine wave or square wave with the frequency varying in proportion to the vehicle speed.

While the vehicle speed is relative to the frequency of the sine or square wave, magnetic (sine wave) (generator) VSS's will produce a higher voltage the faster the vehicle travels. You will want to clamp the voltage into your arduino. Make sure you are doing your clamping past a high resistance resistor or you will mess up the input to the ECM.

Are you going to monitor the brake switch to automatically disengage the overdrive?

You will want to use a delay after the inputs are satisfied before engaging the overdrive so you don't have the controller 'hunting' between engaged and disengaged.

You might also want to monitor the MAP signal if you have one to estimate engine load. TPS is a second, lesser choice.

Wow so much great info. And a sine wave I can start off with! Thanks all so much. I will begin plotting my attack on this project and keep this post updated. So it does look like I can just monitor the volts and go from there after taking care of limiting the negative volts. Easier than I thought. Oldveteguy is the value on the left of that chart in volts?

Yes, the values on the left are in volts, oscilloscope set for DC input.
In another application, reading ABS signals, I used an NCV11124 IC chip (Mouser Electronics # 863-NCV1124DG ) to reduce the sine wave to a square wave. In the Arduino sketch I used the pulseIn() function to read the pulse width. Below are some scope pictures of the VSS output conditioned by the NCV11124 chip at 10 mph, 40 mph, and 100 mph. As you can see the frequency increases with speed.