sine to square wave converter

Discussion in 'General Electronics Chat' started by s900t8v, Oct 16, 2012.

  1. s900t8v

    s900t8v Thread Starter Member

    Joined:
    Mar 12, 2011
    Messages:
    48
    Location:
    Victoria Australia
    hey guys

    I've been looking on the net for a cheap and simple box that converts a sine wave to a square wave

    for my project TRACK car - the ECU needs a square wave speed signal. I have a sine wave reluctance style sensor in the back of the speedo. I want to condition the signal.

    I can change the pulse settings blabla in the ECU to get the speed right so I can just use any converter right? The problem is I can't even find one :(
  2. MrChips

    MrChips Moderator Staff Member

    Joined:
    Oct 2, 2009
    Messages:
    9,804
    Going from sine to square is a lot easier than the other way around.
    Any amplifier, transistor, logic gate or comparator will do the job.
    s900t8v likes this.
  3. s900t8v

    s900t8v Thread Starter Member

    Joined:
    Mar 12, 2011
    Messages:
    48
    Location:
    Victoria Australia
    ok, so i'm a total noob when it comes to electronics, can you point me at something cheap and readily available

    Ideally I just want to connect the sine input, and connect the square output, is there anything that makes it that easy lol ;D
  4. MrChips

    MrChips Moderator Staff Member

    Joined:
    Oct 2, 2009
    Messages:
    9,804
    You have to provide more information.
    What is the output voltage and impedance of the sensor.
    What voltage is required by the ECU. What is the input impedance of the ECU?
    Some of these questions you may not know the answer. But if you can provide more details we can figure it out.

    If this has anything to do with real automobiles, we cannot help you.
  5. s900t8v

    s900t8v Thread Starter Member

    Joined:
    Mar 12, 2011
    Messages:
    48
    Location:
    Victoria Australia
    na it's a project...

    how do I measure these things?

    I can measure the voltage at the sine wave sensor? how do I measure impedence?

    not sure about the ECU, seeing if I can find that out now !

    thanks for the help :)
  6. blah2222

    blah2222 Active Member

    Joined:
    May 3, 2010
    Messages:
    530
    Location:
    West
    The output impedance of the sensor is going to determine how large the input impedance of your "converter" will roughly have to be so that you do not lose your signal.

    Assuming that this sensor is linear and is completely resistive (probably not the case) if you hook a known supply voltage up to the sensor and measure the current produced, the impedance (resistance) can be found as the input voltage divided by the measured current.

    If you want to get the reactive component of the impedance (capacitive/inductive) pass in an AC voltage and measure the current amplitude and phase difference from the input voltage and perform the same calculation (involves imaginary numbers). The latter is more involved, but good to do if you know what you're doing.

    If there is a capacitive/inductive component, your impedance is going to depend on the operating frequency. Impedance increases with increasing frequency for inductors and decreases with increasing frequency for capacitors. Resistance is not affected by frequency. Find out the frequencies that you will be using.

    Once you've got a rough idea of the output frequencies of the sensor, it's output impedance, and its possible amplitude and you will be almost ready to setup your "converter". The signal will most likely need to have noise and DC bias filtered and even amplification if it is too weak.

    As a crude example, read up on the Schmitt Trigger as this would be an easy way to transform the signal into what you want. Basically the op-amp acts as a comparator and compares the voltage between its +ve and -ve terminals. If V+ > V- then, its output terminal will be ~+ve supply voltage and ~-ve supply voltage in the opposite case. The Schmitt Trigger has a feedback component that actually takes into account what the output currently is and changes its compare voltage depending on what state your in.

    Good luck!
  7. Stuntman

    Stuntman Member

    Joined:
    Mar 28, 2011
    Messages:
    125
    Location:
    The Great Midwest
  8. Dodgydave

    Dodgydave Well-Known Member

    Joined:
    Jun 22, 2012
    Messages:
    1,825
    Location:
    Liverpool,UK. GMT
  9. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Track car + ECU = automobile
  10. Austin Clark

    Austin Clark Member

    Joined:
    Dec 28, 2011
    Messages:
    395
    Location:
    Hutchinson, KS. United States
  11. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Do you know the signal amplitude?
  12. Austin Clark

    Austin Clark Member

    Joined:
    Dec 28, 2011
    Messages:
    395
    Location:
    Hutchinson, KS. United States
    Nope. But, if it turns out not to be what he needs, no big deal, at least he might still learn something. However, if it turns out to be what he does need, I'll have saved everyone time. Pros out-weigh the cons :)
  13. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Yeah, you're probably right. Or he might hook one up and say WTF?
    He said he could measure the amplitude. The amplitude may change with frequency. If he does try it and come back with WTF, we need to know the amplitude(s). The sensor impedance is, IMHO, irrelevant, because a Schmitt trigger can have basically infinite input resistance.
    MrChips basically spelled out the requirements. As I said, I don't think impedance is an issue.
Similar Threads
Forum Title Date
General Electronics Chat square-wave vs. sine-wave motor May 12, 2014
General Electronics Chat Sine wave to square wave converter Jun 3, 2013
General Electronics Chat Help to convert sine wave to square wave Sep 27, 2012
General Electronics Chat Sine wave oscillator produces almost square wave. Jul 2, 2012
General Electronics Chat Sine Square Triangle Oscillator Jan 9, 2012

Share This Page