This is an old revision of the document!
The project consists of a standalone data logging and visualization system based on the ESP32 microcontroller. The device reads data from analog and digital sensors (temperature/pressure, light). The data is also rendered in real time on a color TFT display. The system can be operated independently from a PC using a custom hardware interface and a standard PS/2 keyboard.
The Scope of the Project: The main scope of the project is creating a set of portable tools capable of logging and storing physical data whilst also offering the user a local control panel. The user can type commands to modify the sampling rate, graph scale, or to save/load data from memory.
Starting Idea: I wanted to build an embedded system that can integrate many communication protocols and peripherals that I studied (SPI, I2C, UART, ADC, PWM, timers, system interrupts) without using a computer. I was inspired by budget oscilloscopes.
Why It Is Useful: For regular users, the project serves as a practical and visual instrument for monitoring the environment or testing analog signals. For me as a developer, I wanted to write from scratch a driver for the PS/2 protocol (managing external interrupt timings) and coordinating multiple data buses (high-speed SPI for graphics and I2C for sensors and storing data) without blocking operations.
Project Modules and User-System Interaction
The system is split into hardware and software modules. The system is partially event-driven (using interrupts).
Bill of Materials:
Electrical diagram
IDE:
platformio.ini utilizing the Arduino framework for the ESP32 (espressif32 platform).Libraries and 3rd Party Resources:
Algorithms and Data Structures Used (or Planned):
data_buffer[MAX_SAMPLES] consisting of custom SensorSnapshot structs. It stores aggregated sensor payloads (timestamp, potentiometer, light, temperature, pressure). Capped at 250 samples to perfectly fit within the ESP32's 4KB EEPROM limit._rawBuffer) to safely enqueue raw, asynchronous hardware scan codes triggered by GPIO interrupts without blocking the main thread.AppState enum (STATE_INITIAL, STATE_RUNNING, STATE_INSPECT) dictates the high-level system behavior, preventing invalid actions like zooming while actively recording data.update_chart_source) calculates visible data slices using dynamic array indexing offsets (pan_offset) and active time windows (scale_x_window). It dynamically remaps sensor data into the display's visual space to accomplish real-time panning and zooming.Sources and Implemented Functions:
main.cpp: The system orchestrator. Initializes the hardware peripherals, bridges LVGL with the display (my_disp_flush) and the keyboard driver (keypad_read_cb), maps keyboard shortcuts to system commands, and drives the main UI loop (lv_timer_handler).graph.cpp / graph.h: Manages the LVGL charting subsystem, data acquisition, and EEPROM state persistence. init_graph(), recording_task(), update_chart_source(), cmd_start_recording(), cmd_zoom(), cmd_pan(), cmd_save(), cmd_load().terminal.cpp / terminal.h: Implements the graphical terminal overlay and its text parser, allowing users to type and execute commands that interface with the graphing logic. init_terminal_ui(), toggle_terminal().menu.cpp / menu.h: Controls the GUI-based settings menu for intuitive user configuration using LVGL components. init_menu(), toggle_menu().ps2_keyboard.cpp / ps2_keyboard.h: A bare-metal PS/2 keyboard driver utilizing hardware interrupts to capture user inputs. begin(), read(), handleInterrupt().
Fişierele se încarcă pe wiki folosind facilitatea Add Images or other files. Namespace-ul în care se încarcă fişierele este de tipul :pm:prj20??:c? sau :pm:prj20??:c?:nume_student (dacă este cazul). Exemplu: Dumitru Alin, 331CC → :pm:prj2009:cc:dumitru_alin.