Sit/stand desk fix or upgrade?

Hemi345

Senior Member
I have a motorized sit/stand desk and one of the buttons quit working on the control. The control has an RJ11 connector with 4 pins. 2 pins (soldered together in the photo below) show 24VDC when connected to either of the other two pins with my multimeter. When either of the other two pins are shorted to the 24V, the desk moves up or down.

So one of my complaints with this system over the years has been the need to hold the button down to move up the desk up or down. I wish I could have afforded the more expensive model to get the preset positions, but whatever. The easy answer to fix this is buy a new control panel - but where's the fun in that. The other option is to snip the end off the RJ11 cable and add a switch - solves the issue with holding the buttons down while the desk moves but still doesn't give me preset positions. Option three, pimp out my desk by mounting an ultrasonic ranger finder under there, use a PICAXE to program in my own preset height adjustments and some MOSFETs to signal the motion.

I don't know the circuit design for the desk so I'm making an assumption that the 2 pins that are connected to the buttons have pull downs on them. When shorted to 24V, the relays near the motors activate. The relays and such are packed away inside one of the motor assemblies (photo below) so trying to take it apart to see how it works would be a very involved process (for one, I'd have to clean off my desk to unload the tension and that's a feat in of itself haha). I could tap into the 24V cable (red arrow) to supply the PICAXE with power but was just wondering if I could have a more tidy setup by using just the RJ11 cable (yellow arrow) to power my little project too (since one of the pins would always be low/gnd). Just FYI, the blue arrow is pointing to a cable that connects left motor to right motor. Thoughts on this?

20181030_140027.jpg20181030_142234.jpg
 

techElder

Well-known member
I would count revolutions and partial revolutions of the motor to get incremental height. Would be real easy to clamp a split index wheel on the motor shaft.

Power the PICAXE with batteries, but use your UP/DOWN buttons to apply power only when you want to move it. Use one pole of DPDT switches for the power.
 

Hemi345

Senior Member
Thanks for the additional ideas Tex. What would you use to count the revolutions? Magnets and hall effect sensor or some type of optical sensor? The shaft is 1/4" / 6.35mm. The shaft end sticks out the side of the desk about 5/8" with about 1/2" clearance at the top (7/8" diameter wheel/pulley/sprocket should fit) so I wouldn't need a split clamp wheel (photo below). Maybe something like this with magnets glued around the perimeter: Pulley

I was thinking of an ultrasonic range sensor because it wouldn't need any calibration. Counting revs, I'd need to write the current position into EEPROM every time it changes if PICAXE resets or batteries die. Otherwise, would need to build something to lower desk to base and zero position counter.

I was trying to stay away from batteries but realize that the 24V from the desk might be very noisy and like you said, pushing the button could turn the project on, do it's work, then power back off... probably run on a single set of AA batteries for a few years. But I found the compatible Molex connector parts to tap into that power ($2), so I might make a pigtail and regulate it down using a TPS70933 to see if I can eliminate batteries.

20181031_101723.jpg
 

techElder

Well-known member
First ... think it all through BEFORE you start building it.

You're probably trying to make it more complicated than it needs to be. A three battery pack is so simple compared to the alternatives.

A counting wheel could be as simple as a child's toy wheel with some holes drilled in it or even with some reflective-tape "spots" to count. You know eBay. Look there.

Certainly take advantage of all parts of a PICAXE processor; EEPROM included! Think it through from start to finish.

Keep track of where the desktop is. Then you'll know where to go when the UP or DOWN command comes in.

You could even have a fixed "bar" with the adjustable stopping points screwed onto it. Maybe you don't even need a PICAXE, but that won't be much of a challenge or as much fun. :D
 

Hemi345

Senior Member
Not sure what to search Ebay to find a device that'll count spots, got any links?

Found these Rotary Encoders. From what I can gather, the shaft is 6mm, so this coupler to connect it to the 6.35mm shaft.

Or something like THIS (6mm bored out to 1/4") and 3 or 4 neodymium magnets stuck to it and a hall sensor.

I'm thinking three buttons. UP, DOWN, and PRESET. I can hold UP or DOWN for fine adjustments and position desk to set my preset positions.
Hold PRESET down, an LED comes on to indicate it's in programming mode, press UP button to indicate that's the new "stand" preset position -- or press the DOWN button to indicate that's the new "sit" preset position. LED goes off.
Press PRESET once, desk moves to opposite preset position from where it is now.

I still want to try using the 24V. Rather just use the power available than deal with batteries. Yes, it'll add a vreg and some filtering and decoupling caps, but it would be a cleaner install IMO and maintenance free. Plus, if it's always on, I could add Bluetooth to control it with my phone or WiFi so it could Tweet my desk position. LOL (kidding, maybe).
 

inglewoodpete

Senior Member
This can become quite complicated. Not only does the controller need to know where the table currently is but it must be able to learn your two preferred working positions.

If your position feedback system does not provide absolute position data, you will need to have limit switches or motor over current detection. That way, if the controller does not know the table's absolute position at boot-up, it can assume a starting point but recalibrate if it strikes a travel limit when positioning it. Remember that power glitches and PIC reboots always seem to happen when they are least wanted!
 

Hemi345

Senior Member
I'm not worried about travel limits. The motors have this already built in. The buttons in my picture above are simple make/break switches. If I held one of them down while moving the desk to the top or bottom limits, the desk will simply stop without any issue. I am just going to replace those two buttons with transistors to act like me holding the button down.

I believe I'm back to using the ultrasonic range sensor (HC-SR04) again. With the HC-SR04, I can read the desk's current position to the floor (sensor can be mounted to underside of desktop pointed at the floor).

Let's say sitting height is 26" and standing height is 41". If HC-SR04 says the current desk height is <28", hitting the PRESET button would move it up to 41". If desk is >39", hitting the preset button would move it down to 26". Or I could use buttons with LEDs in them. When PRESET it pressed, the UP and DOWN button LEDs could turn on indicating that it's waiting for a preset direction to take (UP = Stand, DOWN = Sit). Lots of options, should be fun.
 

premelec

Senior Member
If your travel distance is only 15" you might use a common 270Deg potentiometer's rotation with spring loaded cord and cam wheel... For READADC input... I don't know just what your mechanical configuration is. If you use a 3 or 10 turn pot this would be even easier on the configuration. [smaller cord reel].
 

rq3

Senior Member
I have a motorized sit/stand desk and one of the buttons quit working on the control. The control has an RJ11 connector with 4 pins. 2 pins (soldered together in the photo below) show 24VDC when connected to either of the other two pins with my multimeter. When either of the other two pins are shorted to the 24V, the desk moves up or down.

So one of my complaints with this system over the years has been the need to hold the button down to move up the desk up or down. I wish I could have afforded the more expensive model to get the preset positions, but whatever. The easy answer to fix this is buy a new control panel - but where's the fun in that. The other option is to snip the end off the RJ11 cable and add a switch - solves the issue with holding the buttons down while the desk moves but still doesn't give me preset positions. Option three, pimp out my desk by mounting an ultrasonic ranger finder under there, use a PICAXE to program in my own preset height adjustments and some MOSFETs to signal the motion.

I don't know the circuit design for the desk so I'm making an assumption that the 2 pins that are connected to the buttons have pull downs on them. When shorted to 24V, the relays near the motors activate. The relays and such are packed away inside one of the motor assemblies (photo below) so trying to take it apart to see how it works would be a very involved process (for one, I'd have to clean off my desk to unload the tension and that's a feat in of itself haha). I could tap into the 24V cable (red arrow) to supply the PICAXE with power but was just wondering if I could have a more tidy setup by using just the RJ11 cable (yellow arrow) to power my little project too (since one of the pins would always be low/gnd). Just FYI, the blue arrow is pointing to a cable that connects left motor to right motor. Thoughts on this?

View attachment 22427View attachment 22428
I have a motorized table with a stereo microscope and a micromanipulator used for the surface mounting of very small LEDs. I find that even a quarter of an inch of table height makes a huge difference in my comfort and accuracy.

Are you sure that you need to go to a "pre-programmed" height? Personally, it would drive me nuts. A tweak in height every 15 minutes or so takes a great strain off of my back from trying to stay in the same position for too long.Just a thought, and my apologies if not applicable to your situation.
 

inglewoodpete

Senior Member
I believe I'm back to using the ultrasonic range sensor (HC-SR04) again. With the HC-SR04, I can read the desk's current position to the floor (sensor can be mounted to underside of desktop pointed at the floor).
Yes, I favour absolute height measurement too. A few years ago I used ultrasonic range sensors in a project. I had problems with false echoes (my particular circumstance) and had to think "outside the square" for a solution. You, too, could have a similar situation if you have clutter or legs/feet/shoes under the table. I ended up unsoldering the "receive" transducer from the sensor's board and mounting it close to the target (original echo) surface, connecting it via screened microphone lead. This method does not rely on echoes but measures the direct-line delay between sending and receiving the ultrasonic pulses. Also overcomes problems if you have a carpeted floor.
 

Hemi345

Senior Member
@rq3 I do exactly what you do as well. That's why I would keep the UP & DOWN buttons for making small adjustments. The preset heights will eliminate me having to hold the button down for 10-15 seconds while the desk moves down/up to the general sit/stand positions.

@inglewoodpete I hadn't thought about the carpet causing issues. I'll have to test that out. The table leg "feet" (parts that are parallel with the floor/table top, about 4" wide) stick out to the front edge of the table, so I could probably position the range sensor to watch that... judging by the amount of dust on mine, I think they'll be a good clear surface.
 

Hemi345

Senior Member
Here's a schematic I have so far. I'm going to use internal pullups for the buttons (active on low). J1 thru J6 will be 2.54mm headers or mini screw terminals. J3 will allow me to decide on connecting optical encoder, hall effect, ultrasonic range finder, etc.

1541783808741.png

I'll breadboard the 14M2 with an N-ch and P-ch mosfet and a button to verify this works. Buttons I picked out for this have LEDs built in.

Anyone have a suggestion on a single IC solution for handling what are essentially two high side switches? Surface mount isn't a problem until it gets smaller than 0.65mm pitch. Was just going to use some SOT-23-3 mosfets to keep the PCB cheaper but looking for something new and exciting to use, if possible.
 

Hemi345

Senior Member
This little device looks neat: DMC25D0UVT It looks nearly the same as TI's TPS27082L I've used in a few projects, just the pinout is different and it can handle 24V
 
Last edited:

Hemi345

Senior Member
So I guessed wrong how this works. Let out the magic smoke from one of those DMC25D0UVT ICs and toasted a 5V LDO. Hopefully the 14M2 is okay. Without a schematic or taking one of the motors apart to see what makes it tick it was a gamble. At any rate, I'm over it and out a few hours of my time and ~$10. Tired of lowering my desk using a screw driver to short those pins... time to order a replacement button.
 

Hemi345

Senior Member
Alight, I couldn't admit defeat. :LOL:

Here's the original PCB I made with the two little DMC25D0UVT load switches (IC1 & IC2):
2a1242131612185b501619b9b26a9e5e.png
Tucked into a little custom enclosure with some LED buttons and the ultrasonic range finder:
enclosure.jpg
Turns out, the RJ11 cable I used was a crossover type and I didn't bother to check the pinout on the other end, so I had created a short of sorts and that's what fried one of the load switches, the voltage regulator, and the 14M2. I measured again the current required to make the connection on the old desk control and it was less than 1mA, so well within the current capability of these load switches. I ordered another three pack of 14M2s from Eric Anderson and after fixing the wiring and replacing the toasted components, I verified with a separate power source that the load switches were able to light up an LED... everything is functioning again how I designed it. Plugged it to the desk and this time no smoke, but the desk didn't move when I pressed the buttons. I never breadboarded the n-channel, p-channel setup, so I guess that's what I should expect for not fully understanding how this desk works.

For giggles, I had a spare SSR from my Humidistat project and bread-boarded that. Whaddya know I could successfully run the desk up (and after rewiring it, move it down). Okay, so I need two SSRs and I should be golden. I found and ordered a DIP8 version, AQW282EH (probably overkill), that has two SSRs in it and made a small generic breakout board for it:
a3930b01b55984439aac3ad47bb2d98e.png
I removed the two DMC25 load switches from the main PCB, shorted the DMC25's enable pins (pins 5) over to the Up and Down out pins (pins 2/3) so I could use the "Up,24V,Down" header, then ran a short cable over to the new SSR PCB:
20190318_171212.jpg
Success! It works great to auto position my desk to my programmed sit and stand positions and allows me to manually move it for fine adjustments. I fastened the enclosure lid to the bottom of my desk using double-sided tape which allows me access to the insides as shown in the pic above, if ever needed.
20190318_170952.jpg
All in, about $20 for the components and PCBs. :cool: I'll post my code and schematic of the little SSR board in the next post (limited to 5 attachments in this one).
 
Last edited:

Hemi345

Senior Member
Schematic for the main PCB:
1553098608287.png

Schematic of the SSR below. Since I was getting 3 copies of the PCB, I used a footprint I made for two DIP4 just in case I found the need to use these in the future for switching a single device. Also put an isolation slot on the PCB just in case for additional safety when working with mains voltages:
1553097420601.png

And attached is the program.
 

Attachments

Last edited:
Top