-->
Page 1 of 1

microseconds timer for dimming purposes

PostPosted: Thu Dec 29, 2016 4:45 am
by Matys
Hello there!
im trying for days to implement 2 channel dimmer using ESP8266 but i cannot find any usable timer to achieve that.
neither timer0, timer1, ticker library ( with US function implemented ) does not work properly. I cant even make it to work using micros() to avoid delays.

is there any progress with the timers to fire below 100us ?

Re: microseconds timer for dimming purposes

PostPosted: Fri Dec 30, 2016 5:00 am
by trackerj
Been there, done that for a while. Conclusion: Use a dimmer that has integrated Phase detection/ZCD functions and let ESP8266 be exactly what is designed to be, the application WIFI controller.

An example of such a board can be find here: http://www.esp8266.com/viewtopic.php?f=13&t=10331

Combine it with a PWM extension board like this one and you have a 16 CH AC MAINS Dimmer solution.

Also integration example with Domoticz: http://www.esp8266.com/viewtopic.php?f=12&t=12812

Re: microseconds timer for dimming purposes

PostPosted: Tue Jan 03, 2017 5:10 pm
by Matys
Yeah, the thing is that i dont want to use any external PCBs as it has to fit in wall behind the switch :)
i have managed to use NMI timer to dim 2 channels , control it via buttons and inlcude MySensors gateway for Domoticz controler and yet, get a temperature readings from DS18B20 ! 8-)

at the moment it works stable for like an hour or so, but during development it crashed at random ( due to weak power sorce perhaps - im using FTDI232 but it will get its own stable power source so i will let you know if that was the case )

Another problem is flickering.. at lower levels its noticable , not much but still annoying.

Re: microseconds timer for dimming purposes

PostPosted: Sun Feb 05, 2017 11:44 am
by Jesper Dam
Hello Matys. Did you ever manage to remove the flickering?. I have the exact same problem with my dimmer circuit. The hardware timer isn't accurate enough and I see flickering in the lower levels. I'm using Sming and it seems that the NMI timer interrupt isn't implemented yet.

Matys wrote:Yeah, the thing is that i dont want to use any external PCBs as it has to fit in wall behind the switch :)
i have managed to use NMI timer to dim 2 channels , control it via buttons and inlcude MySensors gateway for Domoticz controler and yet, get a temperature readings from DS18B20 ! 8-)

at the moment it works stable for like an hour or so, but during development it crashed at random ( due to weak power sorce perhaps - im using FTDI232 but it will get its own stable power source so i will let you know if that was the case )

Another problem is flickering.. at lower levels its noticable , not much but still annoying.