Shop OBEX P1 Docs P2 Docs Learn Events
Engine TACH. Mesure 5v square wave. — Parallax Forums

Engine TACH. Mesure 5v square wave.

PLJackPLJack Posts: 398
edited 2005-04-18 11:21 in General Discussion
I plan to use a SX chip to measure the RPM of an engine. (Full size, 8cyl)

There is only one wire that needs to be monitored.
All that I have found so far is:
If it's 5V, as I suspect, you'll need a resistor, cap, and zener diode to
connect in the lead between the tach output and the computer.

                         10000 Ohms
       from HEI    >------/\/\/------o---------o----------------> to CPU
                         1/2 Watt    |         |
                                     |         |
                                    ___/     _____
                         5V Zener  // \      _____  .001 uF Cap
                         1 W       /___\       |    100V
                                     |         |
                                     O----------
                                     |
                                   -----
                                    ---
                                     -
his circuit will convert your input into a relatively clean square wave at
a voltage which should be compatible with the computer.  Solder the 
components together, insulating them from each other, and attach 3 wire 
leads (in, out, and ground).  Heatshrink the whole thing together and wire
it in series with the tach lead close to the computer, making sure it has 
a good ground.  If the input requires some other voltage than 5V, simply use 
the appropriate value zener.




First off, does that circuit seem correct to you?

Next, what is the best approach, SX wise, to measure the 5v square wave coming from this wire.
The higher the RPM the faster the square wave comes in?
Does that sound right?

I don't need to display this information, just send a number via Serial.

Thanks for your input.

Jack

Comments

  • KenMKenM Posts: 657
    edited 2005-04-15 02:06
    Jack,

    I have done this a handfull of times, and depending on the vehicle it can be easy or not so easy conditioning the signal.

    What model vehicle will you monitor and EXACTLY where do you intend to get the tach signal from?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-15 16:23
    I myself would probably optically isolate the signal from the Stamp pin as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-15 17:30
    I wholly concur with Chris, non-isolated interfacing of a microcontroller to a high voltage source is a receipe for disaster. By all accounts the resistor should be fine, but murphy's law will always rear its ugly head when you are least expecting it.
  • PLJackPLJack Posts: 398
    edited 2005-04-15 23:53
    Ok, some info on the engine.
    This is a custom vehicle. there is no make or model.

    KenM, , the engine is a 6 liter GMC Gen III V8.

    Chirs, Paul , optically isolated sound like a great idea.
    I'm familiar with isolated relays, but how do I isolate a square wave?

    As for the SX, should I use a timer to measure the 5v pulses?
    Could I use SX/B PULSIN for this or is there a better way?
    Am I right is assuming that the faster the pulses come in the faster the RPM is?
    I know, nothing but questions.

    I'm also reading that the tach square wave voltage could be between 4.5 to 5 volts
    and is at 2 pulses per crankshaft revolution

    Jack

    Post Edited (PLJack) : 4/16/2005 12:14:14 AM GMT
  • KenMKenM Posts: 657
    edited 2005-04-16 01:05
    PLJack said...
    Chirs, Paul , optically isolated sound like a great idea.
    I'm familiar with isolated relays, but how do I isolate a square wave?

    As for the SX, should I use a timer to measure the 5v pulses?
    Could I use SX/B PULSIN for this or is there a better way?
    Am I right is assuming that the faster the pulses come in the faster the RPM is?
    I know, nothing but questions.

    I'm also reading that the tach square wave voltage could be between 4.5 to 5 volts
    and is at 2 pulses per crankshaft revolution

    Jack
    A common opto isolator is the 4n25.

    As the engine RPM increases, so too does the frequency, or period of the tach square wave.

    Even though the signal is 4.5 to 5 volts and can be read directly by the SX, it is indeed a good idea to isolate the signal, with a 4N25 for example
  • PLJackPLJack Posts: 398
    edited 2005-04-16 02:15
    Somebody said...

    A common opto isolator is the 4n25.
    As the engine RPM increases, so too does
    the frequency, or period of the tach square wave.

    Thank you. That helps allot.

    Using the circuit listed in my first post, I assume the 4n25
    goes between the SX pin and the cap.

    As an aside, did I read the specs on the 4n25 correctly, the
    transfer rate is 2 microseconds!
    How do they get an LED to move that fast?
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-16 04:03
    Considering they can modulate light to carry Gbps of information 2 uS isn't that much.
  • KenMKenM Posts: 657
    edited 2005-04-16 04:13
    PLJack said...
    Thank you. That helps allot.

    Using the circuit listed in my first post, I assume the 4n25
    goes between the SX pin and the cap.
    The circuit below might "load" the tach signal. Depends on that particular vehicles electronics. If it does "load" the tach signal, either the engine wont run or the tach will not work.....not being sure if the pickup point is indeed a tach output or an igniter input.
    Fear not.....if it does "load" the tach signal, there is an easy solution.

    This circuit completly replaces the one in your original post.

    oops.....the schematic should say "to SX", not "to Stamp", but you get the idea



    Post Edited (KenM) : 4/16/2005 3:31:04 PM GMT
    720 x 415 - 23K
  • PLJackPLJack Posts: 398
    edited 2005-04-16 09:43
    KenM, Thank You VERY much for your effort.

    I understand and prefer your circuit.
    The engine people tell me that the wire I need to measure IS the
    tach signal.

    Thanks again.
    Jack
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-17 00:43
    Ken what schematic editor are you using?

    I ran across the type of configuration the 4N25 uses, can you explain the purpose of the conection to the base? I have always thought of optoisolators as the photodiode setting the base current of the transitor, the connection to base makes me doubt my present understanding of optoisols.
  • KenMKenM Posts: 657
    edited 2005-04-17 04:01
    I use the schematic program that comes with expesspcb.com

    It is free.

    As I understand the opto isolaotors, the LED portion does provide the base drive.

    The base connection with a resistor to ground is to speed up the turn off time of the opto isolator. It discharges the base capacitance when the LED portion turns off.




    Post Edited (KenM) : 4/17/2005 4:05:30 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-18 11:21
    Ok that explains the base connection, thanks Ken
Sign In or Register to comment.