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!

Advertisements

10 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?
    Thx

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s