Need a way to trigger a relay coil with a sqaure wave?

Thread Starter

sd6

Joined Nov 28, 2022
4
Hey everyone, first post here!

So the problem i am trying to find a solution for. I am doing a 6 speed manual transmission swap and it is fitted with a 12v reverse lockout solenoid. In an oem application this is triggered by the vehical speed which is what i am trying to replicate. I am yet to probe the vehicals speed output with my scope to see exactly what it's doing but as far as i can tell looking at the service manual the abs module outputs a 5v square wave at varying pulse width depending on vehical speed. What i am wanting to do is design a circuit the will trigger a relay coil that can switch 12v to the solenoid when the square wave is at 0v (vehical not moving) and switch the solenoid off as soon as a 5v signal is present (vehicle moving). I also need to effectively decouple the sqaure wave signal from whatever i design as the signal needs to remain "clean" or it has the potential to cause a whole host of issues with the vehicals abs, speedometer etc. There are a few ways i have thought about going about this such as the use of optocouplers but this one has me a little confused on what to do
 
Last edited:

wayneh

Joined Sep 9, 2010
17,189
Do you know the frequency of the square wave? How about the timing of the coil signal compared to the presence/absence of the square wave? In other words, can the coil signal wait for 3, 5, 10 cycles before triggering or does it need to react even faster?
 

LowQCab

Joined Nov 6, 2012
2,646
Does the Square-Wave-Output ALWAYS go to zero,
and stay at zero,
when the car is not moving ?

The Output may be a Switched-Ground,
with, or without, a "pull-up" Resistor.
This is the most common type of Output in Automotive applications.
This could mean that the Output goes to 5V by default,
instead of going to Ground by default,
when the Car is not moving.

The wiring of the Solenoid must also be verified
if You will be using any factory wiring to the Solenoid.
The Power and Ground to the Solenoid can easily be reconfigured,
and, if You don't have a Factory-Wiring-Schematic,
running your own new wiring is preferred to eliminate any "guess-work", or surprises.

In either case, this should be a simple project,
and can be done with a MOSFET instead of a Relay,
( since there will be several other Electronic-components anyway ),
but the exact Output-characteristics must be triple-checked and verified.

As a generic-guess,
there will be around ~40-pulses per wheel-revolution.
Getting a close estimation of the number of pulses will make
designing the Time-Delay more accurate,
since it's desirable to have Reverse-Gear available within
a ~half of a second or so of stopping.
.
.
.
 

Thread Starter

sd6

Joined Nov 28, 2022
4
Currently I'm not entirely sure what the signal is doing, the service manual I have is a very basic line diagram that just shows where things connect. As for the frequency of the signal and number of pulses I'm not entirely sure. All 4 wheel speed sensors connect to the abs module and the module then outputs a signal to the vehicals ecu that is a combination of all 4 wheels. It would be ideal for the solenoid to trigger within 1 or two seconds of coming to a stop. No factory wiring will be used I have to make a module that will monitor the speed signal going to the ecu and when it sees the car is no long moving it will apply power to the solenoid. First thing I really need to do is scope the output so I can let everyone know what it's actually doing. It will either float at 5v and drop down to 0v with each pulse or sit at 0v and go up to 5v. I'm hoping it just sits at one or the other when the vehicle is stationary instead of sitting high or low depending on the point in rotation of the trigger wheels if that makes sense
 

LowQCab

Joined Nov 6, 2012
2,646
The Wheel-Speed-Sensors are virtually always "VR-Sensors",
( Variable-Reluctance ), ( not Switched-Hall-Effect ).

They consist of a Magnet and a Coil of Wire which puts out an AC-Signal
which must be processed by the ABS-Computer into Square-Waves,
which are then further processed to compare individual Wheel-Speeds.

They are neither On nor Off when not moving.
The Processor looks for the AC-Voltage from the VR-Sensor ( the Voltage varies with Speed )
to do a "Zero-Crossing", going from Negative to Positive, or, Positive to Negative,
depending upon the Design-Engineer's polarity preference.

The Special-Square-Wave-Output is generated by the ABS-Computer,
not directly from the individual Wheel-Sensors.

The ABS-Computer will always Boot-Up in the "Stopped" ( not moving ) condition,
what ever that may be, ( Hot or Ground ),
and then only start oscillating after the Car starts moving.
.
.
.
 

Thread Starter

sd6

Joined Nov 28, 2022
4
I did think the wheel sensors worked along those lines. I've never bothered to investigate how they work on any car I've had.

I think the next thing I really need to do is just throw a scope on it and have a look at exactly what's going on. I'm away for work until the weekend but I will be back with some results as soon as I can.
 

ThePanMan

Joined Mar 13, 2020
520
Does the Square-Wave-Output ALWAYS go to zero,
and stay at zero,
when the car is not moving ?
MY experience: 2009 Tacoma. Speedometer was way off. The dealer didn't want to address the issue so I ended up changing the gear ratio on the speed sensor. MY sensor consisted of a 5V line, Gnd., and Signal. MINE would produce four square waves per rotation of the driveshaft. The faster the rotation the more frequent the square waves, thus, the dash could calculate the speed. It ALWAYS output four pulses per revolution. Depending on where I stopped, the signal could be a continuous 5V or a continuous Gnd. If the vehicle wasn't moving there was no change.

I'm sure different manufacturers use different approaches.

Based entirely on the post header question "Need a way to trigger a relay coil with a square wave?" I'd say a capacitor between the pulse and ground. But that assumes you're always starting AT ground. The coil can be energized after the capacitor has sufficiently charged up. You may need a resistor to control the rate at which it charges.

One thing for certain: We need more information about your vehicle and about what approach you favor. ABS ? ? ? I wouldn't mess with that. The potential for interference with braking can put your life and others lives in jeopardy. I'd recommend you stay away from ABS.
 

ThePanMan

Joined Mar 13, 2020
520
Re-read your initial post. You want the reverse lockout to occur only when the vehicle is moving. You say you're putting a 6 speed manual transmission - "Manual" being the key factor. Many manual transmissions have a way that makes it difficult to get into reverse. Some manufacturers (makers) incorporate a mandatory pressing down on the shifter before it will go into reverse. Others have a detent that takes more force to move into reverse than into any other gear, making it so that the driver has to exert extra effort to hit reverse.

What happens if your lockout fails and you're always locked out of reverse? A bit of an inconvenience.

Where are you? USA? Europe? Other country? Yes, that can make a difference. But most of all, the make, model and year of your vehicle will yield better answers more directly related to your project.
 

LowQCab

Joined Nov 6, 2012
2,646
MY experience: 2009 Tacoma. Speedometer was way off. The dealer didn't want to address the issue so I ended up changing the gear ratio on the speed sensor. MY sensor consisted of a 5V line, Gnd., and Signal. MINE would produce four square waves per rotation of the driveshaft. The faster the rotation the more frequent the square waves, thus, the dash could calculate the speed. It ALWAYS output four pulses per revolution. Depending on where I stopped, the signal could be a continuous 5V or a continuous Gnd. If the vehicle wasn't moving there was no change.

I'm sure different manufacturers use different approaches.

Based entirely on the post header question "Need a way to trigger a relay coil with a square wave?" I'd say a capacitor between the pulse and ground. But that assumes you're always starting AT ground. The coil can be energized after the capacitor has sufficiently charged up. You may need a resistor to control the rate at which it charges.

One thing for certain: We need more information about your vehicle and about what approach you favor. ABS ? ? ? I wouldn't mess with that. The potential for interference with braking can put your life and others lives in jeopardy. I'd recommend you stay away from ABS.
.
Installing oversized Tires and Wheels creates far more "interference" with Braking
than loosing ABS functionality entirely will create.
And, tapping into a Digital-Signal with a very High-Impedance-Input is not "dangerous" at all,
there are few, if any, High-Impedance-Signals in the wiring of any Automotive application,
so the chances of a High-Impedance-Tap added to a Low-Impedance Output-Signal-Wire
creating disruptive "Interference" is virtually zero.

The Front-Wheels on your truck very likely have left & right VR-Sensors intended to
provide Signals to the ABS-Computer,
just like ~90+% of all modern cars and trucks on the road,
even though it would appear that they used
a Hall-Effect-Sensor for the Trans-Output-Shaft-Speed on your truck.

Of course, the Hall-Effect-Sensor could be exclusively for the Speedometer,
and You may well have 2 additional VR-Sensors,
one on each Rear-Wheel,
for ABS-Sensing of individual Rear-Wheel-Speeds.

But we're not talking about the differences between "Sensors" here,
this is an issue of tapping into a Low-Impedance, Low-Frequency,
Square-Wave-Output from an ABS-Computer,
and determining it's behavior under various conditions,
and therefore, it's usefulness in controlling a Reverse-Gear-Lock-Out-Solenoid
via a simple Pulse-Detection-Circuit.
.
.
.
 

sghioto

Joined Dec 31, 2017
3,708
First thing I really need to do is scope the output so I can let everyone know what it's actually doing
I think this circuit will work using a LM2907.
This chip detects when the ECU signal is above a certain frequency and activates the output (pin5) shutting OFF the solenoid.
Q1 and the 4N25 should give plenty of isolation for the ECU signal.
The input to the LM2907 doesn't matter if the output from the ECU is high or low.
The frequency is determined by the values of C and R.
With the values shown the solenoid should shut OFF above 5Hz.
1669761329897.png
 

Tonyr1084

Joined Sep 24, 2015
7,199
Installing oversized Tires and Wheels creates far more "interference" with Braking
than loosing ABS functionality entirely will create.
Where did tire size get mentioned? Yes, changing tire size has a lot of effect on braking. Wider tires will cause more heat in the brake pads. Taller tires will increase the braking load. But I thought we were talking about a reverse lockout solenoid and how to trigger it.
I am doing a 6 speed manual transmission swap and it is fitted with a 12v reverse lockout solenoid.
If all you need is 12 volts to unlock the reverse gear then just use a momentary push button switch somewhere convenient to unlock the transmission. You can't shift into reverse accidentally without having to push a button. Never mind scavenging a signal from the transmission speedometer output sensor or ABS systems. I'd be worried that messing with either of them could render something inoperative.
tapping into a Digital-Signal with a very High-Impedance-Input is not "dangerous" at all
I agree. But what if a wire harness is damaged? Or the splice is unshielded and therefore transient noise can leak in before the high impedance. You could introduce false signals into your speedometer or ABS system. Maybe not - but I'd not want to run the risk of a car that can't stop. Dad taught me that a car that can't go can't hurt you. But a car that can't stop - - - . That's the way my dad ended that lesson. And he's right; a car that can't stop can do a lot of harm. I can imagine something even worse, stepping on the brakes and the ABS computer thinking that wheel is not turning, it could lock up the other side and cause the vehicle to veer off the road. I don't know that for a fact, but it's a factor I would not want to discount. Or ignore. An un-steerable car can be just as dangerous as one that can't stop.
 

LowQCab

Joined Nov 6, 2012
2,646
I do know how ABS-Systems work,
and they're very standardized,
( except for some of the new "Brake-by-Wire" Systems that may be out now ),
and are designed to be fail-safe in every way.
You can un-plug the ABS-Box and the Brakes will work exactly like nothing ever changed,
it's just that with it un-plugged,
you will be able to lockup the Brakes if You press on the Brake-Pedal hard enough.

The Brakes do not depend on the operation of the ABS-System to work.

There is no "danger" in tapping into a Signal from the ABS-Computer,
on the other hand,
if it was my car,
I'd go with the simple Push-Button solution.

Actually, I think Manual-Transmissions are way too much work,
especially in a Traffic-Jam,
and they are definitely much harder on Driveline parts.
I wouldn't have anything other than a Custom-Tuned 4-speed-Automatic with
a High-Stall / Lock-Up, Torque-Converter.
The Computer shifts much more consistently than I possibly could,
and without my having to even think about it,
and, without wearing-out my left leg.
Been there, done that, and it's no longer worth it to me.
.
.
.
 

Thread Starter

sd6

Joined Nov 28, 2022
4
So just to clarify a few things in this post. So the vehical is a Ford ba xr6 falcon, i'm in Australia. This is a Australian made vehical and it was only ever available in a few countries outside of Aus. That said though it still uses a bosch abs system that will be similiar to many vehicals world wide. The transmission i am fitting is a tremec tr6060 which should be well known by anyone in the States. My version doesn't have the option to fit a speed transducer on the output shaft like many of them do. As for the reverse lockout solenoid, it is spring loaded. You can still force the transmission into reverse without it disengaged, its job is just to make it hard to do so.

The vehical doesn't use a transmission mounted speed sensor it uses the wheel speed sensors only. All 4 wheel speed sensors send their signals to the bosch abs module. It determines the vehicals speed from the sum of the rear wheels and then outputs a signal over a single wire back to the vehicals pcm unit. From here all speedometer information is sent via the canbus.

The tone rings or trigger wheels on each of the wheels for the abs sensors are of a toothed design with a tooth count probably somewhere around 30-40 and i would very much expect a square wave to be output from the abs sensors as the magnetic field has a fixed polarity and provides a polarized pulse with each tooth. The magnetude and frequency of these pulses will increase with wheel speed.

If the vehical looses abs signal it wont stop the brakes working it will just stop the speedometer working and stop the abs from functioning along with triggering an abs warning light. Doing somthing like connecting a passive component such as a capacitor directly in circuit would indeed corrupt the signal in such a way that would cause issues but id think a high impedance load would have little to no effect on the signal. These systems are designed to have a fair amount of tolerance also.

I was talking to a friend today about what i am trying to do. He pointed out an off the shelf component from our local electronics store that will quiet possibly solve the whole thing for me providing speed signal is within the frequency range supported on its data sheet. https://www.jaycar.com.au/frequency...MI1LShjf7V-wIVTgwrCh3dAgx3EAQYASABEgItXvD_BwE
 

ThePanMan

Joined Mar 13, 2020
520
Installing oversized Tires and Wheels creates far more "interference" with Braking
than loosing ABS functionality entirely will create.
When I bought my truck it had smaller tires on it than was supposed to be. That was the first problem to be solved in my speedometer being accurate. But even with the proper size tires the indicated speed was still significantly higher than the actual speed. I used to joke about it saying "Little old ladies were blowing my doors off and flipping me the bird as they sailed past." Even getting the right size tires didn't completely solve the problem. I don't know why but the driven gear was correct according to Toyota documents. It was a 29 tooth gear. I put a 30 tooth gear in its place with no meshing problems and that brought my speedometer to nearly accurate. Still, at 25 MPH my actual speed was 27 MPH. At 75 MPH actual speed was 73 MPH. Over the entire range 50 MPH was considered dead on. Actual speed was determined via two GPS means, a known distance and time traveled without interference from traffic and math. In order to get my speedometer needle indicating properly I had to put it roughly two miles below zero.

Messing with tire size means messing with the speedometer programming. That's not what the TS wants to do - he wants the shift lock to unlock when the vehicle is stopped. Which now raises a question in my mind, if the vehicle was just moving then whatever sensing means is used, does something need to discharge before the solenoid unlocks reverse?
If all you need is 12 volts to unlock the reverse gear then just use a momentary push button switch somewhere convenient to unlock the transmission.
Makes sense to me.
 

ThePanMan

Joined Mar 13, 2020
520
If the vehical looses abs signal it wont stop the brakes working
My concern would be an intermittent loss of signal. For instance, say you're tied in to the front left tire. All tires are sending a signal saying three tires are turning at the same rate but the front left appears to be turning slower than the rest. ABS will send more braking force to the faster spinning tires which could cause a loss of control.
You can un-plug the ABS-Box and the Brakes will work exactly like nothing ever changed,
it's just that with it un-plugged,
you will be able to lockup the Brakes if You press on the Brake-Pedal hard enough.
I agree. If ALL information is missing then ABS will do nothing. Again, my concern is if one tire rotation is in error, can the ABS computer (if so equipped) determine its signal is an error? Or is the left front tire (my previous example) turning slower, causing ABS to think two rear tires and one front (right) tire is sliding. ABS may give a confused response. Unlike you I don't "KNOW" how they work, I just understand basic functionings. I'd rather have ABS completely working or completely not working. Anything in between can potentially be hazardous, dangerous or possibly deadly. Why take the chance?
 

LowQCab

Joined Nov 6, 2012
2,646
ThePanMan
No one is considering the use of a single Wheel-VR-Sensor.
The ABS-Computer supposedly has a
single Square-Wave-Output-Pin that sends a signal to the Main-ECU.
This would be the only connection.
--------------------------------------------------------------------------------------------
sd6

The Module You linked to will "probably" work just fine.

My only consideration is the unknown Input-Impedance.

It's easy to insure a very high Input-Impedance when You build the Circuit yourself,
but there's no guarantee that the designer of this module
had a High-Impedance-Input as a priority,
so there's a slim chance that it may create too much of a Load on the ABS-Output-Pin,
and consequently, could possibly interfere with its normal operation.

I would recommend adding an external 1K Resistor to the Input of this Module.
If the Module has a High-Impedance-Input, the Resistor will not affect it's operation,
but it will present a reasonably High-Impedance-Load to the ABS-Output in any case.

But of course, if the Input of the Relay-Module is Low-Impedance,
the 1K Resistor may reduce the Signal enough to cause the Relay-Module to not operate reliably.

Since You say that You have an Oscilloscope,
I would recommend looking at the operating-Voltage of the
Signal-Wire with no other new added connections,
then measure again with the Relay-Module attached, ( with a 1K Resistor in line ).
If there is any significant Voltage-Drop with the Relay-Module attached,
I would recommend coming up with a different plan.
.
.
.
 
Top