PyQt2Arduino is mainly a terminal for serial comunication with Arduino, but it has a set of custom tabs for different functions, like displaying a text send from graphical user interface to an 16x2 lcd connected to Arduino, or displaying the temperature or ligh intensity recived from external sesnors. The application is writen in python and PyQt5 (gui part and also for serial communication it use QSerialPort) and can be easly modified for adapting it to a large variety of sensors, extra tab can be add in GUI and other functions can be create.
- Built With:
- Prerequisites
- Setup/Installation:
- Usage
- Contributing
- License
- Contact
I'll asume you already have installed python 3.x, now install PyQt5 packages:
- via pip
pip3 install PyQt5- via apt-get (Ubuntu)
sudo apt-get install qtcreator pyqt5-dev-tools- Clone the repo:
git clone https://github.com/Vesa95/PyQt2Arduino.git- Upload to Arduino any example you want from Arduino2PyQt folder, but for the first steps with this application I highly recommand to upload "Send_Recive.ini" example first. With this code you send data (text) from PyQt2Arduino graphical user interface to Arduino, and Arduino will print on console (monitor) what it recived.
- After you uploaded any example on Arduino, run PyQt2Arduino.py:
python3 PyQt2Arduino.pyIn this part, I'll show you how to work with this application and with every example from Arduino2PyQt folder.
- Send_Recive;
- Display_Text;
- Recive_Light_Intensity;
- Recive_Temperature;
- Sonar;
- All_In_One;
The GUI consists of 5 tabs: 2 main tabs and 4 custom tabs. Every tab consists of other widgets.
- Connect tab:
- From here you can select all the settings for serial communication, such as PORT, BAUDRATE, DATABITS, PARTIY, and STOPBITS.
- The default setting are: Baudrate: 9600, Databits: 8, StopBits: 1, Parity: NoParity, and only port need to be selected.
- Console tab:
- This is the "Serial Monitor", from here you can send data to Arduino via "Send widget" and display in "Read widget" what Arduino send back to you.
- Also, any data sended or recived will be saved in logfile.
For almost every Arduino2PyQt example you need a specific library, I have already downloaded the libraries and put them in folders of the examples, or you cand download them from original source:
- Upload Send_Recive.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Go in Console tab and in "Send widget" write any text you want to send to Arduino, click Send button, and Arduino will send back to PyQt2Arduino, who will print it on "Read widget".
- Arduino UNO
- LCM 1602 IIC
- LCD 16x2
- Install the library
- Upload Display_Text.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Go to Display tab
- Click on Connect button
- Type whatever you want to be displayed on 16x2 lcd and click Send
- Arduino UNO
- TSL2561
- Install the library
- Upload Recive_Light_Intensity.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Go to Light S. tab
- Click on Start Reading button
- Arduino UNO
- DTH11
- Install the library
- Upload Recive_Temperature.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Go to Temperature. tab
- Click on Start Reading button
- Arduino UNO
- HC-SR04
- Install the library
- Upload Sonar.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Go to Ultrasonic S. tab
- Click on Start Reading button
- Arduino UNO
- LCM 1602 IIC
- LCD 16x2
- TSL2561
- DTH11
- HC-SR04
- Install all the libraries
- Upload All_In_One.ini
- Open PyQt2Arduino and check "Use Default Settings"
- Enjoy!
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature) - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Vesa Bogdan - vesabogdan95@gmail.com
Project Link: https://github.com/vesa95/PyQt2Arduino











