Custom Firmware For IKEA’s ORSALA Lamp

These days, home appliances are equally as likely to have soft buttons and rotary encoders as they are to have a simple old clunk/clunk power switch and an analog knob for controls. This is all well and good if the device aligns with your personal philosophy about how such controls should work; otherwise, it’s absolutely maddening. [j-zero] ran into this problem with their ORSALA lamp from IKEA, and set about rectifying the problem with some custom firmware.

The ORSALA lamp uses a rotary encoder for setting both brightness and color temperature, with a button to toggle modes. A long press is required to switch the lamp off. The custom firmware modifies this behaviour, such that the lamp can be switched on and off with a simple button press. Turning the encoder modifies brightness, and turning it to minimum switches the lamp off too. Meanwhile, the less commonly used color temperature setting can be modified by using the button while adjusting the encoder.

The hack was executed by reprogramming the ORSALA’s onboard microcontroller, the STM8S003F3P6, via its SWIM interface. The pads for the interface are easily located on the board, making the hack easy. Other than the inputs, the lamp packs separate TTP932 LED drivers for the warm white and cool white LEDs, making it easy to code a custom firmware to handle all the necessary functions.

It’s a great example of a hacker taking control of their own device and remaking it to suit their needs. Of course, if you want to go for another hacker trope, just stuff a Raspberry Pi in there instead!

29 thoughts on “Custom Firmware For IKEA’s ORSALA Lamp

  1. Mmh, the FW might be nice but:
    * There is no license. This mean we can just look at code. Not copy, compile or run it, if you follow the rules. I see someone already noticed it.
    * There is a copy of what appears to be original FW. I’m not sure this is legal, without IKEA’s permission.
    * The choice of needing to press to button while turning is really awkward for me. A long press to switch mode is what I prefer in these cases – but de gustibus… and it’s of course easy to change!

    1. This is very common for an articles on Hackaday. Even when articles authors write “open source”, it can be just 100% copyrighted code without any permission.

      I’ve already created >70 tickets for code authors, with request to use any popular opensource license. Most of them are closed with a positive decision. 16 tickets still open.

      1. Great! I noticed that, and I just made a PR with MIT license.
        As the underlying library is LGPL2.1, and source and methods for relinking are trivially provided, I think it’s the best option.

        And yes, that’s also a pet peeve of mine, when I notice it I always raise an issue or make a PR.

      2. Looks like this is already fixed: now it’s “beer ware” license – one I’ve seen, but not sure it actually meets the osi definition or the dfsg. Strangely, though, the “unlicense” does actually get the nod, so maybe if anyone reading wants a “do anything” license, that’s worth a look for next time. (I don’t remember if the WTFPL is as widely accepted). Oh, license proliferation….

      3. IANAL: To my understanding “open source” alone doesn’t imply anything else than that the source code is shown. (Not to mention that all code is 100% copyrighted, but the license is the only thing allowing any use, derivative works, or giving the rights away.) It is easy to attach the “free to use” type interpretations to the term, as they often go hand-in-hand. And for many private uses, people don’t care about license as long as the job gets done. My impression is that this is slowly changing towards more awareness on the necessity of licenses.

    2. I have to agree with newbrain on the “hold to change color temp” feature. I’m currently trying to find a equivalent but with only one touch interface. So far I have on/off on single tap, change brightness on hold. But I’m not sure what would be best for color temp changing : holding longer, double tap, something else…

      1. You could do what I think is an under-used interaction: tap then tap and hold. (Down, up, down…) Distinguishes it from just regular hold, but providers the same variable-duration input.

        1. Also, long press, have the lamp sort of pulse in ack, and you dial (without pressing) the knob to adjust the colour. and either long press when done, or after a few seconds of no adjustments, the lamp drops out of adjustment mode.

  2. I think a very interesting detail that was not mentioned in the article is that hacker, j-zero, used the Arduino software framework to do this, unless I’m missing something here. His main source code is in orsala_hack.ino. This has very interesting implications to hacking other devices. If they have a Arduino-compatible micro (or a close-enough compatible one), shooting new code into it becomes a lot simpler. Great job!

  3. Oh, I have a few ideas on how to improve this even more, and putting them into Arduino code should not be too much of an issue, it’s all very straightforward in there. There are really nice LED desk lights out there, but they are universally horrible when it comes to user interface and functions. Easy hackability turns this one into a prime target.

    1. For even more hackability there are a heck (no pun included) of unused pins. For example UART is not used at all. But they are not as accessible as the SWIM interface.
      Also the power supply is 19.2 volts an can possibly replaced with a USB-C power delivery chip.

    1. I don’t have a problem with long press, except when it’s used for the more frequently used interface – on/off should (IMO) be a quick tap, and a long press is some other action (if implemented). I have a floor lamp that is much the same here – long press to turn it off, but short to cycle through colour. Er, which do you think I’m going to do more often? Also, the lamp I mention doesn’t save colour and intensity to flash, so if it’s plugged into a switchable outlet, when you switch it back on, it’s back to a factory default, which is nearly as lame as the poor long/short assignment.

    1. Almost every modern electronic item has firmware in it somewhere. There’s no reason not to when the alternative to a 3 cent microcontroller is a dollar’s worth of discrete circuitry.

      1. 30 mA where? At the power plug, at 230V? According to the datasheet the STM8S is supposed to draw a maximum of 4mA (typically ~1.8mA), and that’s at 3.3V. I don’t believe any amount of code optimization will make a significant difference there. Someone CMIIW please.

          1. Unsurprising about the MCU and its part in power consumption. That’s still a bit shocking, though. 30-35mA at 230V equals roughly 7-8W. What’s going on there, is the PSU so horribly inefficient?

Leave a Reply to src1138Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.