

ChairAdjust relayBoard
Firmware for a homemade automated electric armchair using an esp32 controller on a custom pcb
- Size
- 101 × 78.7 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 51
- Nets
- 20
- Pads
- 118
- Tracks, vias
- 149, 6
- Pours
- 2
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 4 Jun 2022
- Updated
- 23 Aug 2026
Overview
ChairAdjust relayBoard is an open-source printed circuit board by Jonny999999, from the Jonny999999/armchair_fw repository on GitHub. It is a 2-layer board of 101 × 78.7 mm with 51 parts on 20 nets, routed with 149 tracks and 6 vias.
It is built around the BC557A and RT314A24. Its parts include 12 diodes, 8 resistors, 7 connectors, 4 transistors and 4 switches.
Main components
2BC557A
General-purpose PNP bipolar junction transistor in TO-92 package with 2.54mm pitch, manufactured by several semiconductor companies.Diotec SemiconductorUncategorisedRT314A24
插件-40℃~+85℃ 1.44kΩ 10ms 10ms 16A 16A@250VAC 24V 400V@AC 400mW AgNi One set of changeover: 1C (SPST-changeover) Polarized-Single Coil Plugin Power Relays ROHSTE ConnectivityPower Relays
README
README.mdOverview
This repository contains the firmware for a custom-built automated electric armchair.
Detailed project information and documentation is available on the website:
Note: In the current version V2.2, only the esp-project in the board_single/ folder and the custom libraries in common/ are used.
The projects in the folders board_control/ and board_motorctl/ are no longer compatible and are legacy from V2.1.

Photo of the built frame that carries the armchair
Current Features
- Control Modes:
- Joystick: Control movement via hardware joystick mounted on the right armrest
- HTTP: Control movement via virtual joystick on a web interface
- Massage: Armchair shaking depending on stick position
- Adjust: Control leg and backrest position via joystick
- Auto: Execute stored driving commands sequentially
- Advanced Motor Control:
- Deceleration limit
- Acceleration limit
- Current limit
- Braking
- Compatible with different motor drivers:
- 3 pins: A, B, PWM - e.g. various common H-Bridges
- 1 pin: UART/RS232 - e.g. Sabertooth
- Input/Sensors:
- Speed Measurement: Measures speed and direction of each tire individually using custom built encoders
- Current Measurement: Monitors current of each motor
- Battery Voltage: Measures battery voltage and calculates percentage according to discharge curve
- Analog Joystick:
- Evaluate two analog signals to get coordinates, radius and angle
- Calibration wizard/sequence
- Calibration stored persistently in nvs
- Fan Control: Cooling fan for motor driver are activated when needed only
- Buzzer: Provides acoustic feedback when switching modes or interacting with menu
- OLED-Display + Rotary-encoder:
- Various status screens showing battery status, speed, RPM, motor current, mode, power, duty cycle, stick data
- Menu for setting various options using encoder
- Changed settings are stored persistently in NVS flash
- Menu for selecting the control mode
- UART Communication between 2 Boards (V2.1)
- Electric Chair Adjustment: Control 4 Relays powering motors that adjust the chair rest positions
- Wi-Fi:
- Hosts wireless network
- Web server with webroot in SPIFFS
- HTTP API for controlling the chair (remote control)
- React web-app: Virtual joystick sending data to http-API (placed in SPIFFS)
Planned Features
Hardware
- More Sensors:
- Accelerometer
- Lidar sensor / collision detection
- GPS receiver
- Temperature sensors
- Lights
- Camera
Algorithms
- Anti-Slip Regulation
- Self-Driving Algorithm
UI
- Improved Web Interface
- Settings
- Chair adjustment
- Simple App
Hardware Setup / Electrical
Control-PCB
The firmware is designed for an ESP32 microcontroller integrated into a custom PCB developed here: Project Work 2020
Connection Plan
A detailed diagram illustrating all components and wiring can be found in the file connection-plan.drawio.pdf.
For more details refer to the documentation on the website.
Chair-Adjust Relay-Board
A custom pcb with relays and protection for controlling the 2 motors that adjust the rest positions of the armchair was created in this repository as well:
Date: 2024.09.08
Folder: hardware/chairAdjust-relayBoard
Schematic: hardware/chairAdjust-relayBoard/export/schematic.pdf
Installation
Install ESP-IDF
For this project ESP-IDF v4.4.4 is required
#download esp-idf
yay -S esp-idf #alternatively clone the esp-idf repository from github
#run installation script in installed folder
/opt/esp-idf/install.shClone Repository
git clone git@github.com:Jonny999999/armchair_fwInstall Node Packages
Navigate to the react-app directory and install required packages using npm:
cd react-app
npm installBuilding the Project
React-webapp
When flashing to the ESP32, the files in the react-app/build/ folder are written to a SPIFFS partition.
These files are then served via HTTP in the Wi-Fi network "armchair" created by the ESP32.
Initially, or when changing the React code, you need to manually build the React app:
cd react-app
#compile
npm run build
#remove unwanted license file (filename too long for spiffs)
rm build/static/js/main.8f9aec76.js.LICENSE.txtNote: For testing the app locally, use npm start
Firmware
Environment Setup
source /opt/esp-idf/export.shRun once per terminal
Compilation
cd board_single
idf.py buildUpload
- Connect FTDI programmer to board (GND to GND, TX to RX, RX to TX)
- Press RESET and BOOT button
- Release RESET button (keep pressing boot)
- Release boot button
- Run flash command:
idf.py flashMonitor
To view log output for debugging, follow the same steps as in the Upload section, but run:
idf.py monitorUsage / User Interface
Quickstart
- Browse / select any mode
[long press]opens menu for selecting the desired mode (JOYSTICK for driving)
- Driving
[3x click]enters JOYSTICK mode
- Rest position
[rotate]adjusts the leg rest position[press + rotate]at the same time: adjusts the back rest position- alternatively enter ADJUST mode and control rests via joystick
Encoder Functions
- When not in MENU mode, rotating the encoder has the following functions:
| Encoder Event | Action |
|---|---|
| rotate left | Move leg rest up by 10% |
| rotate right | Move leg rest DOWN by 10% |
| press + rotate left | Move back rest down by 5% |
| press + rotate left | Move back rest up by 5% |
Note: first tick is ignored -> quickly rotate 2 ticks at first
- When not in MENU mode, clicking the encoder has the following functions:
| Count | Type | Action | Description |
|---|---|---|---|
| 1x long | switch mode | MENU_MODE_SELECT | Open menu for selecting the current control mode |
| 1x | control | [MASSAGE] freeze input | When in massage mode: lock or unlock joystick input at current position. |
| 1x short, 1x long | switch mode | ADJUST-CHAIR | Switch to mode where the armchair leg and backrest are controlled via joystick. |
| 2x | toggle mode | IDLE <=> previous | Enable/disable chair armchair (e.g., enable after startup or switch to previous mode after timeout). |
| 3x | switch mode | JOYSTICK | Switch to JOYSTICK mode, to control armchair using joystick (default). |
| 4x | switch mode | HTTP | Switch to remote control via web-app http://191.168.4.1 in wifi armchair. |
| 5x | switch mode | MENU_SETTINGS | Open menu to set various options, controlled via display and rotary encoder. |
| 6x | switch mode | MASSAGE | Switch to MASSAGE mode where armchair shakes differently, depending on joystick position. |
| 7x | |||
| 8x | toggle option | deceleration limit | Disable/enable deceleration limit (default on) => more responsive. |
| 12x | toggle option | alt stick mapping | Toggle between default and alternative stick mapping (reverse direction swapped). |
- When in MENU_SETTINGS mode (5x click), the encoder controls the settings menu: (similar in MENU_MODE_SELECT)
| Encoder Event | Current Menu | Action |
|---|---|---|
| long press | main-menu | Exit MENU mode to previous control mode (e.g., JOYSTICK). |
| long press | value-select | Exit to main-menu without changing the value. |
| click | main-menu | Select currently highlighted menu item -> enter value-select screen. |
| click | value-select | Confirm value / run action. |
| rotate | main-menu | Scroll through menu items. |
| rotate | value-select | Change value. |
HTTP Mode
Control the armchair via a virtual joystick on the web interface.
Usage:
- Switch to HTTP mode (4 button presses or via mode-select menu).
- Connect to WiFi
armchair, no password. - Access http://192.168.4.1 (note: http NOT https, some browsers automatically add https!).
Parts
51| Qty | Value | Footprint | References |
|---|---|---|---|
| 8 | D | Diode_THT_AKL_Double:D_DO-27_P20.32mm_Horizontal | D4, D5, D6, D7, D10, D11, D12, D13 |
| 4 | 22k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3, R5, R6, R7 |
| 4 | 2k2 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R2, R4, R8, R9 |
| 4 | BC557A | Package_TO_SOT_THT_AKL:TO-92_Inline_Wide_CBE | Q1, Q2, Q3, Q4 |
| 4 | D | Diode_THT_AKL:D_5W_P12.70mm_Horizontal | D1, D3, D8, D9 |
| 4 | MountingHole | MountingHole:MountingHole_5.3mm_M5 | H1, H2, H3, H4 |
| 4 | RT314A24 | Relay_THT:Relay_SPDT_Schrack-RT1-16A-FormC_RM5mm | K1, K2, K3, K4 |
| 1 | 12V, GND | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J6 |
| 1 | 12v | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP6 |
| 1 | 24V Power | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J4 |
| 1 | 24v | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP3 |
| 1 | Control-Signals | TerminalBlock_4Ucon:TerminalBlock_4Ucon_1x04_P3.50mm_Horizontal | J2 |
| 1 | Control-Signals | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J3 |
| 1 | GND Power | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J5 |
| 1 | GND-power | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP4 |
| 1 | K1.1 | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP8 |
| 1 | K1.2 | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP7 |
| 1 | K2.1 | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP9 |
| 1 | K2.2 | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP10 |
| 1 | M1.1 (+) | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP1 |
| 1 | M1.2 (-) | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP2 |
| 1 | M2.2 (+) | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP11 |
| 1 | M2.2 (-) | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP12 |
| 1 | Motor_1 + - | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J1 |
| 1 | Motor_2 + - | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J7 |
| 1 | gnd | Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_Vertical | TP5 |
Similar boards
- 4 layers123 × 56 mm

- 2 layers73 × 112 mm

DymBOX AVR
2pkstartup/DymBOX
Regulátor teploty pro udírnu postavený na mikrokontroléru ATmega8.
50 parts1 - 2 layers70.2 × 144.1 mm

- 2 layers

- 4 layers

- 2 layers216.9 × 86.8 mm

Sweepv2
davidphilipbarr/Sweep
Sweep - a small promicro based keyboard inspired by the Ferris.
51 parts2.1k - 2 layers49.4 × 94.2 mm

- 2 layers72 × 42 mm

NRF24 jammer
W0rthlessS0ul/nRF24_jammer
The nRF24 jammer is a powerful tool that requires an ESP32 and configurable numbers of NRF24 modules to assemble.
51 parts1kMIT
Questions
How big is the ChairAdjust relayBoard PCB?
It measures 101 × 78.7 mm and has 2 copper layers, 1.6 mm thick.
What parts does the ChairAdjust relayBoard use?
51 parts, built around the BC557A and RT314A24. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the ChairAdjust relayBoard KiCad files?
From the Jonny999999/armchair_fw repository on GitHub, at the commit this page was made from: the board is hardware/chairAdjust-relayBoard/chairAdjust-relayBoard.kicad_pcb and its schematic hardware/chairAdjust-relayBoard/chairAdjust-relayBoard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the ChairAdjust relayBoard design in my own project?
Its repository states no licence, so its author keeps all rights: ask Jonny999999 before reusing the design.