3D Printed Encoder Knob

by Lan_Makerfabs in Circuits > Software

121 Views, 3 Favorites, 0 Comments

3D Printed Encoder Knob

1(19).jpg

We cleverly combined the AS5600 module, 3D printing technology, Squareline UI design and Arduino programming to create a smart magnetic knob. The AS5600 module accurately senses the angle of rotation to provide high-precision feedback to the knob; 3D printing gives the knob its unique shape and durability. Design your favourite interface on Squareline and interact with MaTouch via Arduino.

Supplies

0、Hardware preparation.png
0、Hardware preparation 2.png

1、Firstly, you need a AS5600 module, a magnet, a Bearing and a 3Dprinted case, and assemble them.

2、The AS5600 uses I2C port for communication with controller, connected it to Matouch 4irch display.

SquareLine Design

1、create.png
2、project name.png
3、add file.png
4、add image.png
5、add background.png
6、add image 2.png
6、add image.png
7、change pivot.png
8、output.png
8、proj setting.png
9、output proj.png
8、proj setting 2.png

1、click on "Create-->Makerfabs", select the 4 inch screen .

2、Modify the desired project name and location information, and then click “CREATE”.

3、Add the image we need to use, click “ADD FILE INTO ASSETS”.

4、click screen, switch to the screen Settings, click "brackground", add the image to the screen.

5、Add a image, change it brackground to set it to a knob.

6、Change its position and rotation point.

7、At this point, our LVGL graphical user interface has been designed. Click "ctrl s" to save, and then output the project code document.


Arduino Design

10、open ui.png
11、add tab.png
图片1.png
11、add tab 3.png
12、copy AS5600cpp.png
12、paste AS5600cpp.png
11、add tab 4.png
12、copy AS5600h.png
12、paste AS5600h.png
13、include library.png
14、enable iic.png
15、copy code.png
15、paste code.png
16、add image change.png

1、Open the output code file into the Arduino design.

2、Add a [driver library] (https://github.com/Makerfabs/LVGL-Usage-with-Squareline-MaTouch-Lesson/blob/main/lesson%203/AS5600_test) for the AS5600.

3、Add the library and define its pins, then enable the IIC pin.

4、Add an Angle conversion function.

5、Serial Monitor to print Angle value and then the Angle of the knob is designed as the original Angle value, because the rotation Angle of the SquareLine image is 10 times the original Angle, so it needs to be multiplied by 10.

Upload Code

17、copy lv_conf.png
17、paste lv_conf.png
18、copy 4 file.png
18、paste 4 file.png
图片2.png
20、upload.png

1、Click on the code project document you just output. Copy the lv_conf.h file into the “src” folder in the LVGL folder in libraries.

2、Copy these four files into the Arduino library.

3、Go back to the Arduino, connect the screen with USB, select the com port and the board of the ESP32S3 and click upload. 


Detailed Operation Video

Detailed Operation Video can find on our Youtube page, we also have a video series on this operation which can be viewed here

Source code can find on our Github:https://github.com/Makerfabs/LVGL-Usage-with-Squareline-MaTouch-Lesson/tree/main/lesson%203