Sunday, July 14, 2013

Experiments in Dimming EL Wire using PWM (2013)

Recently, a friend of mine got into electronics.  As a first project, he wants to build Tron-themed shoes for his son.  He chose to use EL wire as a lighting accent, and would ideally like to be able to modulate the brightness of the wire using software.

However, EL wire must be powered using relatively high-voltage alternating current, and a dedicated driver circuit is usually employed to convert DC into the required format.  Because these drivers usually include some kind of oscillator/resonator to alternate the current, I was worried that using a transistor to limit the input current might screw up the driver's ability to stabilize, and initially though it might be better to throttle the oscillator output using a TRIAC or some such.  However, I realized that without special care, turning the TRIAC off would be akin to running the driver without a load, letting the oscillator run amok, which by all accounts is not a good idea either.

So... we turned to our good friend the Internet, and of course somebody else has already dived into this topic to much greater depth than I could ever hope to achieve.  Thank you ch00f!  His conclusions were that current-limiting the input stage of the resonator was a valid approach.  I treat this as great news for humanity at large because it means we can simply apply what we know about using transistors to control loads, treat the driver-and-EL-wire system as a generic load, and go on with our lives.

Here is the result:

I had some spare 2N2222s around so I adapted the idea to use those:

Manual dimming circuit.
PWM dimming circuit, with manual brightness control.
This circuit was intended for experimentation; in a finished circuit, you would probably choose some total fixed value for the sum resistance going into the transistor base and leave it at that.  You might also want to add a capacitor either in parallel with the driver or between the base of the transistor and ground to smooth out things a little, but I didn't need one in my tests.

Here are a few pictures from along the way:
The driver outside its enclosure.
Initial connection of the driver to an external PSU.
Controlling the driver circuit using a transistor.
Close-up of the transistor wiring.  (The Arduino RBBB is not used here.)
Using a potentiometer to dim the circuit.
Manually dimming the circuit.  What the heck - Picasa created this animated GIF on its own.  I never asked for it, it just showed up.  Insanity!
Final setup with the Arduino RBBB, messy desk, breakfast juice and all.  To supply a test PWM signal I simply used the circuit from my quiz game buzzers.


  1. So to get this working with the arudino, you would only need at digital output PWM and the 1k Resistor to the base of the transistor to current limit the secondary circuit for the inverter?

    1. That's correct! It's subtle, but the second diagram has PWM as an input to POT3. You can get rid of POT3 and use a fixed resistor (POT3+R4) instead. The resistance value required will depend on your transistor and the driver circuit.

  2. sorry if this looks like its a repeat question, but I put one in an then lost it somehow.
    I am novice to both electronics and the arduino. Do you have pics of the section labelled "controlled by PWM" in your video. To modify the circuit above to allow it to dim a 12 v circuit with 20-50m of el-wire what transistor would you use? Would the 2N2222a be adequate (600ma) or would you need something like the bd135 ( ) that can handle 1.5 a?
    Apart from the 1 pF after the emitter of the transister (before ground) would you put a zener diode to protect the arduino from the 12 current? this is the inverter I have purchased:

    1. Hi RajDarge! Actually if you have a multimeter, you could measure the current draw from the driver on its own, when it's just plugged into its power source and not being switched. That would give an idea of the amount of current you need to be switching with the transistor. (Sometimes you can get that information from the datasheet that comes with the driver, but there is no information about current draw on the sales page you linked.) EL wire is not very power-hungry... however, for 20-50m, once converted by the driver, the draw might be too much for a 2N2222 - it's hard to say without measuring, since drivers can be of varying efficiency.

      I don't think you need a diode anywhere, since the Arduino is isolated from the driver circuit by the transistor. If you're talking about dropping the 12V voltage rail using a Zener before supplying the Arduino with power, you don't need to - the linear voltage regulator onboard the Arduino should be able to take 12V without a problem.

      Best of luck!

  3. Your project help me soo much, think to share this !

    1. Glad to hear so! :) Thanks for letting me know!

  4. Hi Raptor,
    I only want to be able to manually dim an EL wire of 5m.
    If I bought a 12VDC inverter like this, where would I connect your manual dimming circuit?

    And would the parts in your manual dimming circuit still be correct?

    One final question, you show the one resistor as "DRIVER". What value resistor is this?

    Thank you for your help and input.

    1. Hello lhm4000! I am not familiar with that specific brand of driver so I can't be 100% sure, but yes, in theory it should work. I haven't seen any reports of drivers where this idea doesn't work.

      Also, as it turns out, the answer to your first and last questions is the same: the "resistor" labelled DRIVER is actually the driver itself, that's where it goes in the circuit. :) In other words, the positive input of the driver is connected to your 12V power supply, and the low side (negative/ground) input of the driver is connected to the collector of the NPN transistor.

      I hope this helps! :) Let me know if it works out for you!