PWM DC dimmer to ON/OFF

Discussion in 'General Electronics Chat' started by Deekman, Mar 3, 2008.

  1. Deekman

    Thread Starter New Member

    Mar 3, 2008
    2
    0
    Hello,

    This is my first post here; please be gentle!

    I'm installing a car alarm, and the arm/intrusion trigger is the dome light. Unfortunately I have one of those fancy-schmancy dimming dome lights that confuses the ever-loving crap out of my alarm. As the dome light dimms out the system arms 10 or 15 times in a row, beeping and flashing my turn signals the whole way!

    I thought the dome light dimmer would be a simple saturation circuit that slowly reduces the voltage to the lamp, and I could simply use a relay to make that an on/off signal to my alarm, but no. The signal appears to be a square wave with an asymetric period decay instead. (0v period gets longer, 12v period stays the same) Since it's an incandescent bulb, the effect is the same, it appears to dim.

    The problem is that the relay coil acts so fast, the contactor follows the square wave! How can I get this PWM dim to appear as a simple on/off to my alarm?

    I need to convert this:[​IMG]

    To this: [​IMG]

    I was thinking of a capacitor and resistor in parallel, in series with another resistor and the +12v side of the signal? I wouldn't have a clue where to start, though.

    Any help would be appreciated. Thank you in advance for helping a dummy!

    deek.
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Without any details as to period of the squarewave and/or duty cycle of the controlling squarewave all I can offer is a possible form of a circuit that may be able to get you what you need.

    What I have attempted to depict is an intergrator that has a fast charge rate and a slow discharge rate. The diode makes this possible. With the diode, the positive going pulse rapidly charges the cap through the diode and the resistor R1. When the pulse goes low, R2 (which is selected to have a value much greater than R1) becomes the dominant factor in the rate of discharge of capacitor C1.

    hgmjr
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The attached schematic is along a similar line as hgmjr's train of thought, with a few changes:

    1) The resistors in the circuit need to be fairly small in resistance, and of large wattage. I've used 10 Ohm resistors in the schematic; they should be 10W minimum. R1 will actually be overloaded by 40% for a brief moment when first charging the caps.

    2) The diode needs to be able to tolerate a heavy load when the capacitors are initially charging through the RC network. I've used an 1N5400 which is a 3A rectifier diode, but a 1A rectifier diode would also work.

    3) The resistance of your relay's coil is currently unknown. However, it's likely that it is somewhere between 400 and 800 Ohms. I used 500 Ohms as a compromise.

    4) Relays exhibit a form of hysterisis; they require a certain voltage level to first energize, and once energized they will stay that way until the voltage drops considerably lower. The RC network helps to filter out the on/off transitions and give more of a steadily decreasing voltage level.
     
  4. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    feed that PWM into a DM74LS123 setup to retrigger itself with every input pulse, hence keeping its output high for a period of set time. once input PWM goes away DM's output will stay high for set time and then die. you tie this output to a pnp or npn which drives your relay(s), etc. i forget if this DM is a hi or lo to reset but in any case if need be you can flip it with npn or pnp, etc. just set DM time longer than the longest pulse width of your dome controller, etc... and ahhhh, you can also use DM as a arming timer.

    you also didnt say if you wanted the solution to be completely passive. using the method above does make it a active setup, but better....
     
  5. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    use a simple RS flip-flop !!!!
     
  6. Davidpostlethwaite

    Member

    Mar 2, 2008
    12
    0
    using a simple NE555 timer chip set as a re-triggerable monostable should do the trick. time the last (and longest) gap between pulses and add half again to give you plenty of time. Use this time period as the timeout for the monostable. Once the last pulse has been, the monostable will time out for that period (1.5xlongest pulse gap) before switching its output low.
    DC Kid has the right idea. As he stated, you'll need to power this circuit up using a 12V supply from the battery. If you don't have access to a separate supply then you'll need to think of a passive solution.
    There are loads of 555 timer circuit diagrams available on the web.

    a crude passive solution would be to use a big diode. anode on the pulsed power and cathode on an electrolytic capacitors '+' terminal. the coil of a small relay can then be attached across the capacitor (acting as a capacitor discharge resistor).
    When your bulb is at it's dimmest the frequency will be around 30Hz or so (just before the human eye sees a flicker on a dim incandescent light). so you'll need to experiment with relay coils and capacitors to find the correct values so the relay doesn't chatter as the cap discharges too slowly. Or conversely; ensure the capacitor isn't too small that it can't hold its charge between PWM pulses.
    Good luck
     
  7. Deekman

    Thread Starter New Member

    Mar 3, 2008
    2
    0
    Great responses and some really creative ideas! I prefer to keep the solution passive, if possible, but I do have some 555 timer experience and may end up going that way. I never would have thought to use a timer...

    hgmjr: I'll measure the resistance of the coil in the relay and post it back here; If I can get my hands on a portable 'scope or a DMM with frequency I'll post period and duty cycle too.

    Thanks again for all your help.

    deek.
     
  8. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    a passive solution could be to use a small signal diode, and cap and resistor as a RC timer, hang RC off of the base of a pnp or npn. the idea here is the RC charges from PWM it either holds pnp off or npn on for a period of time after PWM dies. diode to prevent current flow back into the PWM lead.
     
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I'd considered a timer circuit, but that would involve a constant battery drain and the hassle of finding a 12v source that was active all the time.
     
  10. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    how about this. diode from dome light to cap. cap charges and that charge is used to bias a npn. when dome light dies the cap continues to bias the transistor for some time after dome light has gone. the transistor can handle the load of the relay, etc. all that is needed is a 1n4001, perhaps a 2200uF cap, 2k ohm resistor (or 100k pot for tuning, but if using a pot then also use a 200ohm resistor closest to the base, this way you cant accidently bring pot to zero ohms and kill the npn, etc) to the base, and the npn. can be used for NO or NC relay setup.
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That might work - but still, you're left with looking for an "always on" source of power, along with tracking down an NPN transistor that will turn completely off. I don't know of one offhand. MOSFETS would come close, although they don't turn off completely either. With an active device, you will always have some leakage - might be very small, but it'll be there.

    What I originally posted might be like swatting flies with an aircraft carrier - but I've been known to do things like that. :D
     
  12. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    but surely any small leakage through a "off" bi-polar is not enough to really worry about, and certainly not enough to hold the relay magnet "on"....
     
Loading...