No announcement yet.

Arduino input and pc817 reading PWM outputs ?

  • Filter
  • Time
  • Show
Clear All
new posts

    Arduino input and pc817 reading PWM outputs ?

    Well, i thought i'd open a new topic.
    I have been thinking to control all the lights in my house with the DMX protocol.
    Not sure anymore where i got this idea but now i must go on with it since i already purchased a bunch of DMX decoders for about 140channels and a dmx master that i can control by homeseer (thx to USledsupply for the latest solution)

    (click on pic to enlarge)

    So here it goes, this DMX master i can control from the wall, and i will hookup some external push switches in different rooms and program on each switch a setting so the lights in that room will turn on or off.

    This will send a signal to the dmx decoder boards.
    When i "manually" control the lights , so i mean by manually, pressing a push button or the master control panel thats on the wall.
    Lights turn on and that's it, i do not see in homeseer if there are any lights on.
    There is no feedback from the master.
    The master can be controlled from homeseer, this is done by the IP/Serial plugin by Drule.

    When i control the lights from homeseer by this plugin, i will make a virtual button or something from each channel and so i can get some sort of feedback which channel is on or off.

    Now to the "important" part, i like to be able to see what light is on and off when the controls are manually used so i can turn these off by events or whatever reason.

    I thought well, maybe i can do this by reading the output ports from the dmx decoders by a arduino using a pc817 optocoupler.
    Since it is also a LED, with a resistor connect it to + and - and go.

    (click on pic to enlarge)

    (click on pic to enlarge)

    It does work, there is only a minor problem that i do not really know how to fix, if this is doable by some electrical parts or maybe working with events like If triggered can not re-run for XXX time.
    I hope it is possible by the electrical solution since the arduino get's allot of data to handle in the logs when some led strips or spots are on at the same time.

    (click on pic to enlarge)

    What i think that happens right now is this: when i dim the led or set it at the master i can do this until i am at 94% and the arduino picks up the signal as high and says the input pin is OPEN at the homeseer website.

    When i start to go to less then 94% the input does seem to receive the signals coming from the pc817 but , the led starts to flickr probably because of the PWM.
    So what happens is that it jumps to OPEN / CLOSED / OPEN / CLOSED , and when checking the log i can see it receives allot of data, input pin.

    (click on pic to enlarge)

    At first i was afraid the problem would be the power that would drop below 12.5 Volt and the opto was not responding anymore but this does not seem to be the problem.
    Even when going as low as 5% ( the LED is faintly lighting up, barely visible) it does seem to pick up the signal at the arduino.
    I do see a difference in the log, it starts to pick up a few signals at a second instead of when setting the dim percentage on say 60%.
    Then it will receive allot of signals , logical of course when you think about it.

    So , the Voltage is not a factor here, it is the PWM signal and the arduino that is picking it up like t should but a bit to precise haha.
    Is there a "simple" solution for it, i like to do this on allot of channels , not yet made the PCB's where all the electronics must fit on so i have some options left.

    Is there someone that has a suggestion to try and see what happens ?
    All help is appreciated.

    Would this not be easier to monitor the dmx bus with the Arduino and send it back to homeseer to monitor. I think the dmx simple library will do this.

    Sent from my SM-G925F using Tapatalk
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =


      A different solution perhaps but would it not be easier to have a Dmx receiver that sent the data into HS which you can then use to update devices in HS?


        Originally posted by enigmatheatre View Post
        Would this not be easier to monitor the dmx bus with the Arduino and send it back to homeseer to monitor. I think the dmx simple library will do this.

        Sent from my SM-G925F using Tapatalk
        great minds and all that you beat me to it, the Dmx simple library won't do it I'm sure it's tx only but there will be a library out there.


          Thanks allot guys,
          If I should get this working it would not only save me allot of work and some pcb designing but also allot of wiring.
          I do have a DMX shield with optional input or output.
          Going to search tomorrow right away when I get home.
          Time for bed now, laying already in it actually.

          Thanks again for the suggestion both of you


            being busy with this for days/evenings.
            I actually took a few days off to get this working but well, the lack of writing skills and understanding hold me back.
            Also have found some information and spoke to some people that told me that homeseer would probably not like it when getting this much data info constantly imported into it.

            Because when a dmx master sends out the signal/commands to turn on the lights.
            It stays repeating the signal over and over and over again, probably causing to flood the logs or maybe the computer ?

            I did found a "ready to use" device :

            This has the advantage that when a signal is being broadcasted the value does not change, until i change the broadcast signal for example dim a ligh to another value.
            it does not repeat the value everytime.

            This would still be a problem when i use a disco light effect , running light or whatever.
            But since i have the lights in my home just for lighting and no effects i don't think it will be a problem then.

            This is not a cheap solution,260 usd and shipping and probaby 21% taxes and import duties and costs for shipping companys that will be counted into it .....

            So if there is anyone that stil has an idea or says , look into that.
            got my ears wide open.

            thanks for thinking with me.