Custom RC Controller PCB With Touchscreen - Arduino/ESP32
by xRoboMaker in Circuits > Arduino
17 Views, 0 Favorites, 0 Comments
Custom RC Controller PCB With Touchscreen - Arduino/ESP32
Project overview
Custom RC transmitter created from scratch using a manufactured double-layer PCB, some 3D printed parts, and acrylic plates. The RC has an ESP32S3 board that manages the touchscreen, and an Arduino Nano board that reads the RC channel values, sends/receives the radio signal and measures battery levels.
This RC was developed as part of the OpenRover project, where I built a 3D printed Mars rover replica robot. Since the rover had many functionalities and status data available, I wanted to create a custom RC with a touchscreen that could be easily expanded with new control and monitoring features without requiring additional hardware (e.g., switches, push buttons, LEDs...).
The remote controller’s software and UI screens can be easily adapted to control and monitor other kinds of robots, making this project a good starting point for building your own RC tailored to your needs. The RC uses a 2.4GHz NRF24L01 transceiver module for communications, which is very versatile.
Project GitHub repository
I’ve created a GitHub repository for the controller: https://github.com/pol-valero/radio-controller-pcb. This repository can be used to complement the Instructables project guide, since it contains all the designs, schematics, documentation, and most up-to-date source code to replicate the RC.
Features
- Able to continuously transmit 8 channels: 2 channels (X, Y axis) for each joystick, 3 AUX channels for the physical toggle switches and the push button, 1 free AUX channel
- Bidirectional communication with the robot: status data and commands can be sent to the robot, or received from the robot
- Three screens available: monitor, control (home), configuration. To change between screens, you can swipe right/left or click on the bottom navigation bar
- Control screen allows 4 main operation modes: conventional driving control, 360º turn control, robotic arm control, head control. Digital toggle switches activate secondary functionalities
- Monitor screen displays current RC channel values, environmental data, and status information. A line graph shows the evolution of environmental data over the last minute
- Touchscreen plugs into the PCB using a JST connector, making it easily detachable. The RC transmitter can work without the touchscreen
- Displays the battery voltage levels of the RC and the robot. Makes a buzzer sound if RC battery level is low. Around 1h 30min of RC battery life
- About 100 meters range outdoors (clear line of sight). A signal bar icon on the screens will start flashing if the connection to the robot is lost
Tech stack
To program Arduino and ESP32 microcontrollers, the PlatformIO IDE with the Arduino Framework was used. To create the embedded UI design of the touchscreen, the SquareLine Studio platform and LVGL library were used.
Supplies
Most important hardware components
- Buzzer (x1)
- ESP32S3_8048S043 IPS touchscreen (x1)
- 5-pin JST-XH male and female connectors (x1)
- Spiral plastic sleeve for wires (as needed)
- JH-D202X joystick (x2)
- Arduino Nano (x1)
- NRF24L01 transceiver module (x1)
- NRF24L01 3.3V regulator (x1)
- Colored wires (as needed)
- SS-12D10 switch (x1)
- Toggle switch 20A (x2)
- Push button (x1)
- 4-channel logic level converter (x1)
- 100 ohm resistors (x1), 1k ohm resistors (x2)
- Double AAA battery holder (x2)
- Rechargeable AAA 1.2V 750mAh NiMH battery (x4)
- Manufactured double-layer PCB (x1)
Most important mechanical components
Bolts
- M3 x 8mm - 6 - preferably with flattened head (ISO-7380)
- M3 x 10mm - 4 - preferably with flattened head (ISO-7380)
- M3 x 12mm - 4
- M3 x 16mm - 1
Other parts
- M3 threaded insert - 20 (approximate)
- M3 washers - 12
- Laser/CNC cut top and bottom acrylic plate
Most of these hardware and mechanical components were purchased on Aliexpress, but a lot of them are also available on Amazon. The estimated cost of all the mechanical and hardware components is around 120€.
Manufacture the Controller's PCB
The RC has been built around a custom double-layer PCB. The PCB design has been created using the EasyEDA app, and the PCB has been manufactured by JLCPCB.
PCB manufacturing
To manufacture the PCB, a Gerber fabrication file has to be generated from the design and then has to be uploaded to the manufacturer's website (e.g., JLCPCB, PCBWAY...). If you want to make any modifications to the EasyEDA PCB design, you will have to regenerate the Gerber by going into the top menu and selecting "Fabrication -> PCB Fabrication File (Gerber) -> Generate Gerber".
Place Hardware Components, Create Wiring Connections, and Solder
Create the wiring connections for the controller's ESP32S3_8048S043 touchscreen module, following this schematic. The touchscreen has a resolution of 800 x 480 px, 4.3" screen size, and has ESP32S3 and I/O connectors built in.
Solder pin headers to the necessary hardware components, so that they can be placed on the PCB and connected to the PCB's pads. Solder the PCB pads of the bottom layer, fixing the components in place. Some images detailing this process are available here.
Cut, 3D Print, and Assemble All the Parts
This Fusion360 design file contains the 3D printable parts: the spacers that hold the acrylic plates and PCB together, the structure that holds the touchscreen, and the case for the ESP32S3-8048 touchscreen.
Other parts of the remote control that have to be manufactured are the top and bottom acrylic plates, which should be cut using a laser or CNC machine. In my case, I used a workshop near my home that had a laser machine, but there are also online websites where you can order laser cut designs in acrylic. These are the 2D designs for the top and bottom acrylic plates. I would recommend using 3mm clear acrylic.
The Fusion360 design file can serve as a guide to perform the assembly.
Upload Code to Development Boards
The remote control is formed by two blocks, the "Arduino Nano" and the "ESP32S3 touchscreen" blocks. To develop the code for these blocks, the PlatformIO IDE was used. This IDE is integrated into the versatile Visual Studio Code editor, and can be installed simply by searching "PlatformIO IDE" in the "Extensions" tab of Visual Studio Code.
Thanks to PlatformIO, all the code, configuration files, and dependencies are in a single package. This makes it very easy to share the complete project, enabling other people to execute it right after they download it.
Each of the two blocks is a standalone PlatformIO project. Therefore, just by opening the Arduino Nano and ESP32S3 projects with PlatformIO, connecting the ESP32S3 or Arduino Nano development board via USB, and clicking the "upload" button, the code will be uploaded to the ESP32S3 or Arduino Nano and will start executing.
Touchscreen Embedded UI Design
To create the embedded UI design of the touchscreen, the SquareLine Studio platform and LVGL library were used. If you want to change the design of the UI, these steps have to be followed:
- Step 1: Open the SquareLine Studio project and make the desired visual changes
- Step 2: Click on Export -> Export UI Files. The UI files export path must be previously specified in the "Project Settings"
- Step 3: Copy all the exported UI Files into the "squareLineFiles" folder of the ESP32S3 PlatformIO project, making sure to overwrite the previous files that were in this folder
- Step 4: Click the "upload" button in PlatformIO to upload the code to the ESP32S3. The modified UI should now appear on the touchscreen.
Three screens have been implemented in the embedded UI: Control, Monitor and Configuration.
Demo