Custom Arduino-based Bekant controller. Design goals were to have it fit in the original housing and use as many stock parts as possible, be completely independant of the existing controller, as well as store any number of memory positions.
I've setup a store on Tindie for those who wish to order parts or an assembled version. https://www.tindie.com/products/gcormier/megadesk/
Unfortunately the beeps aren't captured well in the video unless you turn up the volume.
A second variant to the protocol has been found. It is the larger sized BEKANT, so it is possible it has different motors. These motors report their "idle" status value as 0 instead of 96, which can cause the buttons to not respond.
Pressing the UP button 16 times will play an ascending tone 3x and toggle the value (saved in EEPROM for persistence) that it will use.
- Small is 120cm x 80cm (47 1/4" x 31 1/2")
- Default firmware, should work out of the box
- When toggling modes, this is confirmed with a descending tone three times
- Large is 160cm x 80cm (63" x 31 1/2")
- Requires the 16x VARIANT toggle
- When toggling modes, this is confirmed with an ascending tone three times
- Have you tried turning it off again? :)
- Seriously - from testing many of these units, about 1 out of 20 times the handshake seems to fail as it does contain some random elements. A simple power cycle will provide a new handshake and the unit will power up.
- Try unplugging the desk from the wall and plugging it back in (With megadesk connected)
- Alternatively, try powering on the desk with NO controller attached, and then plugging in the megadesk after the desk is powered on.
- Is the safety key inserted? It is still required for the motors to engage. You will not hear any beeps when using buttons if it is removed.
- Try toggling to the variant mode described above by pushing UP 16 times. You'll hear a unique series of tones depending which mode it's in.
- Descending tone 3x, megadesk is now in VARIANT mode.
- Ascending tone 3x, megadesk is now in the original mode.
- Test the up/down button connectivity
- Holding UP while powering on will enter a button test mode, where the up/down buttons can be held to test that they are working - a power cycle is required to exit this mode.
- Clear all settings/memory
- Holding DOWN while powering on will wipe the EEPROM memory - a power cycle is required to exit this mode. Note this will clear the VARIANT setting.
- Recalibrate/reset the motors (New discovery : July 2020)
- This step must be done with the ORIGINAL BEKANT controller.
- Hold the UP and DOWN buttons for 8 seconds, after that let go of up while maintaining the pressure on the down button.
- The desk will lower until it stops on its own.
- Let go of all buttons, and test regular desk functionality with the original controller.
- Once functionality is confirmed, replace with megadesk.
- Plugging in any connectors backwards can probably damage your desk. Be very careful when working on your circuit.
- The power supply is 24V, and raises higher when motors are in operation! (Between 35-37V) This can generate a decent amount of heat for the linear regulators. Make sure to use genuine name brand regulators, and check the heat output before putting it back inside the casing and attaching it to your tabletop. Ensure to spec the main filtering capacitor appropriately (50v).
- Do not use ATTinyCore 1.2.2, it contains bugs that will prevent proper operation.
- Use up/down buttons as per factory module (long press/hold)
- To store in a memory slot, push the up button a certain number of times, but long-hold the last press until you hear some beeps corresponding to the memory position that has been saved.
- To recall a saved position N, push the up button N times.
If you want to create your own cable, the connector is AMP VAL-U-LOK by TE Connectivity - PN 1586106-3. Don't forget the crimp pins - Part Number 1586317-1 for 26-22AWG. Otherwise, the existing cable can be unsoldered from the board and fitted with a standard 2.54mm pitch header. Red is positive (24VDC), white is negative, blue is LIN.
Don't forget to set fuses on your board for the appropriate oscillator.
ATTiny 841 - 8Mhz internal avrdude -c usbtiny -p t841 -U lfuse:w:0xe2:m
I'm using platform.io for development. Integrated into Visual Studio Code, it's miles above the Arduino IDE. Note that while we're using pio and vscode, the actual code is still using Arduino libraries - we are not coding
native AVR code. In other words, there are still setup()
and loop()
blocks, and all Arduino modules are available (but handled via pio).
You can find plenty of tutorials online on getting started - this one is a good start.
As the megadesk does not have any USB connectivity, you will need a programmer to connect and program the megadesk via PC.
My go-to programmer is the Sparkfun Pocket AVR Programmer. It has a small switch which will either power the device, or not. Having power available is nice for one-off flashing, but if you plan on developing on an AVR, it can be useful to use serial logging. As the megadesk would already be powered up by the desk itself, you do not want to have the programmer supplying power as well.
The header is a standard 6 pin 2.54mm pitch connector (eg. https://www.digikey.ca/en/products/detail/amphenol-icc-fci/68602-406HLF/1657836 )
On board versions v1,v2 and v5, this is a standard connector which will accept a typical AVR programming cable on the top of the board.
For v4 boards, as many people were not developing, I flipped it upside down so I could program the boards easier when making the boards. As a result, you will need to check the pin mapping accordingly for a top mounted programming header, or, flash from the bottom side of the board.
16mA on the Atmega 328P, 3mA on the MCP2003B.