—————————————————————————————————————————

                   Special April Sale Discounts!!

Special Spring Sale discounts for all the products available on Tindie Store:
https://www.tindie.com/stores/nEXT_EVO1/

Including the popular MPDMv4 Universal AC Mains Dimmer and the MPRSx8 Home Automation Board!

Spread the word and use Coupon code: NDSCVO10

Thank you all for your support!

 —————————————————————————————————————————

New Tutorial related with direct connection setup between Raspberry Pi board and MPDM v4 AC dimmer board.

Part 1: General view, wiring and hardware setup :

What we will need:
MPDMv4 Universal AC Dimmer – available also on Tindie Store !
Raspberry PI 2 Board
Domoticz
Latest available, on a Raspberry PI 2 Board install :  

      sudo curl -L install.domoticz.com | bash

Software 

1. PIGPIO library for Raspberry PI install script:

rm pigpio.zip
sudo rm -rf PIGPIO
wget abyz.co.uk/rpi/pigpio/pigpio.zip
unzip pigpio.zip
cd PIGPIO
make -j4
sudo make install

save it in the choosen directory for your PIGPIO library as “install.sh” and run also command:

chmod 775 install.sh


2. Testing script:

#!/usr/bin/env python

#*** MPDMv4 Universal AC Dimmer PWM Example  ****************
#*                                                          *
#* This demo is using RPi2 GPIO18 (header pin 12)!!         *
#*                                                          *
#* Wiring table:                                            *
#* MPDMv4      Raspberry PI 2                               *
#*   VCNT  ->  GPIO18      - header pin 12                  *
#*    GND  ->  GND         - header pin 6                   *
#*    VCC  ->  VCC (+3,3V) - header pin 1                   *
#*                                                          *
#* tech@esp8266-projects.com                                *
#*                                                          *
#************************************************************
import pigpio

GPIO=18

pi = pigpio.pi()

if pi.connected:
   print("Connected to pigpio daemon !\n")

dm = 0
while dm < 860:
    dm = input("Enter Dimmer Value: ")
    dm = int(dm)
    pi.hardware_PWM(GPIO, 5000, dm*1000) # 5000Hz dm*1000% dutycycle

print("\nOut of range. Exiting...")
pi.hardware_PWM(GPIO, 5000, 860000) # 5000Hz 95% dutycycle
pi.stop()

save it as “test.py” in the PIGPIO folder generated after the full install is done.

Next here: Domoticz setup & configuration and Dimmer testing.

————————————————— 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.
—————————————————————————————————————————-
 

                                                             Creative Commons License

All materials and boards released under ESP8266-Projects.com are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License 


2 Comments

Berkay · February 17, 2018 at 4:17 pm

Thank you for your MPDMv4.1 example. But in Raspberry Pi 3, the code doesn’t work. The pigpio package you suggest to install is pre-installed on lates Raspbian OS. So, I didn’t try to install it again. When I run the code following error message occurs:

Can’t connect to pigpio at localhost(8888)

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi(‘soft’, 8888)

ade · February 20, 2018 at 2:57 pm

can you use 2 of these on an rpi3 -i assume they would use eg the 18 & 13 pwm pins ?

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

AC Dimmer

MPDMv7.5 Arduino IDE driver example

For a more detailed description please take a look at the Part 1: MPDMv7.5 AC Dimmer devboard overview MPDMv7.5 AC Dimmer devboard is also available on Tindie Store A very simple MPDMv7.5 Arduino IDE driver Read more…

AC Dimmer

AC Dimmer DevBoard – MPDMv7.5 – Part 3 – DAC

For a more detailed description please take a look at the Part 1: MPDMv7.5 AC Dimmer devboard overview MPDMv7.5 AC Dimmer devboard ESP Basic program example for the Extra DAC version configuration: address = 96 Read more…

AC Dimmer

AC Dimmer DevBoard – MPDMv7.5 – Part 2

For a more detailed description please take a look at the Part 1: MPDMv7.5 AC Dimmer devboard overview MPDMv7.5 AC Dimmer devboard ESP Basic program example for the basic version configuration: 'write("starttimer",10) cls 'VCNT GPIO Read more…