[project] Sit/stand desk modernisation - Page 1
Forum section: electronics / projects

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 20, 2018, 10:03:29 pm
content: Hi,disclaimer: tho I consider myself pretty good at coding, by no means I'm at least mid what comes to hardware designs, this project will be learning experience for me, so please hold back your cringeA bit of background:I purchased this old used sit/stand desk few months ago. While I was moving I left it overnight in around 0 C temp, I know, showing my genius right from the start, it died, at least partially - going down, but no up and sizzling.It only had "UP/DOWN" buttons, no memory ect., when I bought it I already had in mind that I will add more features.Features I will add:1. few memory buttons (capacitive touch buttons or touchscreen)2. some sort of display (LCD or segment) with hight output (time of flight sensor), clock and other stuff I will think off.3. wireless control (wifi, BT or RF)4. optionally - communication directly to my workstation via USB (will make sense later...)All UI elements will be hooked via I2C (CJMCU-2317) or/and SPI so I don't have to worry about extra pins for additional UI.Currently I'm working on boring stuff: remaking power supply and motor control circuit, I had to remake them because old board had way too many power lines and was too complicated to add Arduino compatible MCU plus it's broken, remember?Also I wanted motors power supply to be off, only keep MCU alive.The victim, isn't she a beauty, 200x100cm, solid as rock:My loose "concept".... ata ta ta ta shut it, it's over 10 years photoshop skills!(not all components included):High voltage circuit layout in 3D:High voltage circuit on purfboard (read first sentence!I split breadboard and removed unused dots where needed to prevent shorts):Installed (huge attention to details, just look at that captain tape on relays, no more fire or shock hazard at all, told ya, real pro at work):Low voltage board WIP:I'm still working on it, I'm having problems stepping down transformer voltage (50V) to motor voltage (24V), mosfet that should do this keeps dying (no pop or magic smoke!), there is reversed voltage polarity diods. I ordered more beefy mosfets (hope they will pop or smoke), so hope to fix this issue when it's here, for now I'm continue working on legs: actuators limit switches, rotary encoders, time of flight sensor, will post more details about them tomorrow...

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 22, 2018, 04:34:21 pm
content: Hello again,this post will focus on actuators, so lets begin.Actuators has 8 wire cable and they all were used, but I needed extra 2 wires for I2C.I considered 3 options:1. Add I2C IO expander in actuator and connect limit switches and rotary encoder to it. Pros of this approach is 4 free wires out of 8 (which I will not need), "Interrupts" possibility, cons – more work, additional complexity in code, additional hardware (I have many IO expanders, but did not feel this route will be most officiant).2. Just use rotary encoder wires (disconnect rotary encoders), with distance sensor I don't really need them, but they are and they work, so why not use them? (still don't know what I use them in code for...)3. And the winner choice: combine limit switches output to 1 wire and rotary encoder outputs to 1 wire (they never fire at the same time).I know that's not the best way cos limits work via software and if MCU or code fails actuators may be damaged, but it will have to do for now, I will fix this in REV2.0.I still don't know what MCU I will be using, it might be 3,3V, in this case I will need to convert 5V logic signal to 3,3V plus I need to "pack" two signals in one wire, so You guess it – thats perfect job for voltage dividers.According to resistors I had I come up with this concept (from this circuit I'm getting "free" pull down when no signal as well, diodes for rotary encoders):Got approval from MR Bread Board (I don't need exact voltages, I just need them to be "far away" from GND and each other for code to understand them) and made this masterpeace:After I made this and test it I realized that I could add a plug for distance sensor as well, so I made another for another actuator (there will be only 1 distance sensor, and yah, you better don't look on another side......):A bit more about rotary encoders, it's 2 "hall effect" sensors, there is a magnet on shaft. Originally they ran on 12V, but I tested them on 5V and they work, so 5V it is. When motor rotates after modification they will send ~1,5V and ~3V pulses:Actuator plug wires before and after:"Time of flight" (GY-530) distance sensor:Actuators looks like this (this one is finished, with distance sensor professionaly taped to it, proper mounting bracket in the future):Well, if You still reading this here's a totally irrelevant image I took yesterday on a frozen lake while joggingTill next post