Skip to the content
2 layers101 × 78.7 mmChairAdjust relayBoard, the printed circuit board in 3D

ChairAdjust relayBoard

Jonny999999/armchair_fw

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

2

README

README.md

Overview

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 machine
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

bash
#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.sh

Clone Repository

text
git clone git@github.com:Jonny999999/armchair_fw

Install Node Packages

Navigate to the react-app directory and install required packages using npm:

text
cd react-app
npm install


Building 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:

bash
cd react-app
#compile
npm run build
#remove unwanted license file (filename too long for spiffs)
rm build/static/js/main.8f9aec76.js.LICENSE.txt

Note: For testing the app locally, use npm start

Firmware

Environment Setup

bash
source /opt/esp-idf/export.sh

Run once per terminal

Compilation

bash
cd board_single
idf.py build

Upload

  • 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:
bash
idf.py flash

Monitor

To view log output for debugging, follow the same steps as in the Upload section, but run:

bash
idf.py monitor


Usage / 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 EventAction
rotate leftMove leg rest up by 10%
rotate rightMove leg rest DOWN by 10%
press + rotate leftMove back rest down by 5%
press + rotate leftMove 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:
CountTypeActionDescription
1x longswitch modeMENU_MODE_SELECTOpen menu for selecting the current control mode
1xcontrol[MASSAGE] freeze inputWhen in massage mode: lock or unlock joystick input at current position.
1x short, 1x longswitch modeADJUST-CHAIRSwitch to mode where the armchair leg and backrest are controlled via joystick.
2xtoggle modeIDLE <=> previousEnable/disable chair armchair (e.g., enable after startup or switch to previous mode after timeout).
3xswitch modeJOYSTICKSwitch to JOYSTICK mode, to control armchair using joystick (default).
4xswitch modeHTTPSwitch to remote control via web-app http://191.168.4.1 in wifi armchair.
5xswitch modeMENU_SETTINGSOpen menu to set various options, controlled via display and rotary encoder.
6xswitch modeMASSAGESwitch to MASSAGE mode where armchair shakes differently, depending on joystick position.
7x
8xtoggle optiondeceleration limitDisable/enable deceleration limit (default on) => more responsive.
12xtoggle optionalt stick mappingToggle 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 EventCurrent MenuAction
long pressmain-menuExit MENU mode to previous control mode (e.g., JOYSTICK).
long pressvalue-selectExit to main-menu without changing the value.
clickmain-menuSelect currently highlighted menu item -> enter value-select screen.
clickvalue-selectConfirm value / run action.
rotatemain-menuScroll through menu items.
rotatevalue-selectChange 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
QtyValueFootprintReferences
8DDiode_THT_AKL_Double:D_DO-27_P20.32mm_HorizontalD4, D5, D6, D7, D10, D11, D12, D13
422kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3, R5, R6, R7
42k2Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R4, R8, R9
4BC557APackage_TO_SOT_THT_AKL:TO-92_Inline_Wide_CBEQ1, Q2, Q3, Q4
4DDiode_THT_AKL:D_5W_P12.70mm_HorizontalD1, D3, D8, D9
4MountingHoleMountingHole:MountingHole_5.3mm_M5H1, H2, H3, H4
4RT314A24Relay_THT:Relay_SPDT_Schrack-RT1-16A-FormC_RM5mmK1, K2, K3, K4
112V, GNDTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ6
112vConnector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP6
124V PowerTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ4
124vConnector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP3
1Control-SignalsTerminalBlock_4Ucon:TerminalBlock_4Ucon_1x04_P3.50mm_HorizontalJ2
1Control-SignalsConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1GND PowerTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ5
1GND-powerConnector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP4
1K1.1Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP8
1K1.2Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP7
1K2.1Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP9
1K2.2Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP10
1M1.1 (+)Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP1
1M1.2 (-)Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP2
1M2.2 (+)Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP11
1M2.2 (-)Connector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP12
1Motor_1 + -TerminalBlock:TerminalBlock_bornier-2_P5.08mmJ1
1Motor_2 + -TerminalBlock:TerminalBlock_bornier-2_P5.08mmJ7
1gndConnector_PinHeader_1.00mm:PinHeader_1x01_P1.00mm_VerticalTP5

Similar boards

  • 4 layers123 × 56 mmSkyduino Hardware, the printed circuit board in 3D

    Skyduino Hardware

    Skyduino/Skyduino-Hardware

    Hardware design files for the Skyduino roaster

    80 parts4
  • 2 layers73 × 112 mmDymBOX AVR, the printed circuit board in 3D

    DymBOX AVR

    2pkstartup/DymBOX

    Regulátor teploty pro udírnu postavený na mikrokontroléru ATmega8.

    50 parts1
  • 2 layers70.2 × 144.1 mmDymBOX AVR, the printed circuit board in 3D

    DymBOX AVR

    2pkstartup/dymbox_pcb

    49 parts
  • 2 layersEsp, the printed circuit board in 3D

    Esp

    DaLumberjack/Communifarm-PCB

    homeassistant-pcb

    95 parts
  • 4 layersGerber, the printed circuit board in 3D

    Gerber

    teaching-FEEC/ea075-2023.2

    17 parts
  • 2 layers216.9 × 86.8 mmSweepv2, the printed circuit board in 3D

    Sweepv2

    davidphilipbarr/Sweep

    Sweep - a small promicro based keyboard inspired by the Ferris.

    51 parts2.1k
  • 2 layers49.4 × 94.2 mmPin board 1, the printed circuit board in 3D

    Pin board 1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    51 parts1.2k
  • 2 layers72 × 42 mmNRF24 jammer, the printed circuit board in 3D

    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.