Bluetooth CNC Remote Control
While this instructable gives an overview over the steps on how I built the remote, it is also a summary of all the mistakes I made along the design process, how I overcame them and how the project could be improved.
My CNC router is a couple meters away from the PC controlling it, so I was looking for a solution to remotely control it. I could have just bought a finished CNC controller or use a bluetooth numpad to control the CNC, but I decided to build one myself with all the buttons and features I need.
Supplies
The brain of the remote control is a ESP32 microcontroller on a custom designed circuit board.
For the housing of the remote, I decided to make use of both my 3D printer as well as the CNC itself. The more complex part with the battery holder, mount for the charging board and cutouts for USB charging and the on/off switch is 3D printed. The front part is CNC machined out of a 10mm piece of wood I had lying around.
I Included all the 3D models (3D printed back, CNC machined wooden front, PCB, Buttons etc) as a step file. This way it is up to you, wether you want to directly convert them into STL-files for 3D printing etc. or modify the parts to your liking.
The parts I used:
- Custom Bluetooth Remote PCB
- ESP32 NodeMCU (make sure to get the right version of the ESP32! There are other versions out there which have a different pinout and fewer pins. You need the version with 38 pins which usually comes with yellow header pins)
- 4x 5mm red LEDs
- 21x 12x12mm buttons with square pins (so the button caps stay alligned)
- various resistors according to the schematic
- 3.3V LDO voltage regulator which can handle 500mA. (Vin at Pin1, GND at Pin2, Vout at Pin3) for example: TC1264-3.3VAB
- 10uF capacitor with a 2.54mm pitch
- 14500 battery (while this is an unusual size, I did not want to make the enclosure any thicker to fit a 18650 battery)
- TP4056 Li-Ion charger board with Micro-USB
- slim rocker switch (for the exact dimensions check the 3D model)
- 3D printed and CNC machined parts for the enclosure of the remote
Since instructables does not support the upload of step-files or even zip-files, I uploaded all the files here for now:
https://www.file-upload.net/download-14966994/CNCRemoteallfiles.zip.html
If you know a better solution or if there is a workaround to upload these files here, please let me know.
PCB Design
This was one of the first PCBs I ever designed and I made lots of mistakes in the design process. The attached schematic slightly varies from the PCB you will see throughout this instructable. I fixed some mistakes I made in the original design (see step 3)
The remote has a total of 21 individually programmable buttons. A red LED indicates if the remote is turned on and if there is a bluetooth connection, while the other three LEDs show different speed modes for jogging the machine.
Designing the Housing
Once the PCB Layout was finished, I started 3D modeling the housing for the remote control.
To build the housing, I decided to make use of both my 3D printer as well as the CNC itself. The more complex part with battery holder, mount for the charging board and cutouts for USB charging and the on/off switch is FDM 3D printed. The front part is CNC machined out of a 10mm piece of wood I had lying around.
Assembling the PCB
As mentioned previously, I made many mistakes with the PCB design.
I soon realised that I forgot to connect all 4 LEDs to ground and some of the buttons required additional external pull-up resistors to work properly. Also one of the switches had to be wired up to another pin. While this looks really messy, everything seemed to be working.
Another problem was the use of THT components instead of SMD compontents. While this helps with the proper alignment of the buttons, this also meant that there would be pins sticking out on both sides of the PCB. Some masking tape to protect the PCB and a file solved this issue.
Placing the voltage regulator next to the antenna of the ESP also was an issue and I am certain the bluetooth connection would be better with an improved layout. Speaking of the voltage regulator, I should have used a low dropout voltage regulator, since the regulator I use struggles to create stable 3.3V for the ESP once the battery drops below 3.8V.
Nevertheless I got the hardware working and could continue assembling the remote control.
___________
I made some changes to the PCB design and fixed all the problems I am aware of. I added missing Pull-Up resistors, connected all LEDs to ground, connected one of the buttons to another pin and switched to a LDO voltage regulator, which should work better with the output voltage of the battery. I also relocated the voltage regulator and capacitor, so they should not interfere with / block the antenna of the ESP32 anymore. I have not actually tested this version of the boards. So use at your own risk! But I think all the problems should be fixed and hopefully there are no new problems that I am unaware of.
Machined Front Piece
I tried to keep the front piece of the remote control as simple as possible so It could be machined from a single side. Only some cutouts for the buttons, LEDs and marking where I would screw into the front.
Since I wanted to add small icons onto all the small buttons, the buttons covers where printed on a resin 3D printer. To make the icons stand out more, I painted them with nail varnish. Once the nail varnish was dry, I sanded the front so the paint would only remain in the deeper parts of the icon. This process worked surprisingly well.
Summary
At the time of building this remote I had little experience working with microcontrollers and almost no experience with PCB designing, which lead to many mistakes but I also learnt a lot along the process.
I have been using the remote control for almost two years now and am considering to built a new version of this remote with some improvements (fixing the mistakes I made, using smaller SMD components, improve the overall PCB Layout etc). If there is interest, let me know and I might create another, more detailed instructable for an improved version.