Report
Report
Key Features
Execution Device Python-Based Execution: Users can write and
execute Python scripts directly on the device, making
hardware programming intuitive and accessible.
Execu ve Summary Standalone Operation: The device operates
The Standalone Microcontroller-Based Python Script independently, with no need for an external computer.
Execution Device is an innovative solution designed SD Card Storage: Scripts and libraries are stored on
to simplify embedded systems programming by an SD card, ensuring portability and easy access.
enabling users to write, edit, and execute Python
scripts directly on a microcontroller-based device. Modular Hardware Connectivity: Sensors, motors,
This project bridges the gap between software and and actuators connect via I2C and GPIO expanders,
hardware development by leveraging the simplicity enabling flexible and scalable hardware
of Python and the power of the ESP32 configurations.
microcontroller. The device operates independently,
On-Device Display & Input: A small TFT/OLED
eliminating the need for external computers, and
screen provides a graphical interface for writing
supports modular I2C and GPIO expander based
scripts, while input methods like a touchscreen,
connectivity for sensors, actuators, and other
rotary encoder, or PS/2 keyboard ensure usability.
peripherals. With an intuitive graphical interface, SD
card storage, and standalone functionality, this tool is Lightweight Performance: The system runs on
ideal for education, prototyping, and hobbyist MicroPython, ensuring efficient performance without
projects. By reducing the complexity of traditional the overhead of a full-fledged operating system.
embedded systems development, this project
democratizes access to hardware programming and Use Cases
empowers users to bring their ideas to life with ease.
Problem Statement
This project proposes a standalone microcontroller-
based device that allows users to write, compile, and
execute Python scripts directly on the hardware
without needing an external computer. Embedded
systems usually utilise Mid-Level or Low-Level
languages such as C/C++ or Assembly languages.
Also peripherals such as sensors, motors, and
actuators can be connected via USB, eliminating the
need for complex wiring or soldering.
1
Hardware Architecture Pin Assignments
The hardware architecture of the device is designed I2C Pins:
to balance functionality, usability, and cost- SDA: GPIO 21
effectiveness. It is centred around the ESP32 SCL: GPIO 22
microcontroller, which serves as the brain of the
system. Below is a detailed breakdown of the ADC Pins:
components:
Analog Sensors: GPIO 32-39 (ESP32 ADC)
Components GPIO Expander:
ESP32 Microcontroller: MCP23017 connected via I2C (SDA/SCL).
Acts as the central processing unit. I2C Multiplexer:
Executes Python scripts using MicroPython.
Provides Wi-Fi and Bluetooth connectivity TCA9548A connected via I2C (SDA/SCL).
for IoT applications. PS/2 Keyboard:
TFT/OLED Display:
Clock: GPIO 16
Displays the graphical user interface (GUI). Data: GPIO 17
Used for script editing, file management, and
system monitoring. Sensor & Actuator Connec vity
Input Mechanisms: Analog Sensors
Touchscreen: Allows users to interact with Direct Connection: Use the ESP32's built-in
the GUI directly. ADC pins (GPIO 32-39) for basic analog
Rotary Encoder & Push Buttons: Provides an sensors.
alternative input method for navigation and High-Precision Sensors: Use the ADS1115
selection. I2C ADC module for sensors requiring
PS/2 Keyboard: Supports advanced text entry higher resolution.
for longer scripts.
Digital Sensors
SD Card Module:
I2C Multiplexer (TCA9548A):
Stores Python scripts, libraries, and
Supports up to 8 I2C devices on 2 GPIO pins
configuration files.
(SDA/SCL).
Ensures portability and ease of access.
Simplifies wiring and reduces pin usage.
Sensor & Actuator Connectivity: Example devices: Temperature sensors (e.g.,
BMP280), accelerometers (e.g., MPU6050).
Analog Sensors: Direct connection to ESP32
ADC or via ADS1115 (I2C ADC module for Actuators
high precision).
MCP23017 I2C GPIO Expander:
Digital Sensors: Connected using TCA9548A
Adds 16 extra GPIO pins for controlling
I2C Multiplexer (supports up to 8 devices on
actuators like motors, relays, and LEDs.
2 GPIOs).
Controlled via I2C commands from the
Actuators (Motors, Relays, LEDs) :
ESP32.
Controlled via MCP23017 I2C GPIO
Example use cases:
Expander (adds 16 extra GPIOs).
o Controlling stepper motors.
Power Management:
2
o Switching relays for home
o
automation.
Driving LED arrays.
So ware Architecture
The software architecture is designed to provide a
I2C Device Communica on seamless and user-friendly experience for writing,
editing, and executing Python scripts directly on the
Supported Protocols: device. It leverages MicroPython, a lightweight
UART: For serial communication with implementation of Python optimized for
devices like GPS modules. microcontrollers, to enable efficient execution of
scripts while maintaining compatibility with Python's
I2C: For connecting sensors, actuators, and
syntax and libraries.
expanders.
SPI: For high-speed communication with The system includes:
devices like SD cards or displays.
A script editor for writing and editing Python
Device Detection: code.
A file management system for organizing
Automatically detect connected I2C devices
scripts and libraries stored on the SD card.
during startup.
A graphical user interface (GUI) for
Provide a list of detected devices in the GUI
interacting with the device.
for easy identification.
Support for I2C, UART, and SPI
Control Commands: communication protocols to interface with
sensors, actuators, and other peripherals.
Users can send I2C commands directly from
their Python scripts to interact with Key Components
connected devices.
Example: Reading temperature data from a MicroPython Firmware
BMP280 sensor or controlling a relay via
MCP23017. The ESP32 runs MicroPython firmware ,
which interprets and executes Python scripts
in real-time.
Pre-installed libraries for common tasks such
as file handling, I2C communication, and
GPIO control.
3
Custom libraries can be added to extend o Execute: Run selected scripts directly
functionality (e.g., drivers for specific from the file manager.
sensors or actuators).
Graphical User Interface (GUI)
Built using a lightweight graphics library
such as LVGL (Light and Versatile Graphics
Script Editor Library) for smooth performance on the
TFT/OLED display.
A lightweight text editor is implemented Input mechanisms:
directly on the device for writing and editing o Touchscreen: Tap to select options, drag
Python scripts. to scroll.
Features: o Rotary encoder: Rotate to navigate
o Basic syntax highlighting for Python menus, press to select.
keywords, strings, and comments. o PS/2 keyboard: Type text and navigate
o Line numbering for easier debugging. using arrow keys.
o Auto-indentation to improve readability.
o Error highlighting for common syntax I2C Device Communication
issues.
The system automatically detects connected I2C
Navigation:
devices during startup.
o Users can scroll through the script using
the rotary encoder or touchscreen. Users can interact with I2C devices via Python
o PS/2 keyboard support for faster text scripts:
entry.
Example: Reading data from a temperature
File Management System sensor.
Scripts and libraries are stored on the SD
card. from machine import I2C, Pin
File operations supported via the GUI: import bmp280
o Create: Create new Python script files.
o Edit: Open and modify existing scripts. i2c = I2C(sda=Pin(21), scl=Pin(22))
o Delete: Remove unwanted files. sensor = bmp280.BMP280(i2c)
4
print("Temperature:",
Resource Links
sensor.temperature)
Quick reference for the ESP32 — MicroPython latest
documentation
Example: Controlling a relay via MCP23017
MCP23017 Data Sheet
GPIO expander