I found on eBay one of those rotary encoders used in commercial CNC pendants (search for 'cnc hand wheel' or 'ZSS600-001-100B-5L') and came to the idea to create my own one.
I am using bCNC to control my mini CNC. In bCNC you use the arrow and page-up/page-down keys to control the three axis. Take this and the fact that you can program an Arduino Pro Micro to act as an keyboard and the electronic side of this project is basically done.
What was left to do was to design a case. I was constrained by the size of the rotary switch and the USB breakout board otherwise it might have gotten a bit smaller.
See it in action: https://youtu.be/PTTVuVUZYM8
I have included the OpenSCAD file which is somewhat parametric.
- Rotary encoder
- Search for 'cnc hand wheel' or 'ZSS600-001-100B-5L'
- If it has the terminals A, B, A̅, B̅, Vcc and 0V and is specified to work with 5V, it should be fine
- Rotary switch with 3 positions (see picture, others might also fit)
- USB Type-B break-out board
- Micro-USB cable
- 6 socket head screws M3x12
||Terminal Vcc of rotary encoder
||Terminal 0V of rotary encoder
||Terminal A of rotary encoder
||Terminal B of rotary encoder
||Common Pin of rotary switch
||Pin of rotary switch for X
||Pin of rotary switch for Y
||Pin of rotary switch for Z
(The internal pull-up resistors of the Arduino are used)
- Glue the top plate to upper part
- Cut a micro USB cable and solder it to the USB break-out board
- Glue the break-out board and the cable with hot glue to the lower part
- Solder the cables to the Arduino Pro Micro
- Plug the Arduino Pro Micro into the USB cable
- Screw the lower and upper part together (the screws should thread themselves), take care to not pinch any cable
- Upload the sketch to the Arduino Pro Micro
If your computer does not recognize the Arduino when connected via the break-out board switch the cables for D+ and D-.