Arduino Uno - Triac RobotDyn Dimmer Please!!!

Hello, Sorry about my bad english. I use 2 channel cards of RobotDyn for arduino. But I cannot dim 2 channels separately. How can I control 2 channel pins independently? 2 Channel should be at the independent level I want. I cannot use its library and add a second lamp.
Please I need help.

My aim is to be able to dim 2 channels separately with the application I created on C #. How can I control channels separately?

Please give links to the data sheets.

I am assuming it is this one: AC Light Dimmer Module, 2 Channel, 3.3V/5V logic, AC 50/60hz, 220V/110V. First I would suggest you read a bit on track control and AC light dimming. You will find that you trigger the triac with a pulse, that is the input on the board, one for each channel, 2 separate outputs from the Arduino. The AC line is constantly changing and the timing is from when it crosses zero in each direction. How do you know this, the board gives you a pin called zero, that is the signal you time everything from. RobotDyn gives you a lot of information and there is a lot posted in this website.

What Arduino are you using?

Edit: n/m, see it in your thread title...

Give this a try (attached). It’s supposed to give individual dimming on two channels. It’s written as a “demo” so when plugged in, the two bulbs (channel ‘A’ and channel ‘B’ should brighten and dim individually.)

Connect both modules to AC power and connect your load.

The Z-C output of one of the modules connects to pin 8 of the Uno. This is the input-capture pin for timer 1. You only need one connected since the AC zero-crossings are the same for both modules.

Connect pin 9 of the Uno to the PWM pin of the channel ‘A’ dimmer and pin 10 of the Uno to the PWM pin of the channel ‘B’ dimmer.

You’ll also need to connect power and GND from both dimmers to the Uno.

The code doesn’t have any error checking; it’s just a basic attempt to show two channels being controller independently.

You could change the constant up/down dimming code to answer serial messages from your PC C# program and set the desired dimming percent that way (or add other behaviors as you need…)

There is code to drive a ZC-simulation signal on pin 7 that, when connected to pin 8, simulates the ZC input from the module. If you want to bench test w/out a module connected, you can use this.

This has been tested on the bench using that simulation. The output signal is a 16.8uS-wide high-going pulse issued once per ZC period; the phase (i.e. the time between the ZC and the appearance of this pulse) is dependent on the desired percentage dimming. I believe a pulse of this width should turn the triacs on and they’ll go off on their own at the next ZC. I don’t have a dimmer unit here to verify this…

dual_triac.ino (8.2 KB)

you could use the TriacDimmer library

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.