• NAXJA is having its 18th annual March Membership Drive!!!
    Everyone who joins or renews during March will be entered into a drawing!
    More Information - Join/Renew
  • Welcome to the new NAXJA Forum! If your password does not work, please use "Forgot your password?" link on the log-in page. Please feel free to reach out to [email protected] if we can provide any assistance.

How to make VSS Trigger

GSequoia

Everyone says I'm a jerk.
NAXJA Member
Location
Torrance, CA
Think of things like automatic door locks that engage at around 15mph. I'd like to build a trigger that's set to a particular road speed. I'm not concerned about anything except the VSS end of the issue, I know where all the wires are and how to set up the relays for the application (actually for DRL, not locks). What I don't know is how to build a circuit that will trigger a relay when the pulse from the VSS hits a certain frequency.

Anybody got any ideas, I know this isn't an everyday type question but we have a few not everyday kind of peoples in here.
 
What you're looking for would be best done with a small microcontroller or a few one-shot timers and a bit of glue logic.

Can't give a circuit diagram as I don't have home internet right now (on my phone) but I'll see what I can come up with tomorrow at work. I think it should be possible with fewer than one dozen components and an evening of soldering.
 
What you're looking for would be best done with a small microcontroller or a few one-shot timers and a bit of glue logic.

Can't give a circuit diagram as I don't have home internet right now (on my phone) but I'll see what I can come up with tomorrow at work. I think it should be possible with fewer than one dozen components and an evening of soldering.

Cool, let me know.

I want DRL but I don't want it to trigger until I get going about 10 - 15 mph, I also want to take this same design and adapt it to auto locks on other vehicles as well.

Plus building stuff is fun ;)
 
That actually sounds like a good idea GSequia.

One thing I thought of, were you planning on having them trigger at only speeds over 15mph, or once you hit 15mph for the first time, they stay on until say you shift it out of drive? What were your plans for turning them off?

Ken, when you figure that out, let me know too.
 
Last edited:
Great idea. Fun indeed and useful for various projects including some aspects of a keyless ignition project I'm toying with.

Kastein, I assume you will post to this thread but let us know.
 
Great idea. Fun indeed and useful for various projects including some aspects of a keyless ignition project I'm toying with.

Kastein, I assume you will post to this thread but let us know.

I can't take credit for the idea, that's how the auto makers do DRL. The aftermarket DRL kits go on ignition power only and I don't want that.
 
OK... so here's the theory (Geoff, pretty sure you know all this, but gonna post it anyways in case others are curious.)

Basically the VSS outputs a pulse every time the driveshaft turns a certain amount. The ratio of turns to pulses depends on the speedo gear you have installed. Anyways, the faster the driveshaft is turning, the faster the pulses get.

Really what you want to do is turn the lights on when the pulses get closer than a certain number of milliseconds, and then turn them off again if the pulses get slower than that. So the first thing to do is design a circuit that will measure out the time between the pulses. I decided to use a "one shot" timer - basically, you give it a pulse as an input, and it sends out a voltage for a predetermined amount of time, no matter how long the input pulse was.

Next, we need to turn the lights on whenever the next pulse arrives before the timer expires. So wire a flip-flop (a circuit that will remember the state you left it in - you send it a voltage on the Set input to turn its output on, and then another on its Reset input to turn it back off) with some logic that will trigger it to turn on if the one-shot timer's output is still on and another VSS pulse comes in, and trigger it to turn off if the one-shot timer's output is off when the next VSS pulse comes in.

But... since the real world varies slowly, and digital logic chips don't, if you drive along with this setup at EXACTLY the speed it's set to trigger the lights at, they will flick on and off very annoyingly and randomly. So we need another one-shot timer that's set for a slightly different (longer) pulse time, and wire the flip-flop to reset when the turn-on timer is off, the turn-off timer is also off, and another VSS pulse arrives.

Block diagram (still needs some details added):


Bill of materials:
2x 74LS121 one-shot timers
1x 74LS76 JK flip-flop
2x timing resistors (unsure of value, may be different, will have to calculate this later)
2x timing capacitors (see above)
1x 0.1uF 16V (or higher) tantalum decoupling capacitor (niobium oxide and other dry electrolytics with low ESR are also suitable)
1x 1.0uF 16V (or higher) tantalum decoupling capacitor (niobium oxide and other dry electrolytics with low ESR are also suitable)
1x VN0300 or 2N7002 N-channel MOSFET
1x automotive relay
1x 1N5819 back-EMF shunt diode (or use auto relay with built-in diode or resistor snubber)

This whole circuit (minus the relay) should be powered off the sensor power circuit - draw power from the VSS power line and it'll work great. Go over 5.5 volts and it WILL go up in smoke; if you want it to work off standard auto 13.8V power I can add a voltage regulator to the design. The way I've designed it so far it might turn your headlights on when you start the vehicle, or it might not, it's left up to chance as the flip-flop will choose randomly when you power it on. I can fix that but it'll add another part to the list... also, the two timers (marked "on" and "off") are actually the 74LS121s, but require more detailed wiring (adding the two resistors and capacitors and setting some option pins) but I haven't figured that part out yet.

If I find time Monday or Tuesday I'll finish that part of the schematic and throw together a quick PCB design.
 
You guys really need to check out this site:
http://arduino.cc/
I think it might make your project go a lot faster. They are open source microcontrollers and are super cheap. If you have $30 and a USB printer cable you can start programming them and figuring out how everything works. From there, its like putting legos together to make everything work. If the VSS signal is 0 to 5v than it would be easy to run that signal into an digital input that works with an external interrupt to count the pulses and output the signal to turn on the relay at the right time. You might have to use a transistor if the digital output couldn't handle the voltage or the current. In my opinion it would be much easier to create the logic in software rather than hardware. It would be easy to write code so your lights don't flicker on and off. You could even wire a pot that the microcontroller reads to adjust the speed at which the lights come on. Plus you get to learn how to write C which is pretty easy after you look at the examples that you can download. Just my $.02 though. Good luck, it sounds like a really cool project!:thumbup:
 
OK... so here's the theory (Geoff, pretty sure you know all this, but gonna post it anyways in case others are curious.)

Basically the VSS outputs a pulse every time the driveshaft turns a certain amount. The ratio of turns to pulses depends on the speedo gear you have installed. Anyways, the faster the driveshaft is turning, the faster the pulses get.

Really what you want to do is turn the lights on when the pulses get closer than a certain number of milliseconds, and then turn them off again if the pulses get slower than that. So the first thing to do is design a circuit that will measure out the time between the pulses. I decided to use a "one shot" timer - basically, you give it a pulse as an input, and it sends out a voltage for a predetermined amount of time, no matter how long the input pulse was.

Next, we need to turn the lights on whenever the next pulse arrives before the timer expires. So wire a flip-flop (a circuit that will remember the state you left it in - you send it a voltage on the Set input to turn its output on, and then another on its Reset input to turn it back off) with some logic that will trigger it to turn on if the one-shot timer's output is still on and another VSS pulse comes in, and trigger it to turn off if the one-shot timer's output is off when the next VSS pulse comes in.

But... since the real world varies slowly, and digital logic chips don't, if you drive along with this setup at EXACTLY the speed it's set to trigger the lights at, they will flick on and off very annoyingly and randomly. So we need another one-shot timer that's set for a slightly different (longer) pulse time, and wire the flip-flop to reset when the turn-on timer is off, the turn-off timer is also off, and another VSS pulse arrives.

Block diagram (still needs some details added):


Bill of materials:
2x 74LS121 one-shot timers
1x 74LS76 JK flip-flop
2x timing resistors (unsure of value, may be different, will have to calculate this later)
2x timing capacitors (see above)
1x 0.1uF 16V (or higher) tantalum decoupling capacitor (niobium oxide and other dry electrolytics with low ESR are also suitable)
1x 1.0uF 16V (or higher) tantalum decoupling capacitor (niobium oxide and other dry electrolytics with low ESR are also suitable)
1x VN0300 or 2N7002 N-channel MOSFET
1x automotive relay
1x 1N5819 back-EMF shunt diode (or use auto relay with built-in diode or resistor snubber)

This whole circuit (minus the relay) should be powered off the sensor power circuit - draw power from the VSS power line and it'll work great. Go over 5.5 volts and it WILL go up in smoke; if you want it to work off standard auto 13.8V power I can add a voltage regulator to the design. The way I've designed it so far it might turn your headlights on when you start the vehicle, or it might not, it's left up to chance as the flip-flop will choose randomly when you power it on. I can fix that but it'll add another part to the list... also, the two timers (marked "on" and "off") are actually the 74LS121s, but require more detailed wiring (adding the two resistors and capacitors and setting some option pins) but I haven't figured that part out yet.

If I find time Monday or Tuesday I'll finish that part of the schematic and throw together a quick PCB design.



Looks great but let me add something that might simplify the setup.

For the DRL specific setup I only need an on trigger when I reach say 10 - 15mph once, I don't really want the DRL to flick on/off in stop and go traffic for instance. Also for auto-lock that would also be necessary. Here are my very rough thoughts on how I was thinking of setting up everything outside of this board (since I'm not qualified to design this board).


First my though was a latched relay to power this. My provisional thought for this was the relay would be latched with the door buzzer part of the door switch (I have that removed right now so it's just waiting for a use). This would "arm" the board. Some sort of timeout logic here on the board would probably be a good idea, say ten minutes.

Then you start the vehicle and get on your way. Back out of your driveway and start going down the street, hit 10 - 15 mph (wherever you set the speed at) and the DRL comes on (and/or door locks clamp down). At this point it also cuts out that first relay so the board is "disarmed." Then everything repeats again the next time you open the door (which usually is after a shutdown anyway).

Now for my reasoning.

DRL - As stated before I think it'd be kinda lame for hte DRL to cycle on/off in stop and go traffic, I see a lot of that.

Autolock - There isn't any reason for the autolock to trigger if the doors haven't opened.


Thanks

PS - I'm using an off the shelf DRL controller that cuts the voltage out to the headlamps to around 9.5 - 9.75 (forget the number offhand). Out of hte box it expects a +12VDC as a trigger wire (you wire into ignition).
 
Ok, that makes things a fair bit simpler, should be pretty easy to set up. I'll give it some thought.

OkieXJ - I already know assembly language for 5 processors and enough C to write an OS kernel - I'm a computer engineer by profession and it's another of my hobbies. An arduino, while a neat tool/project base, is a bit overkill for this project.
 
Just to make it a bit more clear without drawing a diagram (well I've already got half a diagram drawn..)

+12VDC Ignition ----> Latched Relay (VSS board triggers this) ---> DRL module

Driver Door Jam Swtich (Gnd) ---> VSS board arming relay ----> VSS board

When VSS triggers ---> Unlatch arming relay & latch DRL module's relay

Clear as mud now?
 
I'm pretty sure the latching relay can be eliminated - they're expensive. I should be able to make it work with a one-shot timer, the flip flop, maybe one more chip, the MOSFET, and the relay.
 
Arduino is cool and all for beginners. But I usually just use straight Atmel AVR 8 bit micros. I can develop for them using GCC and the whole GNU toolchain on my Linux box, 100% free open source software. And they're cheap. Hell the JTAG debugger was only $50! Talk about a bargain. And the chips are like $3 each or something.

That said, discrete logic is frequently underrated. I bet Toyota wouldn't be having so many problems if they'd done more in hardware and less in software.

I'm interested in what you come up with, kastein :) I was going to suggest you could feed the pulse train into an RC filter and use an op amp or something to trigger when the average voltage hits a certain point. But that's all analog-ish. Your way sounds better.
 
Last edited:
maybe having the first gear solenoid trigger a relay? (just an idea)

On the other hand this would simplify the circuit a lot; just have it fire when the tranny shifts into 2nd. No need to measure pulse frequency.
 
On the other hand this would simplify the circuit a lot; just have it fire when the tranny shifts into 2nd. No need to measure pulse frequency.

That would work in a Cherokee, yes. But then I wouldn't be able to adapt it to just about every vehicle out there. For example I would like to apply the auto locks to my Crown Vic so it's no longer arming the locks fifteen seconds after the ignition is hit (feature of my remote start/keyless entry). The project isn't 100% about getting something done, it's also in the process and potential future use.

Why not just push the lock swith on the door????

That's how I do it now, I want something more automated and foolproof. Plus it's a feature I want, my '96 is my luxury vehicle, I like it to have creature comforts.
 
Back
Top