An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Micropython UART Controller

![Python](https://img.shields.io/badge/Python-3.x-blue?style=for-the-badge&logo=python)
![MicroPython](https://img.shields.io/badge/MicroPython-Enabled-green?style=for-the-badge&logo=micropython)
![Platform](https://img.shields.io/badge/Platform-Windows%20|%20Linux%20|%20Android-lightgrey?style=for-the-badge)

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