https://github.com/abduznik/micropython_uart
Simple code for UART included a pyserial interface with support for windows,Linux,android
https://github.com/abduznik/micropython_uart
library micropython template uart
Last synced: about 1 month ago
JSON representation
Simple code for UART included a pyserial interface with support for windows,Linux,android
- Host: GitHub
- URL: https://github.com/abduznik/micropython_uart
- Owner: abduznik
- License: mit
- Created: 2025-01-23T08:38:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-23T08:52:26.000Z (over 1 year ago)
- Last Synced: 2025-01-23T09:32:15.831Z (over 1 year ago)
- Topics: library, micropython, template, uart
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Micropython UART Controller



A simple, cross-platform tool to communicate with MicroPython-based microcontrollers (like **Raspberry Pi Pico**, **ESP32**, etc.) via UART. Control hardware directly from your PC or Android phone!
---
## Features
- Cross-Platform:** Works on **Windows**, **Linux**, and **Android** (via Pydroid 3).
- **Auto-Detection:** Automatically detects your OS and available serial ports.
- **GUI Control:** User-friendly interface to switch ports and send commands.
- **Instant Feedback:** Turn specific pins/LEDs ON or OFF with a click.
---
## Project Structure
| File | Description |
| :--- | :--- |
| **`serialcomm.py`** | **The GUI App.** Run this file to start the controller. Connects to the device and sends commands. |
| **`s_searcher.py`** | **The Backend.** Handles OS detection, list available ports, and manages serial connections. |
| **`UART_MICRO.py`** | **Firmware.** The code that goes onto your Microcontroller (Pico/ESP32). |
---
## Installation & Setup
### PC (Windows / Linux)
Ensure you have Python installed. Then, install the required library:
```bash
pip install pyserial
```
### Android (via Pydroid 3)
1. Install **Pydroid 3** from the Google Play Store.
2. Open Pydroid 3 -> **Pip**.
3. Install `usb4a` and `usbserial4a`.
*(Note: Android support requires an OTG adapter)*.
### Microcontroller Setup
1. Open your MicroPython IDE (like **Thonny**).
2. Open `UART_MICRO.py`.
3. **Save/Flash** it to your microcontroller as `main.py` (or run it manually).
> **Important:** Check your specific board's Pinout! The code uses `UART(0)` and `Pin(25)` (default LED for Pico). Adjust if using ESP32 or others.
---
## How to Use
1. **Connect** your microcontroller to your computer/phone via USB.
2. **Run** the application:
```bash
python serialcomm.py
```
3. **Select Port:**
- Use the dropdown to select your device (e.g., `COM3`, `/dev/ttyUSB0`).
- Or keep it on **`Auto`** to let the app find it.
4. **Control:**
- Click **`Turn ON`** 🟢 -> Sends `11111111` (LED ON)
- Click **`Turn OFF`** 🔴 -> Sends `00000000` (LED OFF)
---
## Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit Pull Requests