Light 110v luminosity switch


#1

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.


#2

https://www.amazon.com/Programmable-Controller-Raspberry-Compatible-1Channel/dp/B01B7AKI2G/ref=pd_sim_sbs_60_1?ie=UTF8&dpID=51cW2xDMsaL&dpSrc=sims&preST=AC_UL160_SR160%2C160&refRID=PDW53VY53PMFCQFMEN00

something like this?


#3

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

-B


#4

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.


#5

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.


#6

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.


#7

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.


#8

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


#9

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…


#10

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


#11

incandescent 60w and 100w


#12

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.


#13

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:


#14

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.setmode(gpio.BOARD)
gpio.setup(12, gpio.OUT)

p = gpio.PWM(12, 50)
p.stop()
p.start(0)

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

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

GPIO.cleanup()

#16

Does ph and ec sensor work with cayenne yet?


#17

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.


#18

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.