IKEA Bekant Desk, motorised hack? - Page 1
Forum section: electronics / beginners

author: onesixright
author_rank: Frequent Contributor
timestamp: August 24, 2015, 08:19:42 pm
content: Hi All,I got a IKEA BEKANT motorised desk. I was trying to hack the controller, so i could send my own signal (via USB) for moving up and down. Basically controlling it via my computer. Itseemedpretty simple, just 3 wires. But, you guess, its not.The remote control looks straight forward, 2 momentary push buttons, one moves it up, the other down. Added a photo of the PCB.Th power supply is: DC 34V 200 watts (ROL ERGO). It delivers 24V DC.The basic setup is like this:LEFT +----- (3 wires) Remote Power (DC 24V) ----+ RIGHTLEG +-------------------- 3 wires ----------------+ LEGAfter opening the remote control, i found a PIC16LF1938 inside and that explained partly why its not that simple. There are 3 wires: Red, Blue and White. I measured the following DC voltages (without any buttons pressed):Red - White = 24.62V (equals power supply output)Red - Blue ~ 14-15V (fluctuates)White - Blue ~ 9-10V (fluctuates)To me to seems a bit of overkill to use a PIC16 for this pretty straight forward function?The manual states the motors stop automatically when it reaches either end. Not sure if thats why they need a PIC16, maybe to measure some sort of overload? It also states you need to wait 9 minutes after operating the motors for 1 minute (cool down).Last thing, the circuit doesn't seem to be fully populated, so i'm guessing its some type of standard design. I was trying to google some numbers, but i got nothing.These are the numbers on the other side of the PCBCTI150E15792514 19 94V-068002420BAB 2012-03-24So, my question is, is there anybody that understand how (and why) it works? Somehow the motors need to get both (simultaneous) the signal to start turning, on top it needs to understand which side to turn (polarity?). I'm not thinking its just 'shirting to wires' like a simple switch. I couldn't open the legs, but im guessing there are a few components there as-well. I was also looking at h-bridges, but im not getting the idea that thats on the side of the remote. Maybe its inside the legs?Im really interested to learn how this actually works!The goal is to make something so i can send/create the signals myself (even without the remote).I saw one guys did this by opening the front-panel and shorten the push-buttons, but thats to simple! ;-)Many thanks!

author: sitandstand
author_rank: Newbie
timestamp: August 24, 2015, 08:53:41 pm
content: Hi, Onesixright,I am not an electronics fan, only an IKEA consumer. I am "glad" to know that I am not the only person finding the output being only 24v, not the labeled 35v.Does your desk actually work? Mine doesn't, and I suspect it is because the DC output is too low.I've called IKEA twice already. They sent me two replacement power adapters, all with exactly the same issue. Their phone service has been useless so far. I may stop by their store (when I travel to a nearby attraction) to check out their display unit, which I know works. Sigh ...

author: onesixright
author_rank: Frequent Contributor
timestamp: August 24, 2015, 09:03:09 pm
content: Quote from: sitandstand on August 24, 2015, 08:53:41 pmHi sitandstand,Yea it works perfect, to be honest better then i would have thought! Its true the DC output is lower then it says on the adapter (and manual), but it works. Are you sure the remote is working? There is a little pin you need to put slide in the controller, otherwise it doesn't work! Maybe try to measure the DC output on the leg where you plug the remote in? My first guess is, it has to do with the 'pin', try the other pin?Good luck!

author: sitandstand
author_rank: Newbie
timestamp: August 24, 2015, 09:29:06 pm
content: Thanks for the quick response! It is good to know the voltage is not an issue.I did try playing with the pin, but then got side-tracked by the voltage observation.I will give it some more tries.

author: amyk
author_rank: Super Contributor
timestamp: August 25, 2015, 01:40:50 pm
content: That PIC runs on 3.3V provided by the LDO (L00B, LP2980IM5-3.3) and so it looks like the rest of the circuitry might just be a buck switching regulator to bring the 24V down to something the LDO can handle. The blue wire will be for signaling, probably some sort of serial protocol.

author: jeroen79
author_rank: Frequent Contributor
timestamp: August 25, 2015, 08:15:22 pm
content: You could look at the blue wire with an oscilloscope and/or logic analyzer.Or measure things like AC voltage, frequency and dutycycle.A digital serial interface could be used.Or perhaps PWM to tell servos in the legs the desired height.Does this desk have an option to remember standing and sitting heights for easier changes?That could explain why they use a PIC.

author: onesixright
author_rank: Frequent Contributor
timestamp: August 27, 2015, 08:21:49 pm
content: Thanks for the input!I hooked up my scope to the blue wire (see the scope-shots). And indeed, there is some type of signal, interesting! There is some type of pattern. It looks like 11 'lows' (negative -10V), then ~ 50ms its 0, then it repeats. I inverted the signal, and trued to decode it (9600,n,8,2).If i would interpreted these as 11 'bits' (if they are) could be 1 start, 8 data + 2 stop = 11 bits?When i'm pressing the buttons, i dont see much change. I also wonder why the PIC would send out this 'heartbeat'?I disconnected the remote, so i could see if the signal is in- or outgoing (see image #4). And it seems its coming from the PIC.Is there some type of 'industry' standard protocol that would be used for signalling the motor to start turning (and which direction)?Any clues how i could (or should) continue?Screenshots 1-3 the heartbeat being send, screenshot 4 is the signal coming from the 'leg' when remote is disconnected.Thanks!

author: jeroen79
author_rank: Frequent Contributor
timestamp: August 28, 2015, 10:09:20 am
content: Does the width of the pulses change?If your scope can freeze the image on a trigger then you try to catch the frame right after the button is pressed.You could also use another microcontroller as a makeshift logic analyzer/logger.My guess is that the PIC is constantly sending commands (position or movement) to the legs.The 50 Hz in image 4 is the same as the mains AC.

author: onesixright
author_rank: Frequent Contributor
timestamp: August 28, 2015, 12:26:48 pm
content: I can setup my scope for a trigger, you mean like a external trigger?Anyway, i could hookup my Arduino. Good thought! Thanks!You have any idea why it would keeping updating the legs (if i disconnect the remote, nothing changes...)? Could this have to do with some type of synchronisation? Of course the legs need to move together at thesametime.I figured out its just a AC frequency

author: jeroen79
author_rank: Frequent Contributor
timestamp: August 28, 2015, 06:37:37 pm
content: Quote from: onesixright on August 28, 2015, 12:26:48 pmMore like a pause function that freezes the screen at the moment of the pause and that can be triggered externally.QuoteYou can let it record the time between the risings and fallings of the signal so that you can record a longer period without needing a lot of space.QuoteMaybe just because because they can afford it? This is not an application that needs every bit of bandwidth or processing power so continuously sending commands would not hurt performance.Likely the blue wire carrying the commands from the controller to the left leg is continued in the cable between the legs. That way both legs will get the same command at the same time.

author: Chris C
author_rank: Frequent Contributor
timestamp: August 28, 2015, 09:15:37 pm
content: Ever looked at how a hobby servo works? They have a motor, a potentiometer, and a little controller, all together in one box.You control them by sending pulses over a single wire. Thepulse widthdetermines the position you want the servo to turn to. If the pulses stop, the servo stops too.I'm going to take a guess your legs are driven by servos too. Just servos designed for linear movement, instead of rotation. That would explain why the pulses you see don't change very much when you press buttons on the controller. You'd have the same number of pulses, same spacing, only the width of the pulses changes. And even that would change rather slowly, if you're pushing up/down buttons.I Googled "linear servo", and some came right up. Hobby servos have a standard input signal format, linear servos probably do too. If I'm right about this, between the oscilloscope trace and the datasheet for a linear servo or two, you can easily replicate the control signal. Maybe even with an existing Arduino servo control library!

author: JuKu
author_rank: Frequent Contributor
timestamp: September 07, 2015, 09:17:50 pm
content: Can't you connect additional (PC controlled) switches across the existing switches?

author: Kjelt
author_rank: Super Contributor
timestamp: September 08, 2015, 09:33:40 am
content: If you have two motors, one in each leg it is ofcourse essential that both motors turn exactly together and synchronised or your desk will get out of level.Simple things are often quite more difficult if you have to prevent all things that might go wrongThese days it is often easier and cheaper to use microcontrollers than dedicated hardware, esp. if there are a lot of exceptions in the equation.

author: onesixright
author_rank: Frequent Contributor
timestamp: September 10, 2015, 09:03:18 pm
content: Hi All,*UPDATE*I soldered two wires to the PCB (on white and blue). Then hooked up the scope, set it to rolling mode. Its weird, since i see the bit pattern repeating, but when i press the up/down button,nothingseems to happen at all (!). So thats kind of curious, the pattern just keeps repeating itself.@Juku, thanks, yes thats a option (when just looking at the result). I have actually seen somebody do it. But it doesn't seem te "correct" way, for me. I would like to understand how it actually works ! ;-)@Kjelt, yes i thought of that as-well. It would bring some serious problems if one leg would be moving while the other doesn't.Any (other) thoughts?

author: darthsteven
author_rank: Newbie
timestamp: January 05, 2016, 10:32:41 am
content: onesixright did you get anywhere with this? I want to make something that allows me to save a preset height for the bekant desk to go to. Ideally it would be done in a more elegant way than 'pushing' the buttons with a relay or something.

author: ivaylo
author_rank: Frequent Contributor
timestamp: January 11, 2016, 05:41:11 pm
content: The engineers here did a prank on a coworker here. Wired a WiFi remote (https://www.sparkfun.com/products/13231) to her Bekant desk and added a link on the company intranet portal. Now everybody in office can "adjust" her desk whenever they want. Glad she has a good sense of humor...

author: Marco
author_rank: Super Contributor
timestamp: January 11, 2016, 08:23:34 pm
content: Presumably they use steppers, simplest way to keep the legs in sync.

author: onesixright
author_rank: Frequent Contributor
timestamp: March 05, 2016, 12:25:34 pm
content: @darthsteven!No, unfortunately not really. Truth be told, i needed to let this project rest for a while. But its still high in my list! Its just that my knowledge isn't enough to "grasp the concept". Apparently the steering signal is on top of a voltage. But how to figure out what are the signals (which can not be hard: up and down), there is also the "problem" the signals are multiplexed.I didn't want to go the way of "soldering some wires on the buttons", that 2 easy. Anyone having experience with how something like this could work, im happy to hear!@macro, steppers? You have any info on how that would work?@ivaylo got a link to this "prank" ?

author: onesixright
author_rank: Frequent Contributor
timestamp: March 05, 2016, 12:30:00 pm
content: This guy try to figure it out as-well, they are running into similar problems.https://plus.google.com/+GinaHäußge/posts/3U5k1qKdLxH

author: onesixright
author_rank: Frequent Contributor
timestamp: June 08, 2016, 08:08:37 pm
content: OK, someone got furtherApparently its the LIN protocol.https://en.wikipedia.org/wiki/Local_Interconnect_NetworkMore info:http://blog.rnix.de/hacking-ikea-bekant/

author: grifftech
author_rank: Frequent Contributor
timestamp: June 08, 2016, 10:32:44 pm
content: Use servo motors to push the buttons

author: timofonic
author_rank: Frequent Contributor
timestamp: June 09, 2016, 01:48:24 am
content: What's the difference between linear actuators and linear servos? This video mostly explained one of them. The geekier and the smartest guy gets ignored by that "cool guy" one :/Who's the one with the hat? Can we invite him to EEvBlog?

author: robin7331
author_rank: Newbie
timestamp: January 29, 2017, 10:28:43 am
content: Hey guys,I've successfully hacked this tableIt acutally worked fine but I've missed some memory buttons that I only have to trigger once to let the table move to that position.Made a little video.You might be interestedCheers!

author: onesixright
author_rank: Frequent Contributor
timestamp: January 29, 2017, 10:52:35 am
content: Quote from: robin7331 on January 29, 2017, 10:28:43 amAwesome! Thanks for sharing!Just a few remarks.You should check the motor doesn't run for more then 10 seconds (top of my mind), as explained in the manual (because of overloading/heating). After x seconds you want a pause.My thought was not to hack the remote, but -since its a bus- addsecondmaster. This master you can then command via USB. Basically you could control the height via some short-key on your computer.

author: robin7331
author_rank: Newbie
timestamp: January 29, 2017, 11:04:12 am
content: Thanks!Well, as I simply simulate a button press instead of driving the motors directly I might already utilize some built in protecting stuff.I'm not sure but I think that if you use the motors for >10 seconds in a row there is a built in 60 seconds cool down time.I was also thinking of adding a second bus node but then I thought that my main purpose is to add those memory buttons.These buttons have to be put somewhere so why not replace the old console with a new 3D printed one.My arduino is absolutely controllable via USB. I've made a simple command parser (similar to AT-Commands). There you can set a specific target, change the threshold, store a position, call a position etc..Its on GitHub:https://github.com/robin7331/IKEA-Hackant

author: onesixright
author_rank: Frequent Contributor
timestamp: January 29, 2017, 11:27:59 am
content: Quote from: robin7331 on January 29, 2017, 11:04:12 amThis is i got from the manual:QuoteBecause thewaythey write this, I'm not sure if it had built-in protection. Well you know, with maybe kids around (they love to press buttons)Bit of extra protection couldn't hurt.I think you can flip your Arduino pretty easy into a LIN Master/Slave (?). Did you actually figured outwhichis the master? If you would unplug one leg, it could ruin your day. I don't know much about the LIN protocol, but as i understood you can have multiple masters. Maybe each leg is a master?The legsmustmove simultaneously. I was at the point of removing the controller and see if the legs are the ones transmitting (being the master). But never got to it.BTW you solution is great, i just wanted to take the opportunity to get better understanding how the LIN protocol was utilised.Thanks for the source! I'll have a look at it

author: robin7331
author_rank: Newbie
timestamp: January 29, 2017, 12:19:01 pm
content: QuoteWell yes your probably right! This should be fairly easy to implement in software. (I don't have kids in my office, therefore I'm not gonna implement that. Feel free to do that and hit me if there are some questions!)QuoteThe control PCB is the LIN master. That's why you see something on your oscilloscope even if you have it unplugged from the rest of the table.QuoteLIN only supports a single master device. It's a pretty easy and straightforward protocol. The master sends a packet header (thats what you see on your scope even when it is unplugged). Every header consists of an identifier. So the slave nodes listen to every header frame that comes in. They have their identifier hardcoded and if they see a frame with their ID they will respond with some data and append that to the header frame.So if you move your table up you won't see very any additional packets. It's the same as before except the data of one special packet is updating the position. As far as I know the master device sends a desired target position. The legs (LIN slaves) receive that positioning information and move the motors until it matches that.My new device did not replace the LIN master. It basically is a new LIN slave. The only tethering I have are a common ground wire, a single wire to get the LIN bus and two wires that simulate a button press. You can easily mount that old enclosure back and have that new controller somewhere else.

author: onesixright
author_rank: Frequent Contributor
timestamp: January 29, 2017, 12:24:07 pm
content: Awesome, I think i mixed-up LIN with CAN (CAN supports multiple master)I'll check it out! Thanks!

author: robin7331
author_rank: Newbie
timestamp: January 29, 2017, 12:30:50 pm
content: Sure no problem!Well LIN is also something that is usually used in cars. (Thats probably why the bus level is at roughly 12V).Maybe that's why you got confused

author: robertaramar
author_rank: Newbie
timestamp: March 09, 2017, 11:29:30 am
content: Hi,I used Robin's instructions and code to build that solution in my table.Please see some instructions here:https://robertaramar.wordpress.com/2017/03/09/hacking-an-office-desk/Thanks for your work, RobertRegards,Robert

author: Simon
author_rank: Unknown
timestamp: June 05, 2021, 08:32:50 am
content: Quote from: onesixright on January 29, 2017, 12:24:07 pmAs I was brought here to delete some spam which I am sure you were all notified about I won't feel too bad about posting on an old topic. There is no master or slave in CAN. Every device just transmits what it wants to transmit when it wants to. But the design is very clever and will resolve bus collisions without loss of all messages so no time is wasted.The only hierarchy is given by the ID of the message being transmitted (strictly speaking a device does not have an ID the message(s) it transmits do). Because the 0 state dominates (bus driven) and the 1 state is recessive (bus released) the message with the lowest number because it has more "0's" will win arbitration, each device monitors the bus whilst transmitting so if another device is also transmitting a message with a lower ID when the first 0 transmitted happens it overrides the 1 transmitted on the lower priority message and the transmitter of that message sees that it has been beaten to it by higher priority message as the bus state is no longer what it is transmitting and it backs off and the higher priority message goes through unimpeded and non the wiser that something else wanted to transmit as well. The device sending the lower priority message will have another go at a set interval later. For this to work the design of the system must be so that the bus cannot be more than 70% loaded or lower priority devices will start to mis out.As such you can't have multiple devices sending the same message ID as this will corrupt the bus. So everything is just transmitting oblivious to who is seeing or doing what with it's message, no masters, just higher priority messages that will be guaranteed to win through.