Control ANY Light With Philips Hue

13,105

52

27

Published

Introduction: Control ANY Light With Philips Hue

I'm a big fan of Philips Hue lighting. It's easy to use, reliable and integrates really well with the Amazon Echo. I always intended to make my own home automation and lighting system but other projects tended to get in the way. I must admit that the Hue works so well and my wife is happy with it so I think it's here to stay. No point rolling my own.

Having said how good it is, it isn't perfect. What is? There is a nice range of B22, E27, and GU10 bulbs and also some other lamps. I notice an E14 (candle) bulb has recently been added. Philips have got most stuff covered. However, I was all my house working together. When I say "Alexa, all lights off" I really want that to mean all.

For instance, what do you do if you have a room with lots of downlighters? Even if they're GU10, at £25 a go that can get expensive quickly. How about floodlights, 12V track lighting, or flourescent tubes? Philips don't make these. What I wanted was to have any light I wanted controlled by Hue. What I really wanted was my own relay or SSR that fits in with the Philips ecosystem. And with a little bit of work that's now what I've got.

I'm entering this Instructable in the Lights contest. If you like it, a vote would be appreciated. I'm sure there are lots of other great projects too, so take a look and vote for whoever you think has done a great job.

Step 1: First, You Need to Make a Sacrifice

So, I decided the best way to create a stable, reliable product was to adapt an existing Hue bulb. It involves cracking open one of the cheaper B22 white bulbs (LBW010) and altering it to do your bidding. Some might call this "hacking" into the Philips Hue system. Maybe this is true, but I feel I've hacked on the right side of the moral line. I may have tampered with the hardware that I've purchased but I've not delved in the firmware. I've not broken any encryption or proprietary secrets. I've paid for this bulb - I just want it to do a little more. So, let's take it apart.

Go buy a B22 bayonet fitting white bulb (LBW010). In the UK they're only £15, so you shouldn't feel too bad about destroying it.

The first thing to do it remove the translucent plastic cover. Grip the bulb in a vice and go at it with a hacksaw. That cover can actually be prised off without cutting, but the hacksaw help encourage it to pop off. None of the externals will be needed, by the way. If you damage it, don't worry.

Next, prise out the white PCB with the LEDs. Ignore those screws you can see. They just attach the PCB to the heatsink. Just get a small flat balded screwdriver and gently prise out the PCB and heatsink together.

You then need to remove the main PCB from the bulb. One thing worth noting on the B22 bulbs is that the two main contacts for mains power are actually made of solder. Before pulling the PCB out you should melt the solder on these. I didn’t and I ripped off one of the 15Ω resistors that are used as fuses from the PCB. Easily replaced, but annoying that I was heavy handed with this.

The PCB is embedded in a sort of rubbery black resin. You need to get all this off. It's actually strangely satisfying peeling it off. It comes off in chunks or crumbles depending how you attack it. (The eagle-eyed amongst you might notice that this photo is of a slightly different E27 bulb. I played around with those too.)

Firstly, let me get the safety warning out of the way. Never play around with this board when it's powered from the mains. None of it is isolated as you're not supposed to take them apart. Anywhere on the PCB can be at a dangerous voltage. Anyway, there's a better and safer way so there's no need.

Step 2: Begin the Hacking

Now I've done a fair bit of poking around on this PCB so you don't have too, but being a curious Instructables reader, I'm sure you're interested. None of this step is necessary but I thought you might like to know how we got to the end result.

Onboard you'll find the largest IC is a SAM21R21E18A. This is a nice 32-bit ARM microcontroller with built-in Zigbee. It's the brains and communications for the device.

There are a number of test point accessible on the underside of the PCB. It took a fair bit of following traces, checking continuity with a multimeter and probing with an oscilloscope, but I managed to work out what many of these were for. This is what I found:

TP1 - Ground
TP2 - SWCLK
TP3 - SWDIO
TP4 - Serial TX
TP5 - Serial RX
TP6 - LED output (about 32V)
TP7 - Regulated 3.3V power to microcontroller
TP8 - RESET
TP11 - Ground
TP25 - power supply to LM2204 regulator

So there a number of interesting signal here. TP1 and TP11 are the signal ground for the microcontroller and logic circuitry. TP7 is the regulated supply voltage.

SWCLK (TP2), SWDIO (TP3) and RESET (TP8) are interesting. You'd need these if you want to load new firmware onto the microcontroller or debug it. Interesting stuff, but this is arguably starting to head over the ethical line of hacking. It's more complicated than we need anyway.

The serial port (TP4 and TP5) are also interesting. You see some debug output on TP4 as the device powers up. Nothing as you use the device and switch the bulb on and off so not much use to us. Once again, more complicated than we need. If you want to take a look, it's 3.3V TTL 115200 8N1.

I told you it was possible to play around with the device safely, and it is. NEVER power your device from the mains whilst poking around. If you have a clean 3.3V supply you can connect that to TP7 and power the device that way. Better still is to supply a slightly higher voltage to TP25. It's usually at about 24V but even 5V (e.g. from a USB charger) will do the job. You might not be able to light up the LED board but it will connect to you Hue hub. At this voltage but you will be able to look at signals, but most importantly you'll be able to do it safely.

Step 3: Some More Useful Signals

OK all the poking around in the previous step was nice, but how do I know if the light should be on or off? None of the signals on the test point are all that useful. What we really want would be a nice on/off signal or a brightness one. Well, you're in luck.

Everything will be controlled by the microcontroller, so I probed all those tiny GPIO pins on the device. These pins are only 0.4mm apart so it took a steady hand, a sharp probe and it was made far more easy by a microscope. It turns out that PA16 contains that nice on/off TTL signal and a PA17 contains a nice neat PWM output of the brightness. Jackpot!

Now, soldering to the pins of a QFN (Quad Flatpack No leads) IC is definitely on the tricky side. I managed to trace that PA16 output to a slightly more accessible place - one end of the diode D3. It's still small, but a whole lot easier than the IC. See the photo for the location. Unfortunately I couldn't find any easier place to access the PWM signal, but we don't need that right now anyway.

So once this is plugged in to the mains again we have ground, 24V power and a 3.3V on/off signal. Anyone feel we could do something with this and a relay? Yeah - me too.

Step 4: Make Use of These Signals

Now, driving a relay from a microcontroller is something that's been done many times. There are even boards you can find on eBay. Just search for something like "arduino relay 24V" and you're all set.

A cheap SSR like the Fotek will do the job really well too. All you need it to connect the ground to - and the 3.3V output to +. I couldn't be easier.

I had the components I needed lying around so I decided to build my own relay board anyway - a 24V relay, a NPN transistor, a flyback diode and a couple of resistors. I also added a varistor just in case I decided to switch something like a fluorescent tube or an inductive load. (Think of it as a bit like a flyback diode but for AC.)

I knocked up a schematic and a PCB layout, but then prototyped it on some stripboard for speed.

Step 5: Testing It Out Before Fitting

OK, so this should all work, but let's test it out before going to the effort of putting it inside a light fitting. Here I'm using a multimeter on the continuity setting. When the relay closes the meter beeps and flashes. Success! The slight delay when switching on is because Hue lights always fade up. The output signal doesn't go high and the relay doesn't close until the light is set to 100% on.

Step 6: Connecting It to the Light Fitting

All that was left was to connect the Hue and relay PCBs to the light fitting. Luckily there was plenty of room inside the transformer enclosure for my track lighting so they're safely and easily enclosed and out of harm's way.

You don't have to put it inside the light fitting though. Maybe yours hasn't got enough room. It could go inside a light switch back-box. If you made a suitable (i.e. safe) enclosure it could be added to the lead of a lamp.

The best thing about this hack is that you now have control. It doesn't even need to be a light that you control, although of course your Hue system will tell you that it is. And teh best thing about this hack is that all the usual Philip firmware update will go through just fine. Philips will never drop support for your custom light because it shows as one of theirs.

I hope you've found this useful. Feel free to ask any questions, and please let me know in the comments if you connect up something to your Hue system.

Share

    Recommendations

    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest

    27 Discussions

    0
    user
    RonR99

    23 days ago

    @Fred27 - Thank you for taking the time to deconstruct the Hue bulb and prove that it can be electrically hacked. Your Instructable gave me the motivation to try it on my own. The Hue bulb I used was a standard 60w equivalent screw base Hue #LWB014. The inside of this bulb has no daughter board and the LEDs are driven by a fairly heavy transistor in a TO226 case sitting at position Q2. I added a piece of aluminum as a heat sink to this transistor and then used the output of the transistor directly to control 6 LED can light inserts. This works and shows no signs of overheating. Because the output of Q2 is presumably fully rectified DC, I lose half of the voltage when supplying standard 120VAC LED bulbs. The end result is that even though the dimming works; the controlled LED bulbs can only ever achieve half brightness.

    From long ago I recall that to make a controllable AC dimmer a Triac is needed. Triacs have three leads; Gate, MT1 and MT2. With a Triac the Gate has to be in common with one of the MT terminals and so there is no isolation possible. Without isolation connecting the output of the Hue PWM or LED output may lead to unpredictable results up to and including the terminal smoke escape event. To isolate the Triac an isolation circuit is needed. I searched long and hard for a combination device that would have the circuit already built in and could not find one. This Nuts and Volts article (Fig 11) shows what may work. I have not tried it. My challenge is stuffing all of this in a standard electrical box in the ceiling of my porch. http://www.nutsvolts.com/magazine/article/triac_pr...

    If anyone has any ideas or has already resolved this issue I am all ears.

    RR

    Fombell, PA

    It appears the newer Hue lights have a daughter board with the processor on it. It's connected to the mainboard by 7 connections. Possibly similar (I appreciate not identical) to the Cree lamps documented here: https://www.instructables.com/id/Controlling-Any-Light-With-Philips-HUE/

    IMG_20180110_161915.jpgIMG_20180110_164335.jpgIMG_20180110_161942.jpg
    13 replies

    Hi everyone!
    The daughterboard runs fine with DC 5V! and after desoldering one of the transistors you get a good PWM signal (inverted) which could be used to drive a NPN standard transistor. Now you're free to drive whatever you want :-)
    I use a powerful MOSFET (375W) to dim 21 x 10W halogen lamps (12VDC).
    First test with single 40W lamp was nice! no heat at all (except the lamp) ;-)
    The board itself runs with 3.3V but I use 5V to drive the MOSFET for "better" switching and lower heat on the power circuit.

    PCB BOT.pngPCB TOP.pngPCB BOT TRANS.pngMOSFET AND LAMP.pngPCB AND MOSFAT AND LAMP.png

    Hi,

    This is very interesting for me, thanks for sharing, as I had the previous board of the B22 which doesn't have the daughter board. I wonder if you could give me some information on where you bought the newer B22 with the daughter board ? Is there a serial number change on this new version of it ?

    I bought mine from amazon and I have these numbers:

    ASIN : B0152WXDD

    SKU : 929001137101

    I'd like to get the daughter board but I don't want to waste another similar B22 bulb without it.

    Could you describe the wiring and the parts on your last photo ?
    Another question, but the last one, could you give me some information on the NPN transistor and the mosfet so I can buy them too for my project.

    Thanks in advance for your time.

    HI CaiusTitus, I saw your private mail .. same as this so thought I'd reply so others can read.

    Regards getting the correct B22 (only UK market) .. this is very much unpredicatable. I bought 4x B2 so far a twin pack from Amazon UK and Argos UK. Both sets have the daughterboard. I've have to check the Hue part numbers later but were bought in last 5 months. I've only opened 1 of the euro E27's and this had the large board that 0xFred shows. I guess it depends which country you are in .. will change outcome.

    The wiring is easy and you need 3 connections. (1) 4v-25v DC supply (2) Ground (3) PWM 3.3v.

    The main issue is that this 3.3v signal is quite low and not enough for driving the power fet that W-G used, and output will be inverted. This looks like an FDH5500 ( https://www.ebay.co.uk/sch/i.html?_nkw=fdh5500 ) but not 100% sure. There are many power fet's you can use, just depends on your current / voltage loads and with / without heatsink. I used a IRF540N ( https://www.ebay.co.uk/sch/i.html?_nkw=fdh5500 ) in my tiny lamp control box shown below.

    As for NPN, then this looks like BC107 or something like that. It's too big for me so I use a small fet and mounted on the back of the daughterboard (see description below).

    Hi tekkfreakk, thank you for your reply.

    I Managed to find a bulb with the daughter board here in France at Darty, it's an E27 and the packaging is a little more grey(cf. photo below) than the previous one ( my previous B22) and mine had the silver text too.

    Regarding the (1) 4v-25v DC supply and (2) Ground I was thinking about leaving the daughter board on the bigger one maybe desoldering the big brown capacitor to get acces for soldering the wire to get the PWM signal and then put it back.

    About the FDH5500 or the IRF540N as I intend to drive 4x 7.2w 230v spotlights I think that their V(BR)DSS : Drain-to-Source Breakdown Voltage of 100v / 55V is not enough, is that right ? Could u suggest me a suitable one or maybe I'm just wrong about this.

    Also is it possible that the 3.3v is weak because the daughter board is no longer on the big one ? Also I'm not sure what you mean by weak as for the IRF540N the VGS(th) Gate Threshold Voltage needs to be between 2 and 4V ?


    Thanks in advance for your time.

    IMG_1434.JPGIMG_1443.JPGIMG_1444[51120].JPG

    Hi CaiusTitus,

    I tried to run the daughterboard powered by motherboard without the LEDs ...without success. I didn't manage to run it that way.... lost connection to the controller .... voltages and signals went crazy in the moment I disconnected the LEDs...

    to run AC voltage lamps n-chnnel mosfet will not work! you could try some "solid state relais" --> there are other ways but this could be quick & dirty solution!

    Have a look at switching times (pwm signal is 1KHz) but should be no problem.

    The PWM signal directly on the board has not much power - if you connect an additional transistor or mosfet or solid state relais this will not work! Thats why you have to replace the onboard l transistor or modify the circuits on the daughterboard.

    Hi everyone,

    sorry for the long delay .. I'm very busy these days...

    BINGO - The NPN is BC107 and the mosfet FDH5500 - as tekkfreakk already mentioned! (good job) a Vishay IRFP064PBF is fine too.

    The 3.3V PWM is very weak! even joust connecting the BC107 parallel makes a ugly wave out of the nice square-signal!

    And its probably possible to find other solutions - but I have not the time to do more reverse-engineering - so my solution is quick and dirty ;-)

    I bought the bulbs ad Conrad.de (here in Germany) - important ist the latest revision! Her in Germany are big electronic markets - selling the old versions of the hue bulbs! But in some online-shops like conrad.de they tell you that it is the latest version they sell! The latest version is labeled silver on white background - see pictures!

    One more thing: If switching lot of power - the PSU will make a 1kHz noise! (the PWM is about 1kHz) So always use a PSU with lot more power then needed to avoid this!

    IMG_0058.jpgIMG_0057.jpg

    Hi William-George, I guess you just had some BC107 lying around .. ;-) I prefer to use SMD power fets and attach them to the daughterboard. This is nice solution for the PT4115 GU5.3 lamps I have .. anyway I've attached the picture of my Hue part number and looks like identical to yours but the last digit 0== E27? and 1==B22? .. so everyone look for the SILVER text and the Model:929001137xB ...

    Screenshot-2018-05-04_08.51.47.png

    Hi. I would like to thank you all, for your import. But I do have a question if I feed the daughter board with 5v can I run a 3-32vdc ssr straight off the 3.3v connection that you indicated, or do I need to use a mosfet or a transistor before the ssr?

    Hi Trev1969, regards the ON/OFF on the daughterboard, to be honest I haven't looked to see where it is .. as I was only interested in the PWM signal. The SSR you mention may not work from 3.3v as it may not turn the SSR LED fully on. You'd need some fet to boost the 3.3v signal with pullup to 5v-12v etc. Oh, and pushing up the supply voltage to the daughterboard is no good as the ULDO drops it back to 3.3v internally.

    Hi William-George. Actually the daughter board runs at anything from 4-12.5v. I did a little more reverse engineering of the main B22 power board to see what else was going on. There is also a status pin that indicates 3 states, ON, OFF and CHANGE. My only worry (before I separated was if the micro would know if it didn't see the LED feedback signal (there's a divider from the full 90v on the LED string) that goes back to the daughter board.
    But as it seems happy running my under kitchen cupboard with CW/WW strips I'm hoping it's not going to shutdown on a diagnostics feedback failure ..
    BTW you don't need to take the transistor off, you still get the nice square 3.3v 1KHz PWM from the pin you indicated. My feeling is (not tried yet) is that you can just add a pull-up from the OC PWM signal on the daughter board to the 12v supply. It is strange that the TP6/7 didn't have the clean PWM.
    Anyway I'm driving some of the cheap "RGB LED Amplifiers" which actually work well.

    I've not seen the newer bulbs. There does seem to be significant differences between the E27 and B22 bulbs so I'm not too surprised. Those 7 connections are likely to be very useful and easier to solder to. Somebody needs to get a scope on them!

    Yep Fred, I've done it and know what the 7 pins do. Oh, and I've nearly finished the main power board cct diagram. The daughter boards are very very good, just wish we could purchase without the rest of the bulb @£5 each, ... and would have been great if they were inside the B27's!!!

    where can I find just a simple on/off signal on the daughter board? I just want to use the board to trigger a solid state relay.

    Hi Fred27, nice work!!

    What still makes me wonder is why not to directly use the 32 LED output to connect to a SSR accepting 32 V as your FOTEC example. If PWM switched, a diode between LED connectors and SSR combined with a RC parallel to the SSR might help. Will this do it too?

    Thx

    1 reply

    Well I did what you suggested and the on/off works well but you can't dim. As to why you can't dim I think it has to do with the response time of the SSR :

    ON < 10ms , OFF < 10ms ( http://www.fotek.com.hk/solid/SSR-1.htm )

    It is in my opinion too slow to keep up with the 3.3v 1KHz PWM signal mentionned by tekkfreakk.

    Hi
    This Projekt is very nice.
    Can you help me with a Problem?
    I want to control a LDD700H it needs 2-6V PWM Signal, could i use the PWM of the Controller direct?
    Or do i need a Transistor?
    Thx

    1 reply

    Hi Tim2309, depends which hue pcb you have. If it's the same as Fred mentions there maybe the same small FET as on the white hue PCB I use. Anyway looking at the LDD data sheet it looks almost identical to the PT4115 dimmers I've been using, so you only need an open drain FET to drive this LDD signal .. either the one on the board or an additional one in parallel!

    0
    user
    OleU1

    4 months ago

    I did something similar with Ikea Tradfri bulbs to build lightstrip-controllers. I made an instruction with some pictures, but - sorry - german only. But maybe the pictures and google translate helps: http://www.urban.tk/zigbee_lightstrip-controller....

    Its very cheap, as a Tradfri GU10 warmwhite costs only 6,99€ incl. VAT and a simple stepdown-converter (1-2€ via ebay) and a mosfet-module (1€ via ebay) will do to control a single-colour lightstrip or 12V halogen. I even tried 12V GU5.3, dimming worked down to 50% but they gave a bad sound (the explicit PWM-dimable ones).

    As the hue-bridge blocks some functions to products from other manufacturers, like homekit or ambilight, I think about using the controller from defect hue lamps (mostly the power-part or LED are defect and not the zigbee-part).

    Have anyone analysed a Hue E27 color ambiance 2. or 3. gen?