New dimmer driver AC 250V with zero-cross and Tasmota #14978
Replies: 13 comments · 106 replies
-
€ 3,09 5% Off | AC Light lamp dimming and motor Dimmer Module, 1 Channel, 3.3V/5V logic, AC 50/60hz, 220V/110V - 600V This is one of the supported devices |
Beta Was this translation helpful? Give feedback.
All reactions
-
I wrote you in issue #8789. I have exactly this dimmer module (model for 8A), but I only have ESP32, which is not supported as you wrote ... |
Beta Was this translation helpful? Give feedback.
All reactions
-
That's great. We are working on the ESP32. Current problem is we cannot set frequency to fraction of integer. E.g. 50.1Hz does not work. Only 50Hz |
Beta Was this translation helpful? Give feedback.
All reactions
-
Bad news. Do all 3 lamps dim differently? Is 100% flicker free? Any freezes or reboots? Sometimes Wemos goes down and restart. One time it totally stuck. Newest development build Fade on |
Beta Was this translation helpful? Give feedback.
All reactions
-
I have it also now running with esp8266 and 3 dimmers and works fine for me. Your configuration is ok. I would just avoid using: D3 and D0. They also have additional functionality on boot. The ESP32 is still not running. I can confirm blinking on ESP32. With the current DEV Version 11.0.0.4 on esp8266 I see stable 3 dimmers on all 3 PWM channels and they also dim independent. |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
Beta Was this translation helpful? Give feedback.
All reactions
-
I also see, that there might be flickering if the dupont wires are not correctly inserted. Any oxidation cause problems. Specially control PWM wires. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Maybe on the weekend I'll try to solder all the wiring and skip the breadboard. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Next attempt. I'm facing issue. When I disconnect wires between PWM1&COUNTER1, PWM2&COUNTER2 and PWM3&COUNTER3, Any suggestions? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Any news regarding the ESP32 WROOM? I may need some help. I have changed different GPIO suspecting pins 15, 2, 0 would influence the functionality, but without success. The version is 12.2.0 Is there something wrong on my setup or ESP32 version still needs work on AC dimming? What is the purpose of "ZC Pulse" assignment for a GPIO. |
Beta Was this translation helpful? Give feedback.
All reactions
-
As it is mentioned in the documentation the AC Dimmer does not work on ESP32 because of the Limitation to change frequency on a mHz resolution. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I thought a solution was found. So a solution would be to have another uC driving the triac (ProMini or Nano with a separate code) using the zero cross and the power variation coming from the ESP32 as a dutycycle signal or a analog voltage. |
Beta Was this translation helpful? Give feedback.
All reactions
-
This is nothing I am aware off. I just use for this special case an esp8266 and done. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @stefanbode, |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, sometimes I need a night to get awesome ideas. Yesterday the limit was the 50 microsecond minimal Intervall. This allows on a half sine wave (10 Milli seconds) to stop at 200 positions. So 0..100% without float seems enough. Now i have a new version that is able to fire with accuracy of 1 micro second. Now I have 10.000 stop positions. Zcdimmerset now start making sense. |
Beta Was this translation helpful? Give feedback.
All reactions
-
#18518 submitted the change. Also the 10.000 stop per sine wave if reliable. And no more issue with savedata. Can be used again without limitation |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Hi @stefanbode, |
Beta Was this translation helpful? Give feedback.
All reactions
-
Let me check in this. The Esp8266 trigger process is completely different. The esp32 was rock stable. Let me see if there is an issue with the esp8266. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm curious what you find out. BTW: I made a PR to update the images in the docs. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Are there any more plans on ESP32? I'm happy to try to contribute but I'm much more familiar with ESP8266 - however I've ended up with a sonoff ESP32 device which I'd like to control a Robotdyn dimmer with. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @thigger , the problem is in the ESP32 library that come from Espressif. I only know methods to set the frequency on integer values. So 50Hz or 51Hz. Whenever you find a method on ESP32 to set frequency e.g. to 50.003 Hz I'm back in the game. On ESP8266 there is startWaveformClockCycles(Pin(GPIO_PWM1, i), cc/2, cc/2, 0, -1, 0, false); This does not exist on ESP32 afaik. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes. There is one interrupt on the zero cross. This is same as I do. Then they call every 0.001ms the check. Maybe 0.005ms. The sinus is 10ms long in Germany. So the slice it in 2000 stripes. Should be more than enough for accuracy. The load can be a problem. But the code is running. Tasmota should not be different. My concern was calling a check in this high frequency reliable. I will Check if this works. Assume yes. |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thank you. Happy to test and/or try to help code on the assumption there's a spare timer interrupt I can use. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Just in coding the new dimmer. If it works this can be great enhancement also to ESP8266. Currently struggling with the xx µs, interrupt. Will not start as want it.... |
Beta Was this translation helpful? Give feedback.
All reactions
-
There is still flickering because the INTERRUPT triggers neither on the ZeroCross nor on the ON/OFF are reliable. ESPHome did some tricks, but in this area I have no problems. Need to check how to overcome the issue |
Beta Was this translation helpful? Give feedback.
All reactions
-
Ok, Success. I have submitted the new ESP32 code. There are some changes making the lice easier: |
Beta Was this translation helpful? Give feedback.
All reactions
-
Current pull request: #18481 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Can you confirm your heartbeat is somewhere at 100Hz? Will now compile a version with your settings |
Beta Was this translation helpful? Give feedback.
All reactions
-
The heartbeat is not nearly 100 Hz. It is the heartbeat function of tasmota, just to trigger an interrupt. The reboots happen also in the real environment on the 8285. The 4M version is now running stable since 1.5 hours, but as we have seen, we have wait longer... |
Beta Was this translation helpful? Give feedback.
All reactions
-
Status report: The 4M version is running 3:50 h without script and 3 h with script and all commands enabled. No reboot till now. I'm very confused. Same code, same IDE, same device, same environment. The only difference was the change from |
Beta Was this translation helpful? Give feedback.
All reactions
-
I built a new 1M image from the scratch and put it on the Wemos D1. It is up for over 8 hours. The same file on the 8285 causes reboots. I did a |
Beta Was this translation helpful? Give feedback.
All reactions
-
I found the bug. When I compile with |
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for everything you've done with this - finally wired everything up today and can see with the oscilloscope that it's working perfectly on a Sonoff Pow Elite. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I assume you will get it running if changing the mosfet. I assume a triac that costs a bit more will solve your problem immediately |
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks - I'll have a look. Do you happen to know any good ones? In the meantime I thought I'd try with an SSR and using PWM at 2Hz - but at least your code works perfectly on my ESP32 device! |
Beta Was this translation helpful? Give feedback.
All reactions
-
I've realised for my use-case that it's best to work in "burst mode" - ie 50% = full cycle (20ms) on, full cycle off, 10%=20ms on, 180ms off, 66% = 40ms on, 20ms off - or even 20ms on, 10ms off. The "on" periods need to be multiples of 20ms, off periods can be half-cycles. I'd be quite keen to add this - should I try to add it to your existing driver (or is it something you've already considered adding?), or would it be preferable for me to create a new "burst mode ZC" driver? |
Beta Was this translation helpful? Give feedback.
All reactions
-
What you want to implement is not a leading edge dimmer. Please take a look at Wikipedia how this work. You want to skip partly half or full waves. This is not how a dimmer should work. Also with this approach there is no fine granular dimming possible. If you try to dimm a pump or other asynchron motor you should not invest. A frequency change device is how you should do it. Anyhow if you want to create your own dimmer feel free to enhance or write you own driver. Second is maybe better to avoid dependencies and let people choose what they want. |
Beta Was this translation helpful? Give feedback.
All reactions
-
https://github.com/thigger/Tasmota/tree/ZCPulseSkip Pulse Skip Modulation dimmer |
Beta Was this translation helpful? Give feedback.
All reactions
-
@stefanbode Can you advise where this is upto in the context of tasmota builds now ? Is this ready to use/try. I have an immersion heater that i would like to try and control using the Robotdyn dimmer module with excess solar power and send commands to it from Node Red using MQTT - is your code included in the standard versions of Tasmota ? Thanks for all the effort you have made to get this to this point so far Craig |
Beta Was this translation helpful? Give feedback.
All reactions
-
@Gifford47 Do you mean trying to run Tasmota on the Arduino Mega? I don't think that's possible, though it wouldn't be hard to write an Arduino sketch which implements pulse-skip dimming based on my driver. You'd have to find a way to pass values from the ESP32 though - I haven't tried TasmotaClient but it looks like the kind of thing that might be extendable in this way. However, an ESP32 is more than capable of doing all this by itself - that's what I'm using, along with power monitoring (Sonoff Pow Elite 20A device). |
Beta Was this translation helpful? Give feedback.
All reactions
-
I have a esp32 board with tasmotaclient and an atmega328p which are connected to each other. I would like to handle all the heater and security stuff by the atmega and the esp is for the rest of communication. Therefore I would like to port your version to an avr device without tasmota. |
Beta Was this translation helpful? Give feedback.
All reactions
-
It is open source. Feel free to do so. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Isn't the zcdimmer documented? I can only find the configuration of the robotdyn module under the light section. |
Beta Was this translation helpful? Give feedback.
All reactions
-
No this is the only one. Added for people what want to fine adjust the power limit |
Beta Was this translation helpful? Give feedback.
All reactions
-
I still have flickering and random flashes "disco" (continuously flickers and goes 0% or 100% for a fraction of a second in each 5-10s) Tasmota 13.3.0(tasmota32) - currently latest Config: Tried, but no help, reverted the changes: I run out of ideas. |
Beta Was this translation helpful? Give feedback.
All reactions
-
In case of ESP8266 and Tasmota v13.3.0 on NodeMCU V2:
It always crashes sooner or later, when the dimmer is running. If the dimmer is off, it can run forever (after 30 minutes I think this is stable). Loglevel 4, web console, Dimmer 20, crash after ~3min - 1
Loglevel 4, web console, Dimmer 20, crash after ~3min - 2
Loglevel 4, web console, Dimmer 20, crash after ~3min - 3
Loglevel 4, web console, Dimmer 20, crash after ~3min - 4
Loglevel 2, web console, Dimmer 20, crash after ~8min
|
Beta Was this translation helpful? Give feedback.
All reactions
-
ESP-M2 with v13.3.0 also crashes after a few minutes when dimmer is on (20%) (no UI, loglevel 2, managed through mqtt). |
Beta Was this translation helpful? Give feedback.
All reactions
-
One more info: before ESP8266 crashes, the dimmer flickers strongly for ~1s, then crashes. (I've tried to add 100nF and 10uF caps to the 3.3V power line, nothing changed.) |
Beta Was this translation helpful? Give feedback.
All reactions
-
I checked the same config here and do not see any crashes for hours and days. Running current esp8266 wemos mini. Esp32 is a different animal. Timing works completely different. The logs I see looks as expected. As the dimmer works with interrupts can you disable just for testing any i2c or other stuff. Will be a difficult debugging if I cannot reproduce. |
Beta Was this translation helpful? Give feedback.
All reactions
-
There were only this dimmer PWM/Counter configured, so in theory nothing else should run. I will make a complete config reset (delete the "past"), and reconfigure them, maybe something remained active. My other guess is my ISP's router. I'm quite sure it doesn't keep proper WiFi protocol (all the Tasmotas connected to it regularly lose WiFi and a Rule restarts them, same devices connected to different routers working fine), so I will plug in my spare Mikrotik and test these dimmer-restarting ESP8266 boards with this Mikrotik router. In a few days I will report the results. |
Beta Was this translation helpful? Give feedback.
-
Because of missing hardware I'm searching for people trying the new advanced zero cross dimmer. These 250V dimmers cut the AC sine wave and create a dim effect. My old driver was only capable of one dimmer. New one can do 3. Additionally the old one trend to pulse a bit on low light if the frequency on your mains power system change quickly. All history, hopefully.
Configuration:
Newest development build
PWM1 and Counter1 connected.
PWM2 and Counter2 connected.
PWM3 and Counter3 connected.
Counter4 connected to one of the zero-cross pins.
Setoption68 1 to get 3 independent dimmer
Pwmfrequency 100 ok for most EU mains.
Setoption60 1
Optional
Fade on
Speed 40
Questions:
Do all 3 lamps dim differently?
Is 100% flicker free?
Any freezes or reboots?
Beta Was this translation helpful? Give feedback.
All reactions