-
Notifications
You must be signed in to change notification settings - Fork 29
About dimmer boards
Based on my experience and the community's suggestions, this is a list of the known boards that are compatible with this library:
- ⭐ Krida Electronics 8-channel dimmer: close source, expensive but it provides high quality circuitry. Available in different sizes (1, 2, 4, or 8 channels).
- RobotDyn 1-channel dimmer: open-source schematic and cheap board. Available in different sizes (1, 2, or 4 channels).
- Dan TStar's zero cross detector: high-quality zero-cross detector, similar to the Krida's. The schematic is open-source and it is only available on PCBWay. Thanks to mathieucarbou for suggesting and testing it!
Each board has its own peculiarities, but in the following lines I want to discuss the details about the zero-cross waveform, since it may introduce sneaky misbehavior hard to debug without an oscilloscope. Ideally, the circuit should generate an ideal impulse, but in reality, it may be triggered before the real zero-cross, or it may be too short or not enough "squared" for the MCU. Moreover, you cannot assume that the interval around 0V is symmetric due to non-ideal circuitry.
In the following picture, you can see how much the slew rate differs between Krida's and RobotDyn's boards.
Legend: zero-cross signal output of Krida's board (yellow) vs RobotDyn's one (blue).
The yellow signal seems like a real impulse w.r.t. the blue one, which seems like an analog waveform. If you do not handle properly these not-ideal signals, you may get sporadic unwanted interrupts which may break the application. This aspect is also influenced by the specific MCUs, which may provide hardware filter that may mitigate this issue (spoiler: ESP32 is particular bad in this task).
The same discourse applies to Dan TStar's zero-cross circuit:
Legend: zero-cross signal output of Dan TStar's (left) vs RobotDyn's (right), courtesy of mathieucarbou.
A practical solution to improve the RobotDyn's signal is inserting a Schmitt trigger after the Zero-Cross pin. However, the signal may still remain very long. For example, if you consider the TI SN74LVC1G17 and do a few calculi based on the previous screenshot, you get the ZC signal high-level 440us long (w.r.t. 180us of Krida's), leading to a high error w.r.t. to the real 0V instant. Of course, you can pick another Schmitt trigger with adjustable threshold and tune it.
If you can't modify the hardware, this library provides a filter on zero cross signal which may help to solve the issue. This feature is disabled by default (look at FILTER_INT_PERIOD
constant in the source code for more details).
The AC wave presents a negative and positive semi-period. To handle positive and negative voltage, the circuitry requires a diode bridge or a bidirectional opto-isolator. These components may present internal differences, so the detection of 0V may slightly vary between the 2 periods. In the following picture, you can see this phenomenon.
The left picture shows the comparison between Krida's and RobotDyn's dimmer. The resolution is low, but you can see that RobotDyn presents 2 different peaks, while Krida's is pretty symmetric. The right picture presents the zoom on RobotDyn ZC wave with ghost trace enabled: the 2 different peaks are clearly visible. The error introduced by this phenomenon is negligible for most applications, but you should consider it while debugging, designing the circuitry or fine-tuning the delivered power.
NOTE: even the picture in the About dimmer boards#Slew rate chapter has the ghost trace enabled, so you can see that Krida's is very symmetric w.r.t. to RobotDyn's dimmer.
In general, if you can choose, I suggest buying the Krida's boards which are trouble-free (I'm not affiliated with them).