Arduino - MPDMv4 - Universal AC MAINS Dimmer

4.7K116

Intro: Arduino - MPDMv4 - Universal AC MAINS Dimmer

----------------------------- DISCLAIMER -----------------------------

WARNING!! You will play with LIVE MAINS!! Deadly zone!!

If you don't have any experience and are not qualified for working with MAINS power I will not encourage you to play arround!. The author take no responsibility for any injury or death resulting, directly or indirectly, from your inability to appreciate the hazards of household mains voltages.

The circuit diagrams are as accurately as possible, but are offered with no guarantees whatsoever.

There is no guarantee that this design meets any Rules which may be in force in your country so please check before your local rules/regulations.

----------------------------------------------------------------------------------

As anybody else with and interest about AC Dimmers, I was also looking for the easiest and safest way to interface my Arduino MCU with a AC MAINS Lightbulb and to be able to do smooth, flicker-free Dimming control for my lights.

After more that a year of experimenting with AC Dimming , I think I can come with a conclusion: the new MPDMv4 Universal AC MAINS Dimmer Module.

I don't know if is out there a easier to use AC Dimmer module, but this one definitelly is very easy to use and control. It is a voltage controlled unit and it contains onboard all the necessary functions (Phase detection, Zero Crossing detection, Sync, etc) to make your AC Light Dimming experience way simpler than before, in both ways, software programming and also wiring.

STEP 1: What Do You Need

STEP 2: Setup & Wiring

As you can see in the picture above, wiring is very simple:

  • Connect MAINS line wires to the corresponding AC MAINS input connector:
    • LIVE (BROWN)
    • Neutral (BLUE))
  • Connect the Lightbulb to the AC MAINS Output connector
  • Connect your Arduino Board to the Control connector:
    • VCNT - Control pin -> Arduino PWM output pin (YELLOW wire)
    • VCC - 3.3V (or 5V, depending on your Arduino Type you use) (RED wire)
    • GND - Ground connection from your Arduino Board (BROWN & ORANGE wire)

STEP 3: Software

As you can see in the code example below, because all the MCU and Interrupts intensive fancy stuff (Phase detection, Zerocrossing Detection, Sync, etc) are all done at the MPDMv4 Universal AC Dimmer Board level, the Arduino software side is deadly simple and without any kind of overhead added by the Dimming processing functions:

/*
Dimmer This simple Sketch demonstrates the sending data from the computer to the Arduino board, in this case to control the brightness of MPDMv4 AC MAINS Dimmer. The data is sent in individual bytes, each of which ranges from 0 to 255. Arduino reads these bytes and uses them to set the VCNT brightness command . The circuit: MPDMv4 Board attached from digital pin 3 to ground. Serial connection to Processing, Max/MSP, or another serial application created 2006 by David A. Mellis modified 30 Aug 2011 by Tom Igoe and Scott Fitzgerald modified 14 Apr 2016 by TJ for esp8266-projects.com AC MAINS Power Dimmer MPDMv4 Driver This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Dimmer */
const int vcntPin = 3;      // the pin that the MPDMv4 VCNT pin is attached to
void setup()
{
  // initialize the serial communication:
  Serial.begin(9600);
  // initialize the VCNTPin as an output:
  pinMode(vcntPin, OUTPUT);
  // set default brightness value
  analogWrite(vcntPin, 230);
}
void loop() {
  byte brightness;

  // check if data has been sent from the computer:
  if (Serial.available()) {
    // read the most recent byte (which will be from 0 to 255):
    brightness = Serial.parseInt();
    Serial.print("Command received : ");
    Serial.println(brightness);    
    // set the brightness of the LED:
    analogWrite(vcntPin, brightness);
  }
}

STEP 4: CONCLUSION

I have only one conclusion: Probably the simplest and easiest to use AC MAINS Dimmer Board available. I am looking forward for your feedback about :)



For more details you can see the related AC MAINS Dimming Articles/ Videos:





The MPDMv4 Board is available also on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/

4 Comments

Thanks for your explanation of postage costs. We have become used to free or minimal cost postage from China of Ebay goods, where they must still make a profit. The Arduino Nano cost £6 including postage. To ask double that for the dimmer board and then the same amount again for postage may help to put things in perspective.

I am really sorry, but 15 USD shipping it's a real cost that can be proved with an Invoice. This is something out of my control.
China is a special case, their government is covering/sposoring the shipping costs and a lot of other fees as their Wordwide Commerce policy. It's no "free" thing in the World.

The postage from the US to Uk for the MPDMv4 board is more than the board costs (Tindie). Or is there a UK source?

Hi Nigel,

For UK I can send them from inside EU, from Bucharest, Romania. Unfortunatelly, totally out of our control, after 15 Aug the "small packets" option is no more available.

Inside EU shipping cost is 15USD for priority shipping with tracking number or 28USD Express EMS flat. flat (means that you can order 1-2..10) and price remains the same and no extra taxes, VAT or anything else to be paid by your side!). Combined shipping also welcomed! Same prices.

For ordering more than 3-4 pcs the shipping cost is even better than before with the previous "small packets" option.

Happy breadboarding,

TJ.