Philips Hue – control anything hack

To be honest, my recent simple relay hack wasn’t really all that great. It just used the high power constant current output to drive a SSR. It wasn’t ideal, but it worked. I decided that it was worth the effort to track down some more useful outputs and properly detect the desired state of the bulb.

b22_closeupAll it took was a little bit of poking around and probing the pins of the SAM R21 microcontroller with an oscilloscope. It wasn’t actually that hard. On the B22 bayonet fitting version of the bulb I found some.

PA16 (pin 17 of the microcontroller) has a simple on/off output. It’s high (3.3V) if the light is on  at all and low if not. This is the perfect output to use to drive a simple output for a relay. It can be run straight to a SSR if that’s appropriate for your load. Or it can be used as an input to another microcontroller, a transistor to drive a relay, etc. This is probably the easiest one to use for a simple load. A slightly easier place to access it is on the end of diode D3 nearest the micro. It’s still some fiddly soldering, but it’s easier that a QFN pad on the SAM R21 itself.

PA17 (pin 18 of the microcontroller) has a decent PWM output. Unlike the one I found on TP5 of the E27 bulb, this stays high when the bulb is 100% on. It’s a 3.3V signal. It doesn’t seem to be quite linear – i.e. 50% brightness isn’t a 50% duty cycle but this may be deliberate to compensate for how bright it actually looks.

TP25 has a DC voltage of about 14V which is fed to the LM2204 3.3V regulator. This seemed handy for driving the coil of a 12V relay.

I rigged up a simple relay circuit – using the 3.3V PA16 output to drive a NPN transistor that can then drive the relay. Add the usual flyback diode (and a MOV across the relay contacts for the benefit of inductive loads) and all is g0od!

17 thoughts on “Philips Hue – control anything hack

  1. Pingback: Philips Hue – simple relay hack | 0xFRED

  2. Thanks for this write up . It gives me the confidence to rip a bulb apart and start to use them to replace my insteon din relays that control most of my kitchen.Top man

  3. Nice write up, been doing something similar myself. Question, did you float the scope’s ground when checking test points ? I did not and blew up my sample, they must be floating the ground and my scope was grounded.
    Prior to that, I was able to run the 3.3v ON/OFF rail into a control board I ripped out of an old ON/OFF switch.
    My next move was to do the same with a dimmer switch and control the dim level.

  4. I didn’t do any poking around whilst the board was powered. You can get it up and communicating using the signal GND (TP1) and either supplying 3.3V (to TP7) or a higher voltage (5-12V is good) to TP25. See my earlier LBW010 teardown post for details.

    My power supply is isolated, so the scope ground wasn’t a problem.

    • The problem is that I used a scope ( which is typically grounded unless a cheater plug is used ) to probe the powered board. This is very normal but I simply forgot to use the cheater plug, silly me.

      Anyway, I have 2 new samples and I plan to do further testing this weekend. I allready have a makeshift Dry Relay Output Wireless Switch working ( using the ON/OFF signal), my next goal is to interface a digital/electronic dimmer to the PWM signal.

  5. First thank you for your post as I was thinking about doing the same thing my self and your article encouraged me ! I’m trying to figure out how to connect a wire on a pin of the microcontroller as they are so small … And a last question, my hue B22 bulb doesn’t have the same microcontroller, too bad for me :/ , any suggestion on how to find the PWM pin out of the 48’s of the ATmega2564RFR2 ? Thank you for your time and I look forward having your ideas on this !

    • I have a B22 bulb which i used in a previous project. When I get a chance I’ll see if I can find a similar PWM output.

      I found it by powering the device from 3.3v (for safety), setting the bulb to 50% and probing the pins with an oscilloscope. A microscope is helpful here. Then I checked for continuity to a slightly more accessible point on the PCB.

      Soldering to SMT devices isn’t easy. Once again a stereo microscope really helps.

  6. That would be really helpfull for me as I don’t think I can get my hands on an oscilloscope 😉 I’ll have to try with a stereo microscope, better than my magnifying glass on the third hand soldering stand.

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

    • I’d have thought it would be OK. LEDs are current controlled so should work but perhaps a little dimmer. Take a look at my earlier floodlight hack which is easier than this. You should just need to disconnect the Hue’s LED board and connect your own LEDs in its place.

      All at your own risk though – don’t try it unless you’re prepared for potentially destroying the Hue PCB or the downlighter!

  8. Hi 0xfred, love the stuff you are doing .. your tear-down and the recent Philips price drop (of hue stuff) motivated me to buy some of their kit and have a look too. I’ve been messing with home automation for sometime now, but now consider the zigbee stuff the way to go, especially with zigbee 3.0 coming to the hue hubs soon.
    I have same niggles as you of “how to replace” non-standard lighting with hue hub control?! Like under kitchen cupboard stuff, 20x GU10 rooms, xmas lights, fancy G4 lighting floor lamps etc
    JFYI I tried popping off the top a newish B22 last week, and seems Philips have been busy changing the designs again. The one I have has 26 LED in series running at 90v (not measured the current yet but must be 100ma or so).
    Q. What was the PWM frequency you found on the PA17? At the moment I’m thinking of using this directly with some LED amps (cheap FET switches) driving 12v strips and MR16 DC12v bulbs, but didn’t know whether this was too slow a frequency? I guess anything above 100Hz should be OK. (N.B. I haven’t destroyed the bulb yet, as it seems others can’t find the PWM signal, so it may not exist on newer bulbs?!?!?! I guess could just be a DAC output into a current control circuit)

  9. Hey, I am from germany and I thought this is awesome to rebuild.
    Here in germany the socket is called E27.
    My inner layout is very different from yours showen above.
    I’ve got around 100V DC at the two pins which connected to the LEDs.
    Means, I can’t use your first method “Philips Hue – simple relay hack”.
    Do you’ve got a newer tutorial to use the 100V for control everything?
    Would love to use it for some other lamps.
    Greetings from germany!
    Sorry for my bad english^^

  10. Just wondering if any third party zigbee components could be integrated into Philips Hue system?
    For example Xiaomi Zigbee Socket could potentially do the same job. And it’s about €12 in China.

    • That would be entirely up to Philips. In theory all ZigBee devices are compatible but manufacturers seem to like keeping control of “their” system. IKEA tradfri bulbs didn’t work until recently.

      • I actually work for Philips and can say that I highly doubt this will happen.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s