Skip to main content

In this tutorial ,We will learn to build a simple crossplatform GUI based serial port communication with Arduino Microcontroller using Python and tkinter (ttkbootstrap).To make the interface look nice we will use the theme extension for tkinter called ttkbootstrap which provides modern flat style themes.

The tutorial is aimed at beginners who wants to build Python and tkinter based widgets to control and communicate with serial port based devices like Arduino, Raspberry PI, Data Acquisition systems like Labjack etc. 

All code is available under MIT opensource license that can be used for both commercial and opensource projects.

Here we will use pySerial Library to communicate with the serial port and use the tkinter(ttkbootstrap) library to build a cross platform GUI for ease of use.

If you are new to Python Serial Port Programming Check the detailed tutorial below.

If you are new to tkinter (ttkbootstrap) GUI framework for Python 3.x.x,Do check our tutorial below.

 

Source Codes

build your own Python and tkinter gui(Graphical user interface) program to communicate with PC and Arduino using Serial Port

 

  • Download Python tkinter(ttkbootstrap) Serial Communication Program as Zip File

  • Browse Python tkinter Serial Communication code in Github

Please use the full code from the Github Repo. Codes shown in the Website may be partial, intended to illustrate specific sections or methods used.

Make sure that you have Python Interpreter and ttkbootstrap libraries installed before running the code.

 

Identifying the COM port number on Windows 

First connect your  Arduino ,USB to Serial Converter ,USB GPIO system with Relays to your Windows 10 orWindows 11 USB port.

Open up your Device Manager.(type it in the search bar of the Windows10,11 system)

Look under Ports,

identify serial ports for communicating with arduino using tkinter and python pyserial module

Please use that particular number ( here COM3 ) to open a connection to serial port using tkinter and Python.The COM port number may be different in your system.

 

Installing tkinter (ttkbooststrap) on Windows 10

 

To 

Software Architecture of tkinter (ttkbootstrap) Serial Port Program