MPDMv4 - Universal AC MAINS Dimmer Board usage

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

MPDMv4 - Universal AC MAINS Dimmer Board usage

#1 Post by trackerj » 01 Dec 2016, 11:03

Hi Everybody,

This is my first post here so first of all I want to say "Hello" to everybody and also want to thank you, the guys who are working hard to develop and mantain the ESPEasy Firmware.


As been the designer of the MPDMv4 Ac dimmer Board and as been repeatedly asked about running ESPEasy together with the MPDMv4 Universal Dimmer Board I have run some extensive tests these days and have also come with some conclusions that I want to share with you.

What hardware setup I have used for testing:
- ESP8266 NextEVO Board
- MPDMv4 Universal AC Dimmer
- PCA9685 16CH PWM Extension board
- MPRSx8 Home Automation Board
- ESP Easy firmware: latest available bin
- Raspberry PI 2 Board
- Domoticz : Lates available bin on a Raspberry PI 2 Board : sudo curl -L install.domoticz.com | bash

First thing that I want to mention, as I found that a lot of people sometime forget about this simple one: You DAC/ADC/PWM, etc Input/Output is as good as your Power Supply/Voltage regulator!! If you have a crap power supply/regulator with bad filtering & stuff, don't expect miracles happening!

You have at least 3 ways to drive a MPDMv4 AC Dimmer:

1. ESP8266 PWM output: It is working OK as long as you don't have any blocking process running on the ESP8266 that can badly interrupt your PWM signal (1/2 second and more). With a bit of attention to some details and also for not to complicated lighting setup scenarios is working very nice. I will upload a Youtube Video showing you the MPDMv4 AC Dimmer working OK driven by ESP8266 PWM pin, connected as a daughter board on the MPRSx8 Home Automation board. From Domoticz you can drive thru ESPEasy the MPRSx8 8ON/OFF AC Relays AND MPDMv4 AC Dimmer channel without any problems at all!

MPDMv4 AC Dimmer board has a first order filter on the VCNT input so can handle even noisy PWM and decent level of duty cycle skipping/derating.

2. Dedicated PWM IC. Used with a lot of success the PCA9685, working very smooth and has no problem related with ESP8266 workload process, etc. You can find more about a PCA9685 Board here. Probably the best solution for mutiple AC Dimmer boards (upto 16 per each PCA9685 Extension Board).

3. Digital drive using DAC. Used for VCNT input a MCP4726 12 bit DAC, same as with PCA9685, working very smooth and has no problem related with ESP8266 workload process, etc. As been a 12 Bit DAC it's giving you very fine VCNT control. I have designed also a Dimmer board with integrated DAC and digital control, but that's another story.

Please give me few days to put together all the data and upload the related Tutorials and Videos on Youtube.

Happy breadboarding,
TJ.
Last edited by trackerj on 03 Jan 2018, 09:16, edited 1 time in total.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#2 Post by trackerj » 03 Dec 2016, 11:14

Hi Everybody,

I have released Part 1 of the ESP Easy Firmware related Series, original Article can be found here: ESP Easy Part 1: Firmware upload and simple PWM tets with MPDMv4 AC Dimmer Board

Youtube Video: http://www.youtube.com/watch?v=QDApd7UMsOI

Image

In Part 2 will continue with Domoticz interface setup for ther MPDMv4 AC Dimmer Board.

Happy breadboarding,
TJ.
Last edited by trackerj on 03 Jan 2018, 09:19, edited 1 time in total.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#3 Post by trackerj » 06 Dec 2016, 09:18

Part2 : Domoticz + RaspberryPI + ESP8266 nEXT EVo + ESPEasy + MPDMv4 Universal AC Dimmer Board setup

I was looking for a while for a simple solution to be able to turn ON/OFF and also properly change light levels for the MPDMv4 AC dimmer board. The main encountered problem was related with the ability to save the dimmer level when pressing "OFF" button and to return to the same level when "ON" again. The only solution that I found working OK was to use Events combined with a custom LUA script.

If you have any better idea how can be done simpler than that will be more than happy to hear about :)

More details, code,etc can be found here in the original post.

The LUA script might work OK also with others Dimmer Units, probably just need to tweak the values accordingly.

You can find also on Youtube a Video with a step-by-step setup walk-through for the AC Dimmer:
http://www.youtube.com/watch?v=_cwes-c_UzY

Image

Happy breadboarding,
TJ.
Last edited by trackerj on 03 Jan 2018, 09:20, edited 1 time in total.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#4 Post by DeNB3rt » 06 Dec 2016, 11:25

thanks dude! :!:
I'll test it today.
My MPDMv4 arrived today by plane ;)
shipped 2/12/2016
Attachments
15320229_347707085607519_1616464262_n.jpg
15320229_347707085607519_1616464262_n.jpg (34.59 KiB) Viewed 43046 times
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#5 Post by trackerj » 06 Dec 2016, 18:10

Hi DeNB3rt,

You said you hope it will quick shipped, it was quick delivered :)

Enjoy!

Happy breadboarding,
TJ
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

kroonen
Normal user
Posts: 26
Joined: 05 Oct 2015, 22:00

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#6 Post by kroonen » 06 Dec 2016, 20:40

Does the board work with a dimmable 230v led bulb?

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#7 Post by trackerj » 06 Dec 2016, 21:43

kroonen wrote:Does the board work with a dimmable 230v led bulb?
If it is a true dimmable LED lightbulb (designed to be dimmable) should work ok. But please be aware that most of the cheap chinese ones even if is painted on them "dimmable" has inside just a simple constant current PSU.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#8 Post by DeNB3rt » 07 Dec 2016, 19:15

Haha indeed, fast shipping.
Nice board Quality!
Do work out of the box connected on my gpio on my nodemcu ( instead of resistor with led)
Tested directly with An led bulb from Ikea 5w dimmable.
Dimming level 870 maximum (above flickers).

Did not get the domoticz lua working.
Could it act different on a Windows based domoticz?
I'll try once again Tonight.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#9 Post by trackerj » 08 Dec 2016, 08:38

DeNB3rt wrote:Haha indeed, fast shipping.
Nice board Quality!
Do work out of the box connected on my gpio on my nodemcu ( instead of resistor with led)
Tested directly with An led bulb from Ikea 5w dimmable.
Dimming level 870 maximum (above flickers).

Did not get the domoticz lua working.
Could it act different on a Windows based domoticz?
I'll try once again Tonight.
Great!
Can you please provide the IKEA LED lightbulb model you have used please? can be very helpful also for other people.
Regarding running Domoticz on Windows, to make that LUA script working I think you need to install also CURL. Be sure that is in PATH.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#10 Post by DeNB3rt » 08 Dec 2016, 11:45

Hi Trackerj

thanks for the feedback.
Still no working, but I tried something different.

I went to Setup > More options > Events
domoticzlua.png
domoticzlua.png (131.75 KiB) Viewed 42928 times
I created a the script there with LUA.
Still not working, but I can see that the 'dimm' variable is changed in the 'User variables'.

Also the log is telling me that the calculation is done, i created a print(runcommand); to see the url, also that one seems ok.
But the request seems not to arrive at the ESP module.
Very weird, because the same url call do work in my browser :?

Log:
2016-12-08 11:36:16.034 User: bert initiated a switch command (12/MPDMv4_Dimmer/Set Level)
2016-12-08 11:36:16.440 LUA: MPDMv4_Dimmer
2016-12-08 11:36:16.440 LUA: Set Level: 22 %
2016-12-08 11:36:16.440 LUA: device state Set Level: 22 %
2016-12-08 11:36:16.440 LUA: Other
2016-12-08 11:36:16.440 LUA: dimm Level = 684
2016-12-08 11:36:16.440 LUA: curl 'http://192.168.0.231/control?cmd=pwm,4,702'
2016-12-08 11:36:16.511 LUA: PWM calculated value= 702
2016-12-08 11:36:16.624 EventSystem: Script event triggered: script_device_MPDMv4_Dimmer



The used led bulb is the Ikea 'LEDARE' GU10 6W 400lumen.
http://www.ikea.com/us/en/catalog/products/20304661/
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#11 Post by trackerj » 08 Dec 2016, 13:09

DeNB3rt wrote:Hi Trackerj

thanks for the feedback.
Still no working, but I tried something different.

I went to Setup > More options > Events

domoticzlua.png

I created a the script there with LUA.
Still not working, but I can see that the 'dimm' variable is changed in the 'User variables'.

Also the log is telling me that the calculation is done, i created a print(runcommand); to see the url, also that one seems ok.
But the request seems not to arrive at the ESP module.
Very weird, because the same url call do work in my browser :?

Log:
2016-12-08 11:36:16.034 User: bert initiated a switch command (12/MPDMv4_Dimmer/Set Level)
2016-12-08 11:36:16.440 LUA: MPDMv4_Dimmer
2016-12-08 11:36:16.440 LUA: Set Level: 22 %
2016-12-08 11:36:16.440 LUA: device state Set Level: 22 %
2016-12-08 11:36:16.440 LUA: Other
2016-12-08 11:36:16.440 LUA: dimm Level = 684
2016-12-08 11:36:16.440 LUA: curl 'http://192.168.0.231/control?cmd=pwm,4,702'
2016-12-08 11:36:16.511 LUA: PWM calculated value= 702
2016-12-08 11:36:16.624 EventSystem: Script event triggered: script_device_MPDMv4_Dimmer



The used led bulb is the Ikea 'LEDARE' GU10 6W 400lumen.
http://www.ikea.com/us/en/catalog/products/20304661/
Nice lightbulb at a very good price. Might be a good idea to make a visit to IKEA these days :)

Probably LUA script PATH is also different on Windows, somebody with more Domoticz Windows version experience can say more.
From LOG file I can say that It looks OK now, did you have also installed the CURL ?

After having it properly installed you can test it by running the VCNT Commands directly from the command prompt:
It's the best way to see that CURL is ok installed, not bloked by Windows AV/Firewall, etc.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#12 Post by trackerj » 08 Dec 2016, 13:45

I've give it a try under a Windows 7 Home Premium (is the only Windows I could find around quick) and is working very well.
Process was pretty straight forward:
1. Install Domoticz
2. Install CURL
3. Save LUA script in Domoticz \scripts\lua folder
4. Check that you don't have any Firewall/AV/Whatever program blocking the Network IN/OUT traffic for the needed programs and Ports !

Indeed, for the Windows installed version of CURL used I was forced to change a bit the sintax, nothing fancy, just see below:

Code: Select all

   runcommand = "curl http://" .. IP .. "/control?cmd=PWM,"  ..PIN.. "," .. CalcValue .. " ";
Anything else remain the same.

Will do a Youtube Setup Video if is any interest of Windows installation and setup, just let me know.

Happy breadboarding,
TJ.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#13 Post by trackerj » 08 Dec 2016, 14:16

Added Part 3 - Domoticz for Windows + ESPEasy + MPDMv4 AC Dimmer Setup
You can find the updated LUA script & stuff HERE
Last edited by trackerj on 03 Jan 2018, 09:21, edited 1 time in total.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#14 Post by DeNB3rt » 08 Dec 2016, 17:12

trackerj wrote:I've give it a try under a Windows 7 Home Premium
Amazing! I'll give it a try when I'm home.
AV and ports were ok (sending commands to relay's without LUA was already working).
But I don't have CURL indeed :-)

I was already having a look for

Code: Select all

http = require "socket.http";
result, statuscode, content = http.request(runcommand);
but also there I'm missing the socket.http ;)

I'll check it tonight many thanks! :D
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#15 Post by DeNB3rt » 08 Dec 2016, 17:14

trackerj wrote: Nice lightbulb at a very good price. Might be a good idea to make a visit to IKEA these days :)
If I get it to work, I'll make a video of the led bulb in action with the MPDMv4 :geek:
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#16 Post by DeNB3rt » 11 Dec 2016, 19:41

late reply, someone with the same issue on windows?
Curl installed, but still nothing is moving :shock:

downloaded Curl from (64bit):
http://www.confusedbycode.com/curl/#downloads

domoticz log:

Code: Select all

2016-12-11 19:38:09.103 User: domoticz initiated a switch command (12/MPDMv4_Dimmer/Set Level)
2016-12-11 19:38:09.669 LUA: MPDMv4_Dimmer
2016-12-11 19:38:09.673 LUA: Set Level: 30 %
2016-12-11 19:38:09.673 LUA: device state Set Level: 30 %
2016-12-11 19:38:09.673 LUA: Other
2016-12-11 19:38:09.673 LUA: dimm Level = 666
2016-12-11 19:38:09.673 LUA: PWM calculated value= 630
2016-12-11 19:38:09.673 LUA: curl http://192.168.0.231/control?cmd=PWM,4,630
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#17 Post by trackerj » 11 Dec 2016, 22:02

DeNB3rt wrote:late reply, someone with the same issue on windows?
Curl installed, but still nothing is moving :shock:

downloaded Curl from (64bit):
http://www.confusedbycode.com/curl/#downloads

domoticz log:

Code: Select all

2016-12-11 19:38:09.103 User: domoticz initiated a switch command (12/MPDMv4_Dimmer/Set Level)
2016-12-11 19:38:09.669 LUA: MPDMv4_Dimmer
2016-12-11 19:38:09.673 LUA: Set Level: 30 %
2016-12-11 19:38:09.673 LUA: device state Set Level: 30 %
2016-12-11 19:38:09.673 LUA: Other
2016-12-11 19:38:09.673 LUA: dimm Level = 666
2016-12-11 19:38:09.673 LUA: PWM calculated value= 630
2016-12-11 19:38:09.673 LUA: curl http://192.168.0.231/control?cmd=PWM,4,630
Are you sure CURL is installed OK and location is in PATH?
A very simple check test is to run CURL command directly from command prompt.

See below how is looking a command prompt CURL test and the ESPEasy response on the serial port:

Image
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#18 Post by DeNB3rt » 12 Dec 2016, 17:04

Hi Trackerj!

Thanks for the hint, indeed curl error
1.png
1.png (23.08 KiB) Viewed 38710 times
Tried to install win32 version, and that is giving an c++ 2015 redistributable is needed.
2.png
2.png (37.74 KiB) Viewed 38710 times
I aborted that install, and tried to install c++ 2015 redistributable x64, but it keeps at 100% forever :(
3.png
3.png (27.57 KiB) Viewed 38710 times
I found around the net that I should do windows update, also err, aarrrghl :x .
4.png
4.png (26.93 KiB) Viewed 38710 times
finally:
5.png
5.png (39.82 KiB) Viewed 38710 times

So this is more likely a windows issue (my install is 3years old), I think I'm going to format c: this piece of sh*t and start over again.
What version of windows 7 did you use? with latest updates etc?
I'll try it on another computer to see what Curl is doing there :) .
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#19 Post by trackerj » 12 Dec 2016, 18:25

Did not encountered any installation problems, it was a few minutes straight & easy process.
Extracted CURL.exe and moved it in a directory already existing in PATH (aka Windows directory, shame on me :) ).
Windows OS used: Windows 7 home premium/64bit updated upto current date.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#20 Post by DeNB3rt » 12 Dec 2016, 19:01

trackerj wrote: Extracted CURL.exe and moved it in a directory already existing in PATH (aka Windows directory, shame on me :) ).
haha awesome!
You saved me from formatting my pc :D
I was looking way to far, endless updates, extracting, installing etc...
Just copy paste curl.exe in the c:\windows folder did the trick :D
now a smooth working dimmer!
many thanks!

A little point for me, when sending pwm value 870 (minimum led brightness for me) I can't realy shut the dimmer to 'off' because that's the lowest value :-) (otherwise it's going to flicker).
I could fix this by placing a relay before the mpdm board to shut off the AC power.
This would prevent leaks or whatever.
I can edit the script to send a curl :D to a different gpio with a relay connected to it ;)
Or what are your thoughts :)
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#21 Post by trackerj » 12 Dec 2016, 22:23

DeNB3rt wrote:
trackerj wrote: Extracted CURL.exe and moved it in a directory already existing in PATH (aka Windows directory, shame on me :) ).
haha awesome!
You saved me from formatting my pc :D
I was looking way to far, endless updates, extracting, installing etc...
Just copy paste curl.exe in the c:\windows folder did the trick :D
now a smooth working dimmer!
many thanks!

A little point for me, when sending pwm value 870 (minimum led brightness for me) I can't realy shut the dimmer to 'off' because that's the lowest value :-) (otherwise it's going to flicker).
I could fix this by placing a relay before the mpdm board to shut off the AC power.
This would prevent leaks or whatever.
I can edit the script to send a curl :D to a different gpio with a relay connected to it ;)
Or what are your thoughts :)
Nice to hear that you made it !
I am not a Windows guy at all, I'm very happy with the RaspberryPI setup :)

You can switch it full off (cutting the Vcc power for the MPDMv4 module) from a gpio pin using a relay, mosfet, etc, your choice.
OR you can use a MAINS relay as you said, as a general AC power OFF with the obvious advantage to be able to cut all OFF.

PS: regarding you Windows updates, if is a 3 years old installation I would think to solve the issues shown above and try to bring it up to date. Better playing a bit safe than sorry.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#22 Post by DeNB3rt » 13 Dec 2016, 11:09

Indeed, I already thought about switching to Raspberry, but I'm a .NET developer :geek: .
So my old homebrewn domotic system (NRF24-arduino-networkshield) was based on a .NET API before I am using Domoticz now.
When my setup is finished, I could switch to RBP.
The RBP would use less power, although my current system is using an Atom ION 330 with 4gb.
At least one of the best X86 systems <30watts full load.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#23 Post by trackerj » 14 Dec 2016, 20:33

DeNB3rt wrote:
trackerj wrote: Nice lightbulb at a very good price. Might be a good idea to make a visit to IKEA these days :)
If I get it to work, I'll make a video of the led bulb in action with the MPDMv4 :geek:
Any chance to see some action? :)

That lightbulb looks interesting and I think to pay a visit to IKEA next week :D
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#24 Post by DeNB3rt » 15 Dec 2016, 10:37

trackerj wrote:Any chance to see some action? :)

That lightbulb looks interesting and I think to pay a visit to IKEA next week :D
:D yes yes, I know.

OFF/ON is already fixed with relay.

Code: Select all

 
  if(devicechanged[DomDevice]=='Off') then
     print ("OFF dimm stored value = "..uservariables['dimm']);
     CalcValue = 870;
     -- 1=off for relay
     runcommand = "curl http://" .. IP .. "/control?cmd=gpio,"  ..RELAYPIN.. ",1" .. " ";
     print("Relaypin " .. RELAYPIN .. " OFF command " .. runcommand);
     os.execute(runcommand);
I also edited the pwm calculation (but the result is almost the same).

Code: Select all

 
 valuetoround = 870*(DomValue/100);
         mult = 10^(0 or 0);
         CalcValue = math.floor(valuetoround * mult + 0.5) / mult;
         CalcValue = 870 - CalcValue;
But the most magic is happening for leds between 0% and 50% slider, above is not realy giving a visual difference.
  1. 100% slider > pwm = 0
  2. 50% slider > pwm = 435
  3. 1% slider > pwm = 870
So I think about rescaling it by changing my first value 870 to 435 and making a difference for slider values above > 99%.
If it is 100% I will overrule it by placing the pwm value on 0 (think about unstress the led bulb/mpdm board ;) ).

Code: Select all

 
 valuetoround = 435*(DomValue/100);
         mult = 10^(0 or 0);
         CalcValue = math.floor(valuetoround * mult + 0.5) / mult;
         CalcValue = 870 - CalcValue;
  • 99% slider > pwm = 440
  • 50% slider > pwm = 653
  • 1% slider > pwm = 866
What are your thoughts? ;)
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#25 Post by trackerj » 15 Dec 2016, 12:37

DeNB3rt wrote:
trackerj wrote:Any chance to see some action? :)

That lightbulb looks interesting and I think to pay a visit to IKEA next week :D
:D yes yes, I know.

OFF/ON is already fixed with relay.

Code: Select all

 
  if(devicechanged[DomDevice]=='Off') then
     print ("OFF dimm stored value = "..uservariables['dimm']);
     CalcValue = 870;
     -- 1=off for relay
     runcommand = "curl http://" .. IP .. "/control?cmd=gpio,"  ..RELAYPIN.. ",1" .. " ";
     print("Relaypin " .. RELAYPIN .. " OFF command " .. runcommand);
     os.execute(runcommand);
I also edited the pwm calculation (but the result is almost the same).

Code: Select all

 
 valuetoround = 870*(DomValue/100);
         mult = 10^(0 or 0);
         CalcValue = math.floor(valuetoround * mult + 0.5) / mult;
         CalcValue = 870 - CalcValue;
But the most magic is happening for leds between 0% and 50% slider, above is not realy giving a visual difference.
  1. 100% slider > pwm = 0
  2. 50% slider > pwm = 435
  3. 1% slider > pwm = 870
So I think about rescaling it by changing my first value 870 to 435 and making a difference for slider values above > 99%.
If it is 100% I will overrule it by placing the pwm value on 0 (think about unstress the led bulb/mpdm board ;) ).

Code: Select all

 
 valuetoround = 435*(DomValue/100);
         mult = 10^(0 or 0);
         CalcValue = math.floor(valuetoround * mult + 0.5) / mult;
         CalcValue = 870 - CalcValue;
  • 99% slider > pwm = 440
  • 50% slider > pwm = 653
  • 1% slider > pwm = 866
What are your thoughts? ;)
I was keeping the CalcValue as simple as possbile to not complicate the driver example example to much. I know it is not a linear response but in this case it really doesn't make to much difference as you migh seen already.

Also It makes a lot of sense to reduce the dimming interval as in your case you are not interested in a full light intensity range (0-100%) as can be measured by a precise LUX Meter for example but more about human eye light perception.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#26 Post by DeNB3rt » 16 Dec 2016, 01:24

trackerj wrote:Any chance to see some action? :)

That lightbulb looks interesting and I think to pay a visit to IKEA next week :D
Here it is sir, 5 Ikea ledare in action with the mpdmv4 board :-)
https://www.youtube.com/embed/bNu2iHsQ6Xo

The strange thing is, now I hear some little vibration when dimming (was not before with only one ledare led bulb) :?:
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#27 Post by trackerj » 16 Dec 2016, 15:21

DeNB3rt wrote:
trackerj wrote:Any chance to see some action? :)

That lightbulb looks interesting and I think to pay a visit to IKEA next week :D
Here it is sir, 5 Ikea ledare in action with the mpdmv4 board :-)
https://www.youtube.com/embed/bNu2iHsQ6Xo

The strange thing is, now I hear some little vibration when dimming (was not before with only one ledare led bulb) :?:
Very nice demo video! :)

You have 5 LED lightbulbs in parallel?
The LED Lightbulbs can be considered actually inductive loads, so, if it really is a audible sound, a proper EMI filter and/or adjusting the snubber cap value (migh try 100n) you can get rid of it. It's more a trial-and-error process than something that can be calculated as you don't have any available related data regarding the loads (LED's). If you change the caps, please keep in mind that you should use proper MAINS X2 grade caps as the ones existing already on the MPDMv4 Board.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#28 Post by DeNB3rt » 11 Jan 2017, 15:28

trackerj wrote:You have 5 LED lightbulbs in parallel?
The LED Lightbulbs can be considered actually inductive loads, so, if it really is a audible sound, a proper EMI filter and/or adjusting the snubber cap value (migh try 100n) you can get rid of it. It's more a trial-and-error process than something that can be calculated as you don't have any available related data regarding the loads (LED's). If you change the caps, please keep in mind that you should use proper MAINS X2 grade caps as the ones existing already on the MPDMv4 Board.

Hi Trackerj,

Yes, the 5 bulbs (30W total) are in parallel.
Still running pefectly in production.
I'm using them daily.
I did not add a filter yet.

I will order a 2nd one for 6 leds in my living room (36W total, now 300W halogen ;) )

But a question, what is the rated power of the dimmer (did not check the triac datasheet yet)

Best wishes for 2017!
Seeya.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#29 Post by trackerj » 12 Jan 2017, 08:04

Hi DeNB3rt,

Nice yo heat that you have sorted out also the Windows problem related with Domoticz setup and all OK now.
The used Triac is a 12A one and default MAINS FUSE value is 4A. As been designed with normal, standard size, lightbulbs in mind it's more than enough. You can go upto 100-120W even without extra heatsink, above that a proper sized heatsink will be needed. I was also used it with 3x105W EcoHalogen lightbulbs but for the new setup now i will replace it with LED's.

On extreme, if you want to do some experiments over that power level, replace the FUSE with the desired value, reinforce MAINS PCB traces (busbar, beefy solder on traces,etc) and even add a bigger Triac :). My 2.4kW Owen looks happy with :). Please keep in mind it's a old fashion resistive one, nothing fancy inside, just 4x600W heating elements.

Wish you also a all the best for the 2017!
TJ.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#30 Post by DeNB3rt » 13 Jan 2017, 13:44

allright thanks!
Did you already buy the Ikea LED's? What's your experience with hem? :)
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#31 Post by trackerj » 14 Jan 2017, 08:25

DeNB3rt wrote:allright thanks!
Did you already buy the Ikea LED's? What's your experience with hem? :)
Did not had the time to go as been busy with a lot of other stuff but it's on my list as I want to use them in a new location setup.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#32 Post by mkotek » 23 Jan 2017, 20:40

Would you be so kind and specify, what exactly (which modules) do I need to purchase in order to be able to control and dim 2 channels of ordinary 230V LED lights via ESP and Domoticz? I got a bit confused by Universal Board, EVO board, dimmer board, etc.

So after watching the videos again, I understand, one needs only the Dimmer board and connection to PWM output on ESP8266 module. Just to confirm, if I want 2 channels controlled, I need 2 dimmer boards, right?
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#33 Post by trackerj » 24 Jan 2017, 10:09

mkotek wrote:Would you be so kind and specify, what exactly (which modules) do I need to purchase in order to be able to control and dim 2 channels of ordinary 230V LED lights via ESP and Domoticz? I got a bit confused by Universal Board, EVO board, dimmer board, etc.

So after watching the videos again, I understand, one needs only the Dimmer board and connection to PWM output on ESP8266 module. Just to confirm, if I want 2 channels controlled, I need 2 dimmer boards, right?
Hi Michal,

The MPDMv4 Universal AC Dimmer Board is a 1 Channel AC MAINS dimmer board only. It is accepting as input a Voltage control (analog control) on the VCNT pin.

For command and control of the MPDMv4 Dimmer board you need a ESP8266 board or any other ARM/Arduino/Raspberry PI/etc MCU board you want to use that can provide a proper VCNT (Voltage Control) for the MPDMv4 Dimmer Board. That Voltage control might be a PWM/DAC signal or even a simple potentiometer, the only thing that matter is to be inside the Dimming interval for your Lightbulb (Youtube video explanation here). See also a deeper description of the Voltage control in this Youtube video HERE

If you want to control 2 separate lightbulbs (channels) then you need to have 2 separate MPDMv4 Boards.

MPDMv4 + ESP8266 + ESPEasy Firmware and Domoticz implementation Videos below:
1 - ESPEasy Series - Part 1 - Firmware upload and MPDMv4 driver simple test
2 - ESPEasy - P2 - Domoticz - RPi - MPDMv4 AC Dimmer setup example
3 - Changes for a Domoticz Windows Setup

Regarding the LED Lightbulb, you need to use a Dimmable one. See above also the LED Lighbulbs used by user DeNB3rt, a nice found at IKEA Shop !

If you have any other questions about I will be more than happy to answer about.

Happy breadboarding,
TJ.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#34 Post by mkotek » 01 Feb 2017, 00:06

I have purchased and received today MPDMv4 dimmers and put one into tests.
All seem to be working fine, but there is one problem - dimming levels are not comparable with demo on YouTube.

You can see the clip showing dimming adjustment from 100% to 50%, then to 5% and all the way to full and to minimum again:
Video clip showing incorrect dimming behaviour (too little dimming)

Unfortunately, as you can see, the dimming is not at all satisfactory.
Bulb used in the test is conventional 100W Osram bulb, but I have also tested other bulbs, including Ledare LED bulbs from IKEA.
ESP8266 used for the test is a Witty cloud development board with ESP-12F:
Image

Test has been run with Witty module powered by PC USB and with separate phone charger (Apple knockoff).

I have also tested, the dimming level is a bit better at 1024 level, but still way less dim than expected, although a bit better then maximum set by LUA script.

Can you please let me know, what can be done about it? Is it the problem with power source for ESP or with PWM cycles generated by ESP or with something else at all?
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#35 Post by trackerj » 01 Feb 2017, 06:52

mkotek wrote:I have purchased and received today MPDMv4 dimmers and put one into tests.
All seem to be working fine, but there is one problem - dimming levels are not comparable with demo on YouTube.

You can see the clip showing dimming adjustment from 100% to 50%, then to 5% and all the way to full and to minimum again:
Video clip showing incorrect dimming behaviour (too little dimming)

Unfortunately, as you can see, the dimming is not at all satisfactory.
Bulb used in the test is conventional 100W Osram bulb, but I have also tested other bulbs, including Ledare LED bulbs from IKEA.
ESP8266 used for the test is a Witty cloud development board with ESP-12F:
Image

Test has been run with Witty module powered by PC USB and with separate phone charger (Apple knockoff).

I have also tested, the dimming level is a bit better at 1024 level, but still way less dim than expected, although a bit better then maximum set by LUA script.

Can you please let me know, what can be done about it? Is it the problem with power source for ESP or with PWM cycles generated by ESP or with something else at all?
Never used a Witty module, but as the only thing that it needs is a variable analog signal on VCNT pin, should work OK without any problems, all way down and up from VCNT voltage control value 0V (full ON) to about 2.9V (890-900) (full OFF).

Check your connections to be sure that you have proper VCC, GND and VCNT. For VCNT input check your PWM output voltage.
Can you please post your wiring and software that you use.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#36 Post by mkotek » 01 Feb 2017, 07:49

Witty is a standard Esp8266 on a small breadboard.
I have connected VCC, GND and GPIO-16 to VCNT.

As for firmware, I am using version R147 RC8.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#37 Post by trackerj » 01 Feb 2017, 08:31

mkotek wrote:Witty is a standard Esp8266 on a small breadboard.
I have connected VCC, GND and GPIO-16 to VCNT.

As for firmware, I am using version R147 RC8.
For intial tests use a standard lightbulb. That 100W Osram one sounds ok.
Try also another GPIO, like 4 or 5.
Then try to slowly change PWM output value from 0 to 890-900, with standard commands, like :

Code: Select all

http://192.168.1.169/control?cmd=pwm,5,0

Code: Select all

http://192.168.1.169/control?cmd=pwm,5,650

Code: Select all

http://192.168.1.169/control?cmd=pwm,5,750

Code: Select all

http://192.168.1.169/control?cmd=pwm,5,890
where "192.168.1.169" should be replaced with your ESP8266 IP.

Check and measure that you have proper corresponding PWM signal output on the VCNT input pin.

That should reflect at the VCNT pin input as a voltage control signal from 0V to about 2.9V.

Related Youtube Video Tutorial, ESPEasy firmware upload and simple PWM test:
https://www.youtube.com/watch?v=QDApd7UMsOI
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#38 Post by mkotek » 01 Feb 2017, 08:41

Have you seen my video?
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#39 Post by trackerj » 01 Feb 2017, 09:05

mkotek wrote:Have you seen my video?
Yes, but cannot see to much from it, as wiring, etc. A bad wiring for example can happed to anybody. Try another GPIO where PWM is possible on that Witty board and check/measure your PWM output signal please.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#40 Post by mkotek » 01 Feb 2017, 09:15

Than you. Will check tonight and also with another board.

What I meant about the video, it shows that dimming works, only not as much as I expected. But maybe because of something unexpected, that is why I asked for advice.
I can also try this separate I2C driver, if that is better than standalone ESP.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#41 Post by trackerj » 01 Feb 2017, 11:31

mkotek wrote:Than you. Will check tonight and also with another board.

What I meant about the video, it shows that dimming works, only not as much as I expected. But maybe because of something unexpected, that is why I asked for advice.
I can also try this separate I2C driver, if that is better than standalone ESP.
Might be a bad wire related thing, might be something else. Once somebody obtained a similar behavior by sending PWM signal on VCC and connecting VCC on VCNT. Tiny wires, might happen, look here at the jonhjore user comments: http://www.esp8266-projects.com/2016/04 ... witch.html

As a quick step-by-step checklist I will take a look at:
- wiring / VCC value, GND, etc
- GPIO pin/ pin change / PWM output measurement
- VCNT voltage control input measurement
- software side

For a deadly simple test, without anything else connected to the MPDMv4 Dimmer board, you can use a 10K potentiometer connected between the VCC and GND with the wiper on the VCNT input pin. Slowly adjust and measure the POT voltage output and I'm sure you will find the dimming interval to be around 0V -> 2.9V. As soon as you are out of the dimming interval you will find it very quck, it will loose sync and start flickering.

Because this is a thing that really matter for me, all the boards are extensively tested before departure. No DOA at all until now.

For any related question you can also directly contact me anytime.

Happy breadboarding,
TJ.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#42 Post by mkotek » 01 Feb 2017, 12:14

I am absolutely not suggesting, there is anything wrong with your product.

I have decided to go Forum route, as my issues might help someone in the future.
I like the dimmer very much and I am sure, your suggestions will help me overcome the issues and have fully working solution.

Will let you know tonight.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#43 Post by trackerj » 01 Feb 2017, 14:20

mkotek wrote:I am absolutely not suggesting, there is anything wrong with your product.

I have decided to go Forum route, as my issues might help someone in the future.
I like the dimmer very much and I am sure, your suggestions will help me overcome the issues and have fully working solution.

Will let you know tonight.
Probably the desired sense lost somehow in translation on my side, as English is not my mother tongue language, what I wanted to say is that I am offering you full support from my side, not only here on the Forum.

I am also very curious to find out what's exactly the issue with your setup and appreciate your detailed feedback here.
The only thing I can think now is that somehow PWM is not working OK on that pin. Was looking on the Witty schematic and looks to have some extra stuff on some GPIO's. Unfortunatelly cannot find a Witty board around to be able to replicate 100% your setup for test now.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#44 Post by mkotek » 01 Feb 2017, 15:12

trackerj wrote:Was looking on the Witty schematic and looks to have some extra stuff on some GPIO's.
You can see the assignment of pins here and D0 (GPIO-16) should not be used for anything:
Image

Will test and let you know. Will also try to check with another board, I have only one Witty and it was at hand yesterday :)
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#45 Post by trackerj » 01 Feb 2017, 15:30

mkotek wrote:
trackerj wrote:Was looking on the Witty schematic and looks to have some extra stuff on some GPIO's.
You can see the assignment of pins here and D0 (GPIO-16) should not be used for anything:
Image

Will test and let you know. Will also try to check with another board, I have only one Witty and it was at hand yesterday :)
As I said above, first thing, use other GPIO pin, please try GPIO4 or 5, as far as I remember GPIO16 is a bit different internally and can only be used as gpio read/write. No support for open-drain/interrupt/pwm/i2c/etc.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#46 Post by mkotek » 01 Feb 2017, 21:06

OK, so Witty module is behaving really, really strange. Measured difference between VCNT and GND is changing, but the range is unbelievable:
for GPIO-16: 2,35V-5,24V
for GPIO-14: 1,93V-5,24V
for GPIO-5: 1,95V-5,24V
Even I have measured the voltage between VCC and GND and confirmed, this is 5,24V indeed. Seems like Witty is really strange with this double decker construction.

So I scratched Witty and tried the ordinary POT. And here, your advice and assumption has checked (of course) 100% - range being 0V-2,88V and dimming working as it should.

Next I have moved to my target device, so Sonoff, where I want to do cutoff by relay and dimming using GPIO-14.
After connecting everything, dimming works fine. Most likely I will follow the advice to adjust the scale as it seems lower values change rapidly and higher ones not so much, but the idea checks as planned.

Will post the end setup when I receive the rest of Sonos and put them into actual setup.

Once again thank you :ugeek:
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#47 Post by trackerj » 02 Feb 2017, 08:59

mkotek wrote:OK, so Witty module is behaving really, really strange. Measured difference between VCNT and GND is changing, but the range is unbelievable:
for GPIO-16: 2,35V-5,24V
for GPIO-14: 1,93V-5,24V
for GPIO-5: 1,95V-5,24V
Even I have measured the voltage between VCC and GND and confirmed, this is 5,24V indeed. Seems like Witty is really strange with this double decker construction.

So I scratched Witty and tried the ordinary POT. And here, your advice and assumption has checked (of course) 100% - range being 0V-2,88V and dimming working as it should.

Next I have moved to my target device, so Sonoff, where I want to do cutoff by relay and dimming using GPIO-14.
After connecting everything, dimming works fine. Most likely I will follow the advice to adjust the scale as it seems lower values change rapidly and higher ones not so much, but the idea checks as planned.

Will post the end setup when I receive the rest of Sonos and put them into actual setup.

Once again thank you :ugeek:
I must admit that this is one of the strangest things that I've seen, to have over 5V on a GPIO pin of a 3.3V only device like ESP8266. For sure something is going wrong there, might be even a broken board, don't know much about this Witty Boards...

Regarding the dimming interval it's very easy to trim the dimming interval to the desired values as been related with the VCNT Voltage control value only. The human eye is not a liniar light sensor device, so probably you can "see" changes more from 500 upto 890 that 0-500. And to the end of the day you are interested more on the human eye visual brightness perception, so it's plenty of space for experiments with.

Looking forward to see how is looking your setup with the Sonoff when ready.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#48 Post by mkotek » 09 Feb 2017, 21:58

My Sonoffs have arrived and so I was able to create the final version of my solution. It involves Sonoff Basic programmed with EasyESP with GPIO-14 used to control the dimmer. It is attached to the ceiling lamp from IKEA http://www.ikea.com/pl/pl/catalog/products/00304493/. Actually I have (on request form my son) split the 5 sockets into 2 groups (2+3), hence I needed 2 dimmers + 2 Sonoffs. Of course I could use different board and 2 GPIOs on it, but Sonoffs are great, because I am using dedicated function on On and Off, so that power is shut down completely from the lights, when switch is in Off position.

To control the dimmers, I am currently using Xiaomi Wireless Switches (the round ones), as they are providing 3 states: click, double click and long click.
I did not have time to design and troubleshoot the logic, so at the moment, all channels are powered by click action and switched off by double click action. Dimming is done by long click. Once I solve the issue with click to turn power on and off, it will relese double click action to powering just one group and at 50% level of dimming or something similar.

You can see the working solution here: Sonoff + AC Dimmer in basic actions with Xiaomi Wireless Switch 201702.mp4

And my ultimate goal is to use Xiaomi Magic Cube to provide multiple actions and scenarios, but snail mail is really slow this days from China, so it will be a while till I can build that.

Anyway, all working as planned and really cost efficient. Once again, thank you trackerj.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

trackerj
Normal user
Posts: 44
Joined: 01 Dec 2016, 09:57

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#49 Post by trackerj » 10 Feb 2017, 13:05

mkotek wrote:My Sonoffs have arrived and so I was able to create the final version of my solution. It involves Sonoff Basic programmed with EasyESP with GPIO-14 used to control the dimmer. It is attached to the ceiling lamp from IKEA http://www.ikea.com/pl/pl/catalog/products/00304493/. Actually I have (on request form my son) split the 5 sockets into 2 groups (2+3), hence I needed 2 dimmers + 2 Sonoffs. Of course I could use different board and 2 GPIOs on it, but Sonoffs are great, because I am using dedicated function on On and Off, so that power is shut down completely from the lights, when switch is in Off position.

To control the dimmers, I am currently using Xiaomi Wireless Switches (the round ones), as they are providing 3 states: click, double click and long click.
I did not have time to design and troubleshoot the logic, so at the moment, all channels are powered by click action and switched off by double click action. Dimming is done by long click. Once I solve the issue with click to turn power on and off, it will relese double click action to powering just one group and at 50% level of dimming or something similar.

You can see the working solution here: Sonoff + AC Dimmer in basic actions with Xiaomi Wireless Switch 201702.mp4

And my ultimate goal is to use Xiaomi Magic Cube to provide multiple actions and scenarios, but snail mail is really slow this days from China, so it will be a while till I can build that.

Anyway, all working as planned and really cost efficient. Once again, thank you trackerj.
Very nice setup and interesting findings. That IKEA lamp has by default 2 circuits or you just splitted in 2?
What version of Xiaomi Wireless Switches are you using? What's the best source to search about, Ebay or Aliexpress, etc?

Happy breadboarding,
TJ.
www.esp8266-projects.com - ESP8266 Projects and many more!
MPDMv4 Universal AC Dimmer is available also on TINDIE Store: https://www.tindie.com/stores/nEXT_EVO1/

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: MPDMv4 - Universal AC MAINS Dimmer Board usage

#50 Post by mkotek » 10 Feb 2017, 14:45

trackerj wrote:
mkotek wrote:My Sonoffs have arrived and so I was able to create the final version of my solution. It involves Sonoff Basic programmed with EasyESP with GPIO-14 used to control the dimmer. It is attached to the ceiling lamp from IKEA http://www.ikea.com/pl/pl/catalog/products/00304493/. Actually I have (on request form my son) split the 5 sockets into 2 groups (2+3), hence I needed 2 dimmers + 2 Sonoffs. Of course I could use different board and 2 GPIOs on it, but Sonoffs are great, because I am using dedicated function on On and Off, so that power is shut down completely from the lights, when switch is in Off position.

To control the dimmers, I am currently using Xiaomi Wireless Switches (the round ones), as they are providing 3 states: click, double click and long click.
I did not have time to design and troubleshoot the logic, so at the moment, all channels are powered by click action and switched off by double click action. Dimming is done by long click. Once I solve the issue with click to turn power on and off, it will relese double click action to powering just one group and at 50% level of dimming or something similar.

You can see the working solution here: Sonoff + AC Dimmer in basic actions with Xiaomi Wireless Switch 201702.mp4

And my ultimate goal is to use Xiaomi Magic Cube to provide multiple actions and scenarios, but snail mail is really slow this days from China, so it will be a while till I can build that.

Anyway, all working as planned and really cost efficient. Once again, thank you trackerj.
Very nice setup and interesting findings. That IKEA lamp has by default 2 circuits or you just splitted in 2?
What version of Xiaomi Wireless Switches are you using? What's the best source to search about, Ebay or Aliexpress, etc?

Happy breadboarding,
TJ.
By default the lamp has all 5 lights connected in a single bunch, but as they are run separately, you need only to remove the plastic/metal cap on them and split it any way you want. Here they are split 2+3 but you may create any scenario you want, 2 cables are longer, 3 are shorter, but thats not a problem - they are all accessible by removing just 2 screws on the plastic lid.

As for the switches, I am using round Wireless Switch I have bought here
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests