5v Digital Signal to Solid 12V

ebeowulf17

Joined Aug 12, 2014
3,307
OK, now it all makes sense. This likely depends on vehicle but on one of my old trucks they used a speed pick up on the transmission. It was only a two wire sensor with no external excitation. Anyway, knowing things now I would just run your pulses into a re triggerable one shot or missing pulse detector with a slow enough RC time constant. The trick is knowing what you actually have for pulses. I do know that pulse rate will vary from vehicle to vehicle.

Sorry I was slow on the uptake. :(

Ron
Not sure what's wrong with me, but I often shy away from 555 circuits when there are reasonable alternates. I was already thinking there should be a good Schmitt trigger solution, and before I got around to trying to design it, I found that @crutschow had already posted one here: https://www.electro-tech-online.com...sing-lm339-393-comparator-or-cd4049-gate.807/

Not claiming it's better or worse, just another option.

I'm still going to see what I can do in terms of a design without using ICs, just cause this stuff is good mental exercise for me, but I imagine the 555 or Gate based solutions will ultimately be better.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Sorry I was slow on the uptake. :( Ron
No worries. I may not have explained myself properly but see a lot of progress now. Are you guys wanting the pulses per mile or something different from that? This could be the million dollar question because it is going to vary from vehicle to vehicle and I am not sure I have a good answer for you as it is not an easy number to come up with. Let me know what you need and I will do the math and give you an answer best that I can.
 

crutschow

Joined Mar 14, 2008
38,526
Let me know what you need and I will do the math and give you an answer best that I can.
Well, we need to have the lower limit on the pulse rate you want to detect, and the maximum time after the pulses stop before the relay de-energizes.
Those two values are related to each other as the first will determine the second.
 

ebp

Joined Feb 8, 2018
2,332
What is the nature of the load on the relay?

150-200 mA is sufficient coil current for a 12 V relay that can handle quite high contact current. If it is switching high current at DC, then it is advantageous in terms of the life of the relay contacts to be sure that it pulls in quickly and cleanly and releases quickly. Both these requirements favor using a circuit with hysteresis. If a capacitor is to be used to delay turn-off of a transistor that directly drives the relay coil, the high coil current and consequent high base current would be an issue. A Darlington transistor would probably be quite acceptable as a fix It would be bettter to use a tranzorb or zener to suppress the coil voltage spike at turn-off, since the higher voltage (compared with just a diode across the coil) allowed would speed up opening of the contacts which helps reduce contact damage due to arcing. Arcing is more of a problem with DC and tends to transfer metal from one contact to the other. 12 V is certainly more contact-friendly than higher DC voltage.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Well, I played around with sims a little tonight, but didn't find anything great. Doing it with discrete components was getting complicated. As @ebp rightly pointed out, you don't want long, slow transitions on the relay coil current, and I wasn't happy with my discrete solutions in terms of switching speeds or parts counts and complexity.

I tried designing a hex inverter solution from scratch and ended up with something essentially like crutschow's design. It works quite nicely. I later realized none of those parts are readily available with 12V compatibility and in through-hole format, which may be a problem.

Looks to me like the 555 missing pulse circuit is likely the best/easiest solution, but I ran out of time to play with it.
 

ArakelTheDragon

Joined Nov 18, 2016
1,366
The circuit should work for controlling the relay High = On, Low = OFF. Depending on the frequency the relay will certainly chatter. Putting a relatively large capacitor across the 10k with an additional base resistor from the 10k to the NPN base will create a RC filter to smooth your square wave input into more of a DC level. Other, more complex options are possible by creating a monostable with a 555 timer with a time element set to 'ride through' the pulses.

*EDIT

OR as DodgyDave says a Cap across the relay could work but it will depend on the duration of the holdup you need. A large capacitor will take time to charge and may require a larger transistor to deal with the pulse currents.
It should work, it is the normall way to do this.
If you put the cap around the coil of the relay, the losses will be bigger also.
A bipolar transistor will work for this, but it might be more professional to use a MOS that is voltage controlled, than you can omit the "1K" resistor on the base of the bipolar.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Okay a little update. I checked on a typical VSS for a Chevrolet truck and the VSS counts 4000 pulses per mile.
My best case scenario would be for it to engage the relay as fast as possible and shut it off when the vehicle stops or very close to it.
 

crutschow

Joined Mar 14, 2008
38,526
For 4000 pulses per mile, 1 MPH is 4000/3600 = 1.1 pulse per second, so if the missing pulse detector circuit detects that, then it would turn on above that speed and turn off about 1 second after the vehicle stops.
Would that be adequate?
 

ebeowulf17

Joined Aug 12, 2014
3,307
For 4000 pulses per mile, 1 MPH is 4000/3600 = 1.1 pulse per second, so if the missing pulse detector circuit detects that, then it would turn on above that speed and turn off about 1 second after the vehicle stops.
Would that be adequate?
Wow, my wild guess back in post 19 was freakishly accurate. I should buy a lottery ticket!
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
For 4000 pulses per mile, 1 MPH is 4000/3600 = 1.1 pulse per second, so if the missing pulse detector circuit detects that, then it would turn on above that speed and turn off about 1 second after the vehicle stops.
Would that be adequate?
Yes that would be adequate.
Wow, my wild guess back in post 19 was freakishly accurate. I should buy a lottery ticket!
That might be a good thing.
Lottery numbers that are off by 10% don’t win anything.

Bob
Very true. Apparently someone in SC was 100% bang on. Good for him...maybe???
 

ebeowulf17

Joined Aug 12, 2014
3,307
Hey how is everyone tonight? Anybody have any luck figuring out this circuit?
Yes and no on my end. Attempts wth only discrete components were disappointing.

I've got a missing pulse circuit that I think will work, based on a Schmitt trigger inverter IC, but you can't get 12V versions in through hole, so unless you're comfortable working with surface mount parts, it would have to be rearranged around 5V parts (which would also mean needing to add a 5V regulator to the project.

I still think the 555 based missing pulse circuits look like the most promising for your situation, but I haven't had a chance to draw or simulate one yet. I'm wary of recommending anything I haven't tried out, at least in simulation. I just don't have the experience to look at a schematic and know with confidence how it'll work.

If you're ok with surface mount parts, I can share the inverter circuit I came up with. Otherwise, I'll try to play with 555 circuits this weekend and share my results.
 

crutschow

Joined Mar 14, 2008
38,526
Below is the LTspice simulation of missing pulse detector circuit using one IC (CD4093 Schmitt trigger NAND gate) plus a transistor and assorted resistors and capacitors.

The relay turns off about 1.2 seconds after the pulses stop (as determined by R1, C1), turns on at the start of a pulse, and stays energized for any pulse train with 1 second or less between pulses.

The CD4093 has a 20V maximum voltage rating.

upload_2018-10-26_16-58-58.png
 

ebeowulf17

Joined Aug 12, 2014
3,307
Below is the LTspice simulation of missing pulse detector circuit using one IC (CD4093 Schmitt trigger NAND gate) plus a transistor and assorted resistors and capacitors.

The relay turns off about 1.2 seconds after the pulses stop (as determined by R1, C1), turns on at the start of a pulse, and stays energized for any pulse train with 1 second or less between pulses.

The CD4093 has a 20V maximum voltage rating.

View attachment 162491
I found a problem with the version I'm working on, and since I *think* the basic principles are the same, I'm afraid yours will have the same problem. On mine, when the pulse train is high, that means the last change was a rising edge, which gets inverted by my first gate such that its output is low. When its output is low, the RC circuit is inactive and that node is held low, which means that the output of the second inverter is high.

What this all adds up to is that if the last edge was a rising edge (if the pulse train stops on a high voltage,) the circuit never times out and deactivates the relay. The circuit only works if the pulse train stops low (finishing with a falling edge.)

You can see in the image below that after the 2nd-to-last rising edge, the output stays active for over 1.9 seconds, despite the fact that the RC time is set to trigger at just over 1 second. The last falling edge works as expected. Then, after the last rising edge, the output latches on indefinitely.

Am I crazy? Did I simulate something wrong? Is your circuit more different from mine than I think it is, somehow making it immune to this problem?

pulses-drive-relay-INVERTER_04.png
 

Attachments

crutschow

Joined Mar 14, 2008
38,526
I think the problem may be that your first Schmitt trigger is biased at exactly 1/2 the supply voltage, thus the output can stay in either state with no input due to the hysteresis.
Bias it slightly low, as I did, so that with no input the output of the second gate is always low.
 
Top