Help with digital pot and triac dimmer - Page 1
Forum section: electronics / beginners

author: Bskitter
author_rank: Regular Contributor
timestamp: June 11, 2016, 10:43:45 pm
content: 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 DiagramI can't quite find a 500K digital pot, could you guys help provide me with one OR an alternative ?Byron

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 02:35:45 am
content: 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.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: June 12, 2016, 03:47:30 am
content: 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.

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 04:41:53 am
content: 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 theSilonex 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.

author: Bskitter
author_rank: Regular Contributor
timestamp: June 12, 2016, 12:19:41 pm
content: 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 ?

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 02:20:24 pm
content: 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.gMOC3023Mto 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 TRIACYou 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.

author: bktemp
author_rank: Super Contributor
timestamp: June 12, 2016, 02:26:28 pm
content: Quote from: Ian.M on June 12, 2016, 02:20:24 pmOne of the best zero crossing detectors is this circuit:http://www.dextrel.net/diyzerocrosser.htmIt is tolerant to supply voltage variations and produces sharp edges and it consumes almost no power.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: June 12, 2016, 04:20:25 pm
content: Quote from: Ian.M on June 12, 2016, 04:41:53 amA 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/480600While 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.

author: wraper
author_rank: Unknown
timestamp: June 12, 2016, 04:32:46 pm
content: http://www.instructables.com/id/Arduino-controlled-light-dimmer-The-circuit/