Skip to content

Lexx79/ESP32-IR-Scanner-CYD_ESP32-2432S028

Repository files navigation

Project: IR Remote Control Scanner

  • Author: Gemini
  • Version: 1.2
  • Target Board: Cheap Yellow Display (CYD) ESP32-2432S028

1. Project Purpose

This project is a firmware for an ESP32 board with a display that allows you to scan and save signals from any infrared (IR) remote control.

The application enables you to sequentially scan the buttons of a remote, accumulate them in a buffer, and then write the entire data packet to an SD card as a text file for further analysis.

2. Project Structure

The project code is divided into several logical parts for ease of understanding and modification:

  • IR_Scanner.ino: The main sketch file. Contains the setup() and loop() logic, device initialization, and handling of main events (screen touch, IR signal reception, SD card writing).
  • config.h: The configuration file. Contains all the main settings: pins, names, versions, as well as the color scheme and the maximum number of buttons in the buffer.
  • ui.h: Header file for the user interface. Declares all functions responsible for drawing on the screen.
  • ui.cpp: Implementation file for the user interface. Contains the code for all functions that draw elements on the screen.

3. How to Use

3.1. Required Libraries

  1. TFT_eSPI by Bodmer
  2. IRremote by ArminJo (v4.x or newer)
  3. SD (included in the standard ESP32 package)

3.2. Connections

Connect the signal (OUT) pin of your IR receiver (e.g., VS1838B) to GPIO 22 on the board. To use the SD card writing feature, insert a MicroSD card into the corresponding slot on the board.

4. Functionality

  • Landscape Mode: The interface is completely redesigned for convenient operation in horizontal screen orientation (320x240).
  • Scanning and Buffering:
    • Point the remote and press a button. The signal information will appear on the screen.
    • Press the "Next" button on the screen to save the current button's code to the buffer. The button counter will increase.
    • Scan the next button on the remote.
  • Writing to SD Card:
    • After scanning all desired buttons, press "Write".
    • All data from the buffer will be saved to a new .txt file on the SD card. The filename will be chosen automatically (1.txt, 2.txt, etc.).
    • During the writing process, the "Write" button changes color to indicate activity. After a successful write, the buffer is cleared.
  • SD Card Indicator: A green "SD" icon is displayed in the screen header if a memory card is successfully detected.
  • Clear: The "Clear" button clears the last scan data from the screen without affecting the buffer.

5. Development History

5.1. Version 1.0

  • Initial Version: Created a basic sketch with IR code output to the Serial port.
  • Display Integration: Added support for displaying output on the screen using the TFT_eSPI library.
  • Code Structuring: The project was divided into config.h, ui.h, and ui.cpp files.
  • Bug Fixes: Fixed compilation and logic errors related to data types, double object definitions, and handling of repeats from a held button.

5.2. Version 1.1

  • Landscape Mode: The interface was completely redesigned from portrait to landscape (320x240) for better element layout.
  • Touch Calibration: Added and implemented a touch screen calibration mechanism for correct operation in landscape mode.
  • SD Save Functionality:
    • Added logic for initializing and checking the presence of an SD card.
    • Added an SD card status indicator to the interface.
  • Button Buffer:
    • Implemented a mechanism for accumulating scanned codes in a buffer.
    • Added a saved button counter and "Next" (to save to buffer) and "Write" (to write to SD) buttons to the interface.
  • File Writing: Implemented a function that, when "Write" is pressed, saves the entire buffer to the SD card in a text file with an automatically incrementing name (1.txt, 2.txt, etc.).
  • Button Animation: Added visual feedback (color change) for the "Write" button during the writing process.
  • Added Raw Data to File: Raw data was added to the saved file to allow for the restoration of signals from unknown protocols.

5.3. Version 1.2

  • New Data Interface: Signal information (protocol, address, command, bits, raw value) is now displayed in two columns for compactness and better readability.
  • Oscillogram Added: An oscillogram of the received IR signal is now drawn at the bottom of the information panel, allowing for a visual assessment of its structure.
  • Numerous UI Fixes: A number of critical errors related to screen drawing and clearing have been fixed. Fixed the erasing of static headers when updating data, and corrected the position and size of all elements to prevent overlaps and going beyond panel boundaries.

About

Firmware for ESP32-2432S028 (Cheap Yellow Display) to scan, capture, and save infrared (IR) remote control signals an SD card. Features landscape UI, signal buffering, and oscillogram display.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors