Smoothing out a square wave to power a relay?

Discussion in 'The Projects Forum' started by downey, Jun 11, 2009.

  1. downey

    Thread Starter New Member

    Jun 11, 2009
    Hi I'm new here and I'm glad i came across this site.
    I am making a DRL bypass for my car to wire up new headlights. My issue is my headlights are putting out a 0-9V peak square wave. So my solution involves smoothing out the voltage and using it to turn on a relay which will draw power directly from the 12V car battery.

    The circuit works great with a sine wave, but when i switch the source to square wave it does not work. and after the inductor there is no voltage.

    the output from the factory wire is:
    0-9V peak square wave with 35% duty cycle

    Purposed circuit as follows, if I can get the image posted.

  2. downey

    Thread Starter New Member

    Jun 11, 2009
    Does anybody have any simple way to do this?
    Some people are saying just put a cap across the input of the inductor would work but my testing showed otherwise
  3. Mike Mandaville

    Active Member

    May 27, 2009
    Downey, please do not make your own DRiver's License. You will be arrested!
  4. SgtWookie


    Jul 17, 2007
    Try it more like the attached circuit.

    D1 prevents current from flowing the wrong way through the inductor when the input signal falls to 0v.

    D2 provides an alternate current path for L1 when the input signal falls to 0v.

    D3 is a reverse-EMF protection diode.
  5. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    What is the rated coil voltage of your relay?
  6. downey

    Thread Starter New Member

    Jun 11, 2009
    It will be a 40Amp, 12Volt relay.
    I modified my circuit and I don't know why I'm not getting the same values as yours SgtWookie.
  7. RiJoRI

    Well-Known Member

    Aug 15, 2007
    Frequency? SgtW. is running at 8.33 Hz, you are at 2 kHz. The inductor & cap are frequency sensitive. ;)

  8. downey

    Thread Starter New Member

    Jun 11, 2009
    I forgot to mention the output of factory harness is about 60 hz.... approx 35% duty cycle
  9. SgtWookie


    Jul 17, 2007
    My simulation's square wave is 100Hz, 35% duty cycle. That was merely "a guess", but apparently not too far off.
    To find the signal generator in the Devices list:
    1) On the menu bar, click Devices, then Browse
    2) Click .General, then Instruments, then Signal Gen.
    Setting up the Signal Generator:
    1) Right-click on it, select "Edit Signal Generator"
    2) Click the "Wave.." button, then click "Pulse..."
    3) In the left column, enter:
    0v (Inital amplitude)
    9v (Pulse amplitude)
    16.67mS (Period)
    5.833mS (Pulse width)
    Leave the remaining entries as they are. Those values will give you a 60Hz square wave with a 35% duty cycle.

    My simulation's stop time is 120mS; yours is 500uS (0.5mS). You aren't allowing enough time for the current to start flowing through the inductor.

    On the menu bar, click "Simulation", then "Analysis setup..."
    Un-check the "Always set defaults" box.
    Click the "Transient/Fourier" button.
    Change Stop Time to 120mS.
    Set Step Time and Max Step to 200uS.

    Note that in my simulation, I'm using a 5v relay, as that's the output the simulation indicates. Actual output voltage will depend on a few other things, like the resistance of the relay's coil, etc. It certainly won't be enough to pull in a 12v relay. You may have to use a Darlington transistor (like a TIP120) with a resistor on it's base to sink current from your 12v relay.
    See the attached schematic for the suggested modifications (a TIP141 is shown, but a TIP120 should work just fine).

    Note that no fuse is shown. You MUST use a fuse between the battery and your circuit, or risk burning up your vehicle.

    Tip: Stop Time should be some multiple of 3 for easy reading of the time scale.
    Tip: Some circuits (such as astable multivibrators) benefit from putting a checkmark in the UIC box; this starts all voltages at zero.
    Last edited: Jun 12, 2009
  10. downey

    Thread Starter New Member

    Jun 11, 2009
    Thanks for your help.
    It turns out that the output was actually a 0-9 volt peak sine wave. so I put a 3300uF, 25V cap across the input of the relay and it is working perfectly.:)