Skip to content

Lars-Klinkenberg/smart-desk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart-Desk

This is a personal project to control my standing desk using a Raspberry Pi 4. The setup is specifically tailored to my hardware and requirements and is not intended for general customization. However, feel free to use it if you find it helpful.

Hardware

Hardware Information

  • Motor controller ID: WP-CB01
  • Control panel circuit board ID: DCU_G-PRT5G

Steps to Get This Project Working

I installed the Raspberry Pi between the motor controller and the control panel.
Therefore, I cut the cable connecting the control panel to the controller and soldered an Ethernet connector to both ends.
The phases of my Ethernet cable are mapped as follows to the desk's cables:

Ethernet Desk Function
Orange Red Key1
Orange-White Yellow +35V
Green Green +5V
Green-White White RX
Brown Brown Ground
Brown-White Black TX
Blue Purple Ground
Blue-White - -

Circuit Diagram

In case the Raspberry Pi and the control panel both send signals at the same time, I built in a relay that controls which one can write.
The desk is connected to NC, so even if the Pi is offline, the desk works as usual.

PCB

To make it more secure for the long term, I soldered everything to a PCB with a line grid.

Image of the PCB

I mapped the cables from top to bottom as following to the pcb:

  • Key1
  • +35V
  • +5V
  • GND
  • RX
  • TX
  • GND

Software

  • Serial ports on the Raspberry Pi must be enabled.

Used Libraries

sudo apt-get install python3-dev sudo apt-get install -y libmariadb-dev pip3 install mariadb sudo apt install mariadb-server

pip install pyserial
pip install flask
pip install flask-classful
pip install rpi.gpio
pip install python-dotenv
pip install mariadb

Running the Project

Installation

Creating linux user

sudo useradd -s /bin/bash -m -c "desk" -Gsambashare desk

set user pw

sudo passwd desk

add user to sudo group

sudo usermod -aG sudo <username>

to install all project specific ressources

bash install.sh

Configure DB

start the mariadb cli with sudo mysql -u root -q and execute source path/documentation/database.sql to load the db configuration

Starting

to start the project simply run python main.py

Start on powerup

If you want the project to start run crontab -e

and add:

@reboot bash path-to-project/smart-desk/desk-controller/start_script.sh

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published