Smoothing out a square wave to power a relay?

Thread Starter

downey

Joined Jun 11, 2009
8
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.

Thanks,
 

Attachments

Thread Starter

downey

Joined Jun 11, 2009
8
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
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Attachments

Last edited:

Thread Starter

downey

Joined Jun 11, 2009
8
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.:)
 
Top