
Project Name: X-Laser Vector Laser Projector
Project Author: Little Horn Team
Everyone!The vector laser projector X-Laser is super cool!!!
-
Supports projecting patterns drawn by yourself
-
Supports real-time projection: projecting while drawing
-
Supports preset animation/pattern projection, one-click switching
-
No background required, can project in any dim environment

-
Used to confess to Xiaofang artistic creation
-
Used for driving navigation
-
Used for various events to enhance visual experience
-
Take it out to play, take pictures + create atmosphere
-
Image presentation
-
……
Overall Block Diagram
Schematic Diagram_Main Control Board
PCB Diagram_Main Control Board
Schematic Diagram_Power Board
PCB Diagram_Power Board
Some circuits reference the project of Bilibili user “@Cool Core BB”.
As you can see, this project has two boards – the main control board and the power board.
The main control board is designed based on ESP32, with peripheral circuits integrated with DAC, MicroSD, and TFTLCD drivers.
-
The TFTLCD is connected to the main control board via Dupont wires.
-
The galvanometer motor driver board and laser driver board are connected to the main control board via XH wires.
Used for processing +12V, +18V, +15V, -15V level conversion.
The power board is fixed to the main control board via pin headers and copper pillars, providing +15V and -15V to the main control board as the operational amplifier power supply for the differential circuit.
This project is based on laser galvanometer technology, changing the laser emission direction through the galvanometer’s offset, utilizing the human eye’s visual persistence effect to project vector animations.
How to store/play animations?
Users can store laser animations (files with the ild suffix) on the MicroSD card, and select “Example” for playback after starting; or choose “Draw Now” to draw their desired laser animation on the LCD screen for projection!
How to achieve precise projection?
Here you need to understand the principles of power management and galvanometer driving!
X-Laser is powered by a 12V lithium battery, with XH packaging for the interface, pay attention to the positive and negative directions. A lithium battery with DC charging can be assembled. The 12V is boosted to 18V on the power board, then stepped down to ±15V (if only boosted to +15V, it cannot be stepped down to -15V). 12V powers the laser driver board, and is also connected to the main control board via pin headers, stepping down to 5V and 3.3V to power the MCU and onboard peripherals; ±15V is connected to the main control board via pin headers, to power the differential circuit controlling the galvanometer motor driver board.
The MCU calculates the proportional mapping relationship based on the projection point’s position, outputs 1.024V~3.072V through DAC, is converted to -2.048V~+2.048V through the offset amplification circuit, and inputs to the galvanometer driver board,driving the galvanometer’s deflection.
How to achieve hand-drawing mode?
In hand-drawing mode, the LCD willread the touch point and the current Colorwheel parameters, store them in a structure variable, and notify the Draw Task loop to project the stored touch points.
Here, we need to understand three questions about high current driving.
1. When the number of stored points is small, the galvanometer current will be high, causing the inductor solder to melt and explode in the 12V to 18V circuit.Solution: In the final version of the circuit, a large inductor of 330uH was used, and the firmware source code judged the number of points. When the number of points is small, the galvanometer frequency is reduced.
2. Similarly, excessive current can cause the self-locking switch on the main control board to burn out, so subsequent soldering was changed to pin headers and jumper caps for normally closed connections (the schematic PCB was not modified).
3. Additionally, in the initial version of the circuit, we attempted to directly use a MOS tube to drive the laser diode, resulting in the laser diode operating in an abnormal state, burning many; at the same time, the MOS tube frequently burned out due to high current,therefore we changed to use the original laser driver board for driving, with the MOS tube only serving as a switch circuit.
The structural design of X-Laser includes: upper frame, lower frame, and four panels.
Fixed with bolts and nuts.
The firmware of this project is based onESP-Arduino development, calling the API of ESP-IDF FreeRTOS, effectively synchronizing the operation of multiple peripherals.
The main program flow is shown in the figure below.
Below are answers to four common questions + three precautions:
1. How to manage so many peripherals?
Three peripherals (considering the LCD display and touch as one) need to run continuously!
In the initial design, two SPI lines were used to control all peripherals, resulting in poor performance. The SPI time-sharing multiplexing tasks can easily run away, and the blocking and notifications of RTOS cannot perfectly stabilize them, limiting the projection frame rate, ultimately choosing to use SDMMC to read the MicroSD card.
2. How to solve the notification and blocking between cache and projection tasks?
The idea is that all upper-level logic only controls the cache, not directly affecting the projection; when the cache is full, it self-blocks; after the projection is executed, it notifies the cache, and the projection depends on the cache, preventing empty frames from occurring during projection.
3. What is the idea of clearing animation data?
When it is necessary to clear the laser animation data in RAM, such as the Clear in DrawNow mode, the idea is similar to stack operations, only adjusting the pointer back to the starting point in memory, clearing variables such as total frame count without actively clearing animation data.
The LCD UI is designed based on SquareLine Studio.
4. What if the LVGL library cannot call my own functions?
In the LVGL library exported by SquareLine, it cannot call my own functions. To use the key callback in lv_events.c, the current method is to define a variable as the key state in this file, declare this variable as an external variable in my own header file, and then judge this variable in the LCD Task, so that key events can be written in my own function file.
5. Compilation, burning, and startup steps
The chip needs at least 2MB of Flash, and when compiling in platformio, you need to add a partition table, which can refer to the official partition table example.The partition table for this project is in the open-source Firmware/esp32/huge_app.csv.
The DAT0 pin of the MicroSD is connected to IO2 of the ESP32, which will force it high. During firmware burning, you need to insert a jumper cap on the H31 pin header to pull this pin low,allowing the ESP32 to enter download mode.
In X-Laser, we chose the N8R8 module chip, which actually does not require so much RAM becausedynamic read and write is used.
The ESP32’s power-on self-start requires the BOOT to be pulled high. Although the BOOT is pulled up by default, it was found in the final version of the design that if it is not manually pulled up, the program will not self-start. Therefore, in the final version of the circuit, a 1K resistor was used for manual pull-up.
In the MicroSD card,create a folder named ILDA and place the laser animation files. After starting, you can see the laser animation files read in the screen roller.
The animation file name length must be less than 15 characters, otherwise, it will not display completely and cannot be played normally.
6. About DrawNow mode
The touch screen refresh and reading touch points have frequency limitations, so “slowly” drawing yields better results.
When drawing laser animations, the laser diode needs to be turned off between two consecutive curves, waiting for the galvanometer to shift before turning back on,otherwise, it will close the entire pattern.
In the ILDA file, these areas have been considered and path planning has been done.
In DrawNow mode, turning off the laser diode and waiting for the galvanometer to shift before turning it back on still has a visual persistence effect. Adding a small delay improves this, with 5ms being the best in tests.Excessive delay may cause animation flickering.
……
else
{
digitalWrite(PIN_NUM_LASER_R, HIGH);
digitalWrite(PIN_NUM_LASER_G, HIGH);
digitalWrite(PIN_NUM_LASER_B, HIGH);
delay(5); // Ensure curve disconnection
}
// DAC output refresh
digitalWrite(PIN_NUM_LDAC, LOW);
digitalWrite(PIN_NUM_LDAC, HIGH);
7. What is included in the Firmware?
The Firmware includes the firmware source code for the main control board, and the esp32/build folder contains precompiled firmware that can be directly burned. Refer to 【Chapter 6】 for guidance to the open-source website.
The main content of the source code is as follows:
-
Multi-task loop under ESP-IDF FreeRTOS, including three tasks: reading and caching from the SD card to RAM, SPI driving DAC to output data from RAM, and UI interaction and control of TFTLCD. Mainly included in esp32/src/CoreLoop.cpp.
-
TFTLCD UI files and SquareLine Studio project source files, implementing user selection and playback of laser animations and hand-drawing based on LVGL and TFT_eSPI libraries. The SquareLine Studio project is in the UI folder, and the lvgl events and TFTLCD drivers are in esp32/lib and esp32/src/MyTFTLCD.cpp.
-
SDMMC drivers and HSPI, VSPI drivers, mainly included in esp32/src/SPIRenderer.cpp and esp32/src/SDCard.cpp.
-
ILDA file-related functions, mainly included in esp32/src/ILDAFile.cpp. The code is structured under vscode’s platformio, and the firmware can be burned by connecting TX and RX pins via CH340.
This project is open source!
——Want to replicate ? Want to give feedback to the author ? You can copy the open-source website and go to the original article.
Open Source Website: https://oshwhub.com/small-horn-projection-team/x-laser

Click on the end of the article 【Read Original】 to directly enter the original text.
“X-Laser Vector Laser Projector” open-source materials:
-
Circuit design schematics and PCBs for two core boards
-
MCU firmware source code and screen UI project source files
-
Shell design structure project source files
Demonstration Video
*This article is a reprint of user creations from the “Lichuang Open Source Hardware Platform”. If there is any infringement, please contact for deletion.
