Light 110v luminosity switch


I have some dimable lights on my deck and was wanting to purge them into my pi setup.
you have an option for a slider bar\luminosity but what kind of hardware would I need to hook that upto 110v.
I already have a sainsmart relay board in my outdoor hydroponics pi controlling the power to the lights and all my equipment but I imagine I could drop a dimmer in-line after the relay but I don’t know which model or would work with cayenne widgets. could you point me to what I need so I can buy it and read up how to get in installed.


something like this?


@eptak Any input here?

We use the PCA9865 as PWM board to control dimming an LED for testing purpose on luminosity slider. I imagine the PCA9865 could also be used to dim an actual light.



This is doable using PWM, but it requires a low voltage PWM to high voltage AC converter, with complex circuitry.
It’s better to do it with an Arduino that allow real time I/O and a Triac based circuit like the one proposed by @mase.hacker
With and LED we can easily dim them using PWM, turning on/off repeatedely. But High voltage lamp need to change voltage while keeping the same 50/60Hz AC wave.


I have been doing a little more research and I think I am going to purchase this controller next week and hopefully get it to work with cayenne.


Looks like that board uses pwm so it should be fine. Just note that Cayenne doesn’t currently support native pwm so you will need a PCA9685.


I got the one from adafruit coming. if I have that then I can use it for pumps later on after you guys get the PH sensor working on cayenne then I can pump in ph+, ph- and hydroponics food remotely/automatically.


Sounds like a cool project, can’t wait to see it once everything is supported. I’ll mark this as helped.


i got the pwm to work with the light switch\slider but it blinks like crazy and isnt usable. :confused:the dimming works great it just has a constant blinking to it. I ordered the right hz too maybe he sent me the wrong ones or its just the shitty convertor chip I got to use after the pwm…


Just curious, what kind of bulb are you using? florescent, incandescent, LED, etc.


incandescent 60w and 100w


Probably have to adjust the hertz to 60 to make it stop flickering. I don’t think it’s currently possible unless you edit the files in the webiopi directory. Maybe @eptak would know how.


I bought the 60hz version of the pwm ac dimmer.
The dimmer has a control/voltage mode and a pwm mode both seem to do the same thing so i emailed the maker. I dont know how i could test the hz all i have is a crappy multimeter :confused:


Yeah unfortunately I don’t think you can test it without a oscilloscope or a multi-meter that has hertz function. I have an extech multi-meter (forget the model) that I forgot at work but it does Hz and also duty cycle, although who knows how accurate it is.

Anyway, you can set the Hz with Raspberry Pi but I’m not sure you can with arduino, at least not with analogWrite. There may be some libraries out there that you can. For Raspberry Pi use rpi.gpio and this script:

import RPi.GPIO as gpio
gpio.setup(12, gpio.OUT)

p = gpio.PWM(12, 50)

hertz = float(input('Enter Hertz'))
dutycycle = float(input('Enter Duty Cycle'))

    while True:
        hertz = float(input('Enter Hertz'))
        dutycycle = float(input('Enter Duty Cycle'))
except KeyboardInterrupt:
    print 'interrupted!'



Does ph and ec sensor work with cayenne yet?


can you please tell me how I can control around 500 w ac bulbs with frequency 50 Hz with raspberry pi 3.
I want to work them in step like following
100 w for 10 minutes
250 w for 55 minutes
50 w for 5 minutes
450w for 120 minutes

can you please help how i can create this project? do i need some PCA9685 for pi or not?
Please I need hep.


Cayenne doesn’t have support for any of that, but you can make a python script and connect with MQTT to control it. Use the script above and combine it with this example If you get stuck along the way post back what you have and we will help you out.