AC sine wave to DC square wave, newb, saw a similar thread

Discussion in 'General Electronics Chat' started by SpeedEuphoria, Mar 23, 2008.

  1. SpeedEuphoria

    SpeedEuphoria Thread Starter Member

    Joined:
    Mar 23, 2008
    Messages:
    11
    OK I'm new, I'm not really up on electronics, I learn fast and can build things. Anyway i read a similar thread on here about converting an AC sine wave to DC square wave http://forum.allaboutcircuits.com/showthread.php?t=5007

    I'm looking to convert a signal from an automotive ABS sensor which should be AC sine wave, to a DC square wave similar to a tach input, specifically switching between 0V and 3.5-12V. I have found this which shows basically the differences(Fig 1.4 shows what I believe to be the output and Fig 1.5 shows what i need) http://www.picotech.com/auto/tutorials/sensors-actuators.html

    Someone told me that I could use a diode to get the result, I'm not so sure after reading the 1st linked thread. Basically I built a highly modified FWD turbo car as seen here http://www.cardomain.com/ride/2641801

    I have an EBoost2 electronic boost controller which can schedule boost by RPM. I have found that the factory speed sensor output(basically Fig 1.5 in the 2nd link) is similar to a 4cylinder tach signal and can be used for speed based boost. The only problem with this is that is is located on the front drive wheels, so using in using it, wheel spin will make the MPH go up and keep ramping boost up(which is a huge negative for me as it will make the wheels spin worse). So I would like to have a speed sensor on one rear wheel so this will virtually eliminate this issue and be better all around. While my car does not have ABS, it is an option so I was thinking to grab a rear ABS setup(sensor and hub) and use the signal to hook to the tach input on the boost controller. Then I found the signals were different so i was looking for an easy/cheap way to make it work/convert the signal.

    If this is not a good idea i also was thinking of just retrofitting a proxy sensor and possibly a magnet to the hub if needed.

    Any and all discussion is appreciated, just remember I'm not informed on these subjects so i would appreciate a dumbed down version. Sorry for the long rant and thanks in advance Matt
  2. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    Messages:
    22,093
    Location:
    In the vast midwest of the USA; CST
    See the attached circuit.
    You should also add a 0.1uF cap across the supply pins (not shown)

    C1 blocks any DC level on the input signal. The network of R1, R2 and R3 establish a DC level for an inverting input of the LM339 comparator. It will be necessary to "tweak" R2 to set the DC level of the noninverting input to be within 34mV of the inverting input. If the output of the LM339 is high, set the noninverting input level to 33.5mV below the noninverting input, and vice versa. It's necessary to use a trimmer pot due to the tolerance of resistors - that is, unless you want to buy 0.1% tolerance metal-film resistors.

    R4 and R5 establish the DC level for the noninverting input.

    R6 establishes a feedback from the output to the reference noninverting input to effect hysterisis of about 67mV, which will probably be necessary in the electrically noisy environment under the hood. The hysterisis is displayed by the green (C) trace on the simulated O-scope display.

    The inverting input is compared to the noninverting input. If their voltage levels cross, the output toggles from 0v to the available voltage, depending upon the load. As wired, the output goes high when the noninverting input is below the inverting input, and vice versa.

    There are three more comparator circuits in an LM339 IC. The unused inputs should be tied to ground.

    Note that the output of the comparator is open-collector, and cannot "source" current, only sink it; up to 20mA. R7 is a pullup resistor; at 14V it will cause the LM339 to sink 11.6mA current. This leaves you about 8.4mA max for sinking external current. You may need to use an amplifier stage, depending upon your load. You could also increase the value of R7 slightly (to 1.4K) if you need to sink 10mA. I suggest that you don't go above 1.7k. Making significant changes in R7 will change the hysterisis of the circuit.

    Attached Files:

    tejasdj12 likes this.
  3. SpeedEuphoria

    SpeedEuphoria Thread Starter Member

    Joined:
    Mar 23, 2008
    Messages:
    11
    Thanks for the reply, now does this alter the frequency at all? Basically thats what both the abs ECU(If I had one or was going to use one) and the Tach read is just the frequency. I have some play in the reading of the frequency, so I think it should be OK.

    Does RadioShack have all of these mentioned parts? or can anyone point me to a good place online. I know theres one place that gives free samples and almost ordered from them before. Like I said I'm not up to speed on building small electrical things like this or diagrams, so how much would this cost? how big would this device be(need its own board)?

    Sorry for all the noob questions
  4. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    Messages:
    22,093
    Location:
    In the vast midwest of the USA; CST
    No, unless you have an excessive amount of noise on the input signal. That's what the hysterisis is for.
    You didn't mention what the amplitude of the incoming signal was. As you can see, the input to this example is +-100mV @ 1kHz.

    Yes.

    There are lots of good places online. Mouser, Digikey, Jameco, Electronic Goldmine, the list is rather long.

    You pay a premium for buying at your local RS store. But then you don't have to pay shipping, or wait for delivery.

    Depends upon where you buy the parts. You can go on Radio Shack's site and price the components there and elsewhere. Don't forget to get a quote on shipping costs.

    Small. Radio Shack carries PC "project boards" that are just under 2"x3" in a couple of styles that would work well for this project.
  5. Søren

    Søren Active Member

    Joined:
    Sep 2, 2006
    Messages:
    273
    Location:
    Denmark
    According to those graphs, the ABS signal is close to 16V_pp.
    This is a cat that can be skinned in so many ways, but here is a simple circuit that will work, with a PCB just measuring 1-3/4" x 1".

    Actually, it could be made with just one of the four gates, but since they're there allready...
  6. Søren

    Søren Active Member

    Joined:
    Sep 2, 2006
    Messages:
    273
    Location:
    Denmark
    Perhaps I should explain how it works:
    R3 and C1 is supply transient protection.
    R1, R2, D1 and D2 is input protection.
    IC1 is the schmitt trigger itself, shifting cleanly.

    This circuit inverts the pulses. I got the impression that it doesn't matter. If it does, gates B, C and D can all be paralleled.
  7. SpeedEuphoria

    SpeedEuphoria Thread Starter Member

    Joined:
    Mar 23, 2008
    Messages:
    11
    EDIT: Thanks for all of the help guys, I'm just going to look into a proxy or halleffect and fabricate the mounting instead of using the ABS sensor. Can anyone point me in a direction where i could find a sensor that will output square wave switching from 0V to 3.5-12VDC that can read high frequency(similar to rpms or the abs sensor would). It needs to have input voltage of 5VDC or for automotive up to 14.4VDC and simple hook up into an automotive application.

    I was looking at some online and looking for a simple cheap sensor that will work, I can do magnet or just reads steel(hopefully)
  8. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    Messages:
    22,093
    Location:
    In the vast midwest of the USA; CST
    Have a look at Allegro's line of Hall-effect sensors:
    http://www.allegromicro.com/en/Products/Categories/Sensors/ats.asp

    I haven't delved into their documentation.
    I have some older UGN3130's kicking around; they're bipolar Hall-effect sensor. Connecting them up couldn't be a whole lot easier; power, ground, and signal out. Signal out for this particular device is either ON (nearly Vcc) or OFF (nearly ground.) You usually put a small magnet on the back side of it, and the passing of gear teeth or reluctor on the front side causes a change in the magnetic field, triggering the device.
  9. SpeedEuphoria

    SpeedEuphoria Thread Starter Member

    Joined:
    Mar 23, 2008
    Messages:
    11
    I know its been awhile, but as far as the conversion would this work?

    Its a GM HEI ignition module, AFAIk this is used for a similar type setup to make it squarevwave from a sine wave source
    [​IMG]
    Last edited: Jun 2, 2008
  10. MangoMan

    MangoMan New Member

    Joined:
    Mar 31, 2009
    Messages:
    6
  11. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    Messages:
    22,093
    Location:
    In the vast midwest of the USA; CST
    It's still there; I just downloaded it.

    I've attached it to this post.

    Attached Files:

  12. Søren

    Søren Active Member

    Joined:
    Sep 2, 2006
    Messages:
    273
    Location:
    Denmark
    Hi,

    Please try again, it must have been your computer or a congested line, as it works fine for me.
Similar Threads
Forum Title Date
General Electronics Chat Sine wave from microcontroller Tuesday at 8:17 PM
General Electronics Chat Summation of multiple sine wave Aug 12, 2014
General Electronics Chat Sine wave oscillator help Jul 26, 2014
General Electronics Chat Q: How can you verify if an inverter is a pure sine wave inverter? Jul 12, 2014
General Electronics Chat p2p Detection of Sine Wave Jun 16, 2014

Share This Page