High Voltage Triac Control
This is not a particularly easy circuit to control through a safe galvanically-isolated connection. Normally the approach used in a production design would be to couple the microcontroller to the mains via an optocoupled zero-crossing detector and then trigger the triac through an opto-triac. The power would be a function of the delay between the zero crossing and the triac trigger. 

If you really want to use that "light dimmer" circuit, it's possible with a light-dependent resistor (LDR) and a variable light source. LDRs may be hard to buy in some countries because they contain cadmium which is not RoHS compliant.

By the way, I'm not sure what you intend by that voltage source but it has a rather uncommon RMS voltage of 170V. If you intend to have 240VAC RMS @ 50Hz, you should use about 340V for the peak voltage (240\$\times\sqrt 2\$).