Author Topic: Help with digital pot and triac dimmer  (Read 3417 times)

0 Members and 1 Guest are viewing this topic.

Offline BskitterTopic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: cz
Help with digital pot and triac dimmer
« on: June 11, 2016, 10:43:45 pm »
Hey guys,

Im wondering if anyone can help around here, I have built a light dimming circuit with a triac kit, I now want to connect a digital potentiometer to it so i can control the lights via an Arduino.

Here is the Diagram




I can't quite find a 500K digital pot, could you guys help provide me with one OR an alternative ?

Byron
« Last Edit: June 11, 2016, 10:55:25 pm by Bskitter »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Help with digital pot and triac dimmer
« Reply #1 on: June 12, 2016, 02:35:45 am »
You are never going to be able to do it that way, because the voltages on the potentiometer pins of a digital pot chip are limited to being in between the chip's supply rails, and you'll have great difficulty finding any pot chips that can handle +/-10V on its pot pins let alone hundreds of volts.

Instead you need a circuit to detect the zero crossing of the mains waveform + a variable digital delay circuit (often implemented as code in a MCU) to provide a delayed firing pulse to the TRIAC, to let through a variable 'chunk' of each mains half cycle.

Also note that the zero crossing detection circuit and the TRIAC gate control signal must be treated as mains live, so it is unsafe to connect them to an Arduino, unless you either provide optical or pulse transformer isolatation, or treat the whole Arduino board, its PSU, sensors, and wiring as mains live.   

Experimenting with direct mains powered TRIAC dimmers is *NOT* something that novices should be doing due to the high voltages and potentially high currents involved.   If you are trying to teach yourself about digitally controlled dimmers, its a lot safer to work with 24VAC from a transformer and 24V truck bulbs.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Help with digital pot and triac dimmer
« Reply #2 on: June 12, 2016, 03:47:30 am »
Use an opto-ldr (LED optically connected to a light dependant resistor (called an LDR, CdS cell or photoresistor)) rather than a digital pot.  This will give you isolation from the high voltage as well as a being compatible with your TRIAC circuit.  You can feed the LED with a DAC or a PWM & filter.

You can order one or you can make your own by combining an LED with a LDR with a piece of heat shrink tubing.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Help with digital pot and triac dimmer
« Reply #3 on: June 12, 2016, 04:41:53 am »
That's a valid approach in North America and other 115V AC countries as your mains supply peak voltage is only about 160V.  However, in Europe with 230V mains supplies, the peak voltage is about 325V which will exceed the voltage rating of most CDS photocells. 

e.g the Silonex NORPS-12, a Mullard ORP12 replacement is only rated to 250V and the original Mullard ORP12 was only rated to 110V, so would have been marginal or unsuitable for a dimmer using the O.P.'s circuit, even in North America.
 

Offline BskitterTopic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: cz
Re: Help with digital pot and triac dimmer
« Reply #4 on: June 12, 2016, 12:19:41 pm »
Thanks for the reply's guys,

What Opto isolator must I look for, or more specifically what specification in the opto iso must I look out for ?

And can  I just hook it up like this ?

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Help with digital pot and triac dimmer
« Reply #5 on: June 12, 2016, 02:20:24 pm »
It certainly doesn't hook up like that.  Most optocouplers don't have enough voltage rating and you don't need the DIAC.   The easiest option is to use an Opto-TRIAC e.g MOC3023M to drive the gate of the main TRIAC.  See fig 13 in its datasheet for the preferred hookup. 
N.B. the MOC3023M doesn't have enough continuous current capability to drive *ANY* load directly. It must always be used with an external TRIAC

You also need the optoisolated zero crossing detector circuit as well.   That can be done cheaply or it can be done well, at the cost of considerable complexity.  The problem is: you need minimal phase shift and it must be consistent on both positive and negative half cycles, otherwise it causes a DC bias which can cause major problems with some types of inductive load.  Also, the simpler circuits are acutely sensitive to noise on the supply near the zero crossing e.g. powerline data or control signalling, or switching noise from other loads.
« Last Edit: June 12, 2016, 04:50:19 pm by Ian.M »
 

Offline bktemp

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: de
Re: Help with digital pot and triac dimmer
« Reply #6 on: June 12, 2016, 02:26:28 pm »
You also need the optoisolated zero crossing detector circuit as well.   That can be done cheaply or it can be done well, at the cost of considerable complexity.  The problem is: you need minimal phase shift and it must be consistent on both positive and negative half cycles, otherwise it causes a DC bias which can cause major problems with some types of inductive load.  Also, the simpler circuits are acutely sensitive to noise on the supply near the zero crossing e.g. powerline data or control signalling, or switching noise from other loads.
One of the best zero crossing detectors is this circuit:
http://www.dextrel.net/diyzerocrosser.htm

It is tolerant to supply voltage variations and produces sharp edges and it consumes almost no power.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Help with digital pot and triac dimmer
« Reply #7 on: June 12, 2016, 04:20:25 pm »
That's a valid approach in North America and other 115V AC countries as your mains supply peak voltage is only about 160V.  However, in Europe with 230V mains supplies, the peak voltage is about 325V which will exceed the voltage rating of most CDS photocells. 

A very good point:  one I hadn't considered.  However, we don't have to use that photocell, and 350V rated ones are not exactly hard to come by:
http://www.digikey.ca/product-detail/en/luna-optoelectronics/PDV-P5002/PDV-P5002-ND/480600
While Bskitter might have trouble easily obtaining one of these, I think it is the better way for him right now since he's a beginner.  This is a very simple solution which is compatible with his existing dimmer and is easily debugged by observing the LED dimming or shining a flashlight on the CdS cell to confirm it's operation.  I presume there's a myriad of arduino-dimming-an-LED examples out there.

However I encourage you Bskitter to follow Ian.M's suggestion.  It is more difficult but you will learn much more. 

 

Offline wraper

  • Supporter
  • ****
  • Posts: 16863
  • Country: lv
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf