Help with LED dimming / control.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • neilhooper
    Automated Home Guru
    • Oct 2008
    • 124

    Help with LED dimming / control.

    We have some RGB LED strips that we want to use for effect / mood lighting. When we bought them they came with a basic controller that's OK but not brilliant by any means. I am intending to use Idratek to control them. I have found a suitable three channel dimmer that uses 0-10v to control the dimming and intend to use a QAO to control it.

    Taking the Hall and Stairs as an example. What we really want to do is very slowly change the colour of the strip, random colours would be nice but when someone walks in change the strip to all channels on, ie white then back again when presence is no longer detected.

    Can anybody tell me if this could be achieved and possibly point me in the right direction on how to set it up in Cortex.

    - Neil
  • Gumby
    Moderator
    • May 2004
    • 437

    #2
    I be interested in the details of your dimmer since I have a similar RGB strip in my study and want to do the same thing.

    I've always fancied being able to do interesting things with the color, including using it as an ambient indicator - you know, link colour to your stock portfolio so that it's always red

    Actually, it would be nice to link to incoming callerID and change colour depending on a lookup into the directory...
    ----------------------
    www.gumbrell.com

    Comment

    • neilhooper
      Automated Home Guru
      • Oct 2008
      • 124

      #3
      This is it


      I've been in touch with them over the last few days and they are happy to supply direct, also to give an idea of price I have found a Hong Kong supplier selling them at £24.99 so I'm hoping that they will be cheaper direct.

      Comment

      • RichardC
        Automated Home Jr Member
        • Mar 2009
        • 29

        #4
        I'm working on the same thing at the moment, my throughts are to get a LED controller but control it via IR (plus I have a spare Idratek IR sender). So that I can send it signals and let it get on with changing colours itself. Also I can send it IR to make it go to a specific colour (preprogrammed)

        Alternatively I do have 3 spare 0-10v outputs nearby so this could be an alternative.

        I've been working with Toscal on a lighting design for our new kitchen - he has available a RS232 controlled LED dimmer, but I don't think that can be integrated directly into Idratek.

        Comment

        • neilhooper
          Automated Home Guru
          • Oct 2008
          • 124

          #5
          Originally posted by RichardC View Post
          I'm working on the same thing at the moment, my throughts are to get a LED controller but control it via IR (plus I have a spare Idratek IR sender). So that I can send it signals and let it get on with changing colours itself. Also I can send it IR to make it go to a specific colour (preprogrammed)
          That could be possible but finding an LED controller that is not the "standard" one that is widely available, that I have already got, seems to be very difficult if not impossible. Have you found one ?

          I'm wondering if it can be done via a scene or a macro or some other means but as I'm new to this I don't even know if it's possible to do with Cortex. If it is, I just need somebody to point me in the right direction and I'll start digging.

          I haven't actually ordered the 0-10v dimmers, amplifiers or the QAO's that I will need yet because I don't want to waste money chasing something that can't be done !!

          Comment

          • Karam
            Automated Home Legend
            • Mar 2005
            • 863

            #6
            A way to do this might be by using the concept that Dimmer OFF/ON does not mean 0%/100% but any values that you choose. So what you could do is control the OFF values using a Scene setting object (and latest release of Cortex), i.e. by having a different 'OFF' profile for each LED colour you will get different hues at different times when the lights are 'OFF' in terms of automation. One possible snag is that the time step resolution of the scene object is 15 minutes. Anyhow, that aside you will at least get the desired automation without further messing about since the idea is that when presence is detected (and possibly you may also be using light level as a gating input) this could be made to switch all LEDs to 'ON' level (all the same value to give white) and then when presence not asserted the LEDs would go to their 'OFF' values according to the scene schedule.

            But you'd also need a way to turn the lights totally off and this could be done via a button or by the scheduler by first disabling the Scene object and then setting the 'OFF' levels to 0%. Then you need a way to turn back on which would just be a case of re-enabling the Scene object.

            Note: I haven't tried any of this and there maybe alternative solutions, but you could try simulate in Cortex without a physical QAO module.

            As a matter of more esoteric interest, the QAO and Dimmer modules have an internal profile function which can operate at a standalone module level (Reflex level). This feature allows you to define an arbitrary dynamic profile with finer step resolution (0.1s - 2min). The profile is stored in the module EEprom and could then be triggered to run as one shot or cyclic. We don't have any nice GUI tools to create the profiles so its a bit of a job, but I thought worth mentioning for wider readership since you never know when a particular application might warrant it.

            Comment

            • toscal
              Moderator
              • Oct 2005
              • 2061

              #7
              Originally posted by neilhooper View Post
              That could be possible but finding an LED controller that is not the "standard" one that is widely available, that I have already got, seems to be very difficult if not impossible. Have you found one ?
              What sort of LED controller are you after.
              IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
              Renovation Spain Blog

              Comment

              • neilhooper
                Automated Home Guru
                • Oct 2008
                • 124

                #8
                Originally posted by toscal View Post
                What sort of LED controller are you after.
                One that does what I said above.



                Karam - I've had another thought.

                Last night I was having a play with the API.

                Let me run this past you.

                Using a modified version of the example for VB2005 Express (I've converted it to VB2008 Express) I think that I could send values to the QAO to set the light levels for each channel. Also I could poll whatever I use as presence detection at the same time to check that the lights don't need to change to white and also poll to make sure nobody has over ridden the setting using a switch if either of these is true then don't send any messages to change values but keep polling to see when it is OK to send messages again.

                I don't think I've explained it very well but I'm hoping you get my drift. What do you think ?

                Comment

                • Karam
                  Automated Home Legend
                  • Mar 2005
                  • 863

                  #9
                  Neil,

                  I'm not the expert on the API so my unconsidered response is 'possibly'. As a general comment, since Cortex is often co-ordinating many different points of interaction for an object I'd usually be a bit wary of trying to have both Cortex automation and user defined code trying to access the same objects for fear of conflicts of objective i.e. Cortex wanting the state to be one value whilst the user code wanting something else. Not saying it can't be done just to be careful to think through any possible conflicts. What is the reason for considering the API route? Do you want finer control of the colour changing time steps or something else?

                  One benefit you might get via the API is that you may be able to write some code to interface to the LED dimmers offered by Toscal (casatech), but obviously these do not have representative objects in Cortex so it would be a case of your API controlling them directly. It may well be possible to set up a virtual dimmer object in Cortex and you translate its states via your API but I'm ranting now ...

                  Comment

                  • neilhooper
                    Automated Home Guru
                    • Oct 2008
                    • 124

                    #10
                    Originally posted by Karam View Post
                    I'd usually be a bit wary of trying to have both Cortex automation and user defined code trying to access the same objects for fear of conflicts of objective i.e. Cortex wanting the state to be one value whilst the user code wanting something else.
                    - What I am thinking is that a light is either "on" or "off". In my case my definition for this particular application is that "on" means all three channels of the RGB strip at 100% ie white light, however "off" is a gradual and random fading between different colours. My thought is that a gradual fade would take say 1/2 an hour to get from one colour to the next.

                    Looking at what I've seen with the API example code I should be able to keep an "eye" on what Cortex is doing with the object(s) that I want to control. So when Cortex switches the light "on" my code will leave the object alone, when Cortex switches it "off" my code will take over again and carry on the colour changing.

                    At the moment this is all theory as I'm just starting to simulate it in Cortex.

                    Comment

                    • toscal
                      Moderator
                      • Oct 2005
                      • 2061

                      #11
                      Neilhooper, on your so called standard controller you have, is there a speed control. Most of the controllers we sell have the possibility to increase or decrease the speed, problem is that I doubt it would increase the delay to 30 minutes between changes, its probably more like 30 secs.
                      There are controllers out there that can do what you want, but you won't like the price, your looking at 100's of euros.
                      How good are you at programming. Because you could use something like an Arduino single board micro controller. I am sure you can have an input coming from something like the QRI-002, so you could toggle presence on or off and the Arduino programmed to act accordingly.
                      Some links of people doing something similar;

                      http://www.mbeckler.org/microcontrollers/rgb_led/ He has set the dealy to 10 miliseconds, but there is no reason why you can't increase this delay.

                      Last edited by toscal; 9 June 2011, 06:20 PM.
                      IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
                      Renovation Spain Blog

                      Comment

                      • neilhooper
                        Automated Home Guru
                        • Oct 2008
                        • 124

                        #12
                        Thanks Toscal,

                        Some interesting stuff there. Something else to digest !!!

                        As a matter of interest I was looking around your website last night, I'll be in touch soon to find out some pricing on some of the kit, (more strips & amplifiers), you have.

                        We've got visitors around tonight so I'm doing a quick post in between one lot leaving and the others arriving, I might get chance later.

                        - Neil

                        Comment

                        • Karam
                          Automated Home Legend
                          • Mar 2005
                          • 863

                          #13
                          Originally posted by neilhooper View Post
                          - What I am thinking is that a light is either "on" or "off". In my case my definition for this particular application is that "on" means all three channels of the RGB strip at 100% ie white light, however "off" is a gradual and random fading between different colours. My thought is that a gradual fade would take say 1/2 an hour to get from one colour to the next.
                          In my original scheme I considered that you actually had three states: 1. Totally off, 2. fading colours, 3. ON (white but not necessarily just 100% since you might want to have say 50% white at night for example). The main problem I can see with this scheme is the relative time coarseness of the scene setter. It would allow you to change colour every 15 minutes but not with a continuous fade between these - you could get say a 20 second fade at each 15 minute change by selecting the slowest fade rate. However if you wanted a linear fade over 30 minutes (equivalent to ~ 1% every 20 seconds) and total control of the algorithm for changing colours then what you could do is just write your own bit of API interfacing code to effectively perform the scene setter function with greater detail - in other words all your code has to do is control the changes to the dimmer 'OFF' levels. Cortex automation would then take care of the presence based switching and any other functions acting on the lights. To get the totally off state (means lights off completely and automation off too) I now realise that you'd have to first turn the level to 0%, then turn the dimmer output to off state, then trigger the dimmer disable (so that automation doesn't try to switch on the lights upon presence). The latter I forgot before.

                          In other words you don't need to have you're code monitor presence and trying to partly replicate the existing automation - unless Im still missing something?

                          BTW is the hallway/passage way a visible backdrop to another room? I.e this isn't a fridge light situation is it - where as soon as someone tries to check the lighting it turns to white .

                          Comment

                          • neilhooper
                            Automated Home Guru
                            • Oct 2008
                            • 124

                            #14
                            unless Im still missing something?
                            Looks like you've got it spot on.

                            I've written the code to do the fading. The code sends the Set Dimmer Off Value=XX command and appears to be working properly.

                            However the problem I'm having at the moment is getting it all to work in Cortex. I'm still trying to simulate it but I can't work out at the moment how to get the PIR to switch on the channels at 100% and then back off again let alone do all the other things you've mentioned :-
                            first turn the level to 0%, then turn the dimmer output to off state, then trigger the dimmer disable
                            any help here would be greatly appreciated.


                            is the hallway/passage way a visible backdrop to another room? I.e this isn't a fridge light situation is it - where as soon as someone tries to check the lighting it turns to white .
                            No, I don't think so, with my proposed positioning of the sensors in the Hall they shouldn't pick up someone in the other rooms, if that's what you mean?

                            I'm thinking of using some ultrasonic sensors in my door frames to help with presence detection as most of our doors are open all the time or we don't have a door between the rooms.

                            Comment

                            • Karam
                              Automated Home Legend
                              • Mar 2005
                              • 863

                              #15
                              Originally posted by neilhooper View Post
                              However the problem I'm having at the moment is getting it all to work in Cortex. I'm still trying to simulate it but I can't work out at the moment how to get the PIR to switch on the channels at 100% and then back off again let alone do all the other things you've mentioned :-
                              The PIR is connected to the room of interest via the room object's connections menu (Motion inputs). The light dimmer object is placed in that room. Then the light dimmer object's behaviour menu will provide you with various automation options - for example you can choose 'When someone is present or light timer'. Overall master control checkbox should also be enabled. In that menu you can also choose your on and off values (which can of course be varied by external triggers or API) and the fade rates.

                              Then, to simulate, you visit the room's behaviour menu and click on the S icon to simulate toggling of occupancy and no-occupancy states which should then trigger the lights accordingly (note the light will not go off immediately after occupancy is cleared because there is a short run on timer, whose value you can change). You could also visit the PIR sensor's menu and simulate that instead, but in that case once you toggled the PIR off the occupancy wil not clear because unless someone moves out of the room (eg. motion in adjacent room) then the room is still considered occupied - until an occupancy failsafe timeout occurs. You can of course clear occupancy at any time via the room's behaviour menu.

                              Originally posted by neilhooper View Post
                              No, I don't think so, with my proposed positioning of the sensors in the Hall they shouldn't pick up someone in the other rooms, if that's what you mean?

                              I'm thinking of using some ultrasonic sensors in my door frames to help with presence detection as most of our doors are open all the time or we don't have a door between the rooms.
                              Actually I was more wondering if anyone would appreciate the colours since when they go into the hall it will be white. But I guess they can see them through the doors.

                              You can also get beam break and retroflective IR sensors, but whether you really need these or not depends on how appropriately you can place PIR sensors, because Cortex can guess transitions between rooms based on layout and order of PIR triggering.

                              Comment

                              Working...
                              X