# Get TRIAC “signal” into a MCU

I've a dimmer in the wall (I assume it is a TRIAC) and I would like to get the "signal" or the dimming position into a MCU as a number 0..1024 (for 0..100%). The TRIAC will never be connected to a lighting load, I just want to gather the information to a MCU. What I will do with the signal (LED, PWM, aso) is not relevant for my question.

I assume that I have to attach some type of load that waste as little as possible power <<1W.

I suspect that this is not even possible since my goggling has given me no result, but perhaps I miss the right concept/words.

EDIT The lighting (probably LED) will be controlled both from the dimmer in the wall and from other sources (probably android app or home wep app), and as soon as the other source says "light on" the light should work even if the dimmer is completely off. The idea with the pot (thank you @Transistor) is very good, the only point is the model of my dimmer is part of a model/line and every piece is very expansive.

• "is not relevant to the question" <- is probably plain wrong, as we might advise a lot of things that help you much better if we know what you're trying to do in the bigger picture. See xyproblem.info – Marcus Müller Oct 22 '17 at 19:40
• "The TRIAC will never be connected to a lighting load ...". Then why don't you replace the dimmer with a pot? The missing information is important. – Transistor Oct 22 '17 at 19:41
• @MarcusMüller I've edited the question. I'm interested not only in a solution, but also a little bit in the theoretical feasibility. – Mike Fernandez Oct 22 '17 at 19:52
• dimming position into a MCU as a number 0..1024. You want an accuracy of 0.27°? I bet you haven't noticed yet the knob is only tightened on the pot axle, don't you? Mechanically, 32 steps may be possible. – Janka Oct 22 '17 at 19:52
• @Janka Thank you, I just wrote any number, 16 or even 8 would be enough. – Mike Fernandez Oct 22 '17 at 19:55

It sure is possible, you just have to measure how long the live output of the dimmer stays “close to” 0V.

But you should be very careful when working with mains.

And it still looks the wrong way to do anything. You should probably better disassemble the dimmer to reuse the pot it contains.

A few pointers regarding the challenge you are giving yourself.

simulate this circuit – Schematic created using CircuitLab

Figure 1. Typical dimmer circuit.

Figure 2. Phase-angle control.

Dimmers typically just trigger the triac at some point during the mains cycle. The triac then just latches on until the current through it falls below the hold-on current. This might be 5 - 50 mA depending on the triac. So ...

I assume that I have to attach some type of load that waste as little as possible power << 1W.

This might not be possible. The dimmer won't work without a minimum load.

The second problem is that the voltage range with a peak voltage of $V_{MAINS} \sqrt 2$. To make a circuit that can monitor that range of voltages and provide isolation with your micro is not a trivial design exercise.

There may be a good solution. Give it some time.