透明小电视

Overview

HoloCubic--多功能透明显示屏桌面站

视频介绍: https://www.bilibili.com/video/BV1VA411p7MD/

0. 关于本项目

这是为了更新视频,缓解本人拖更两个月的尴尬,用一个周末时间赶出来的一个有意思的小玩意。

总的来说功能比较多,显示方式也十分炫酷,大家可以基于我的方案继续扩展实现更多功能。本项目的硬件方案是基于ESP32PICO-D4的,一个很实用的SiP芯片,也因此整板面积能做到一个硬币大小;软件方面主要是基于lvgl-GUI库,移植了ST7789 1.3寸240x240分辨率屏幕的显示驱动,同时将MPU6050作为输入设备,通过感应的方式模拟编码器键值。

1. 硬件打样说明

**暂时没发现有啥需要特别注意的。**PCB可以直接拿去打样,两层板很便宜,器件BOM的话也都是比较常用的,整板成本在30以内。

2. 固件编译说明

玩过Arduino的基本没有上手难度了,把Firmware/Libraries里面的库安装到Arduino库目录(如果你用的是Arduino IDE的话),然后这里需要修改一个官方库文件才能正常使用:

首先肯定得安装ESP32的Arduino支持包(百度有海量教程),然后在安装的支持包的esp32\hardware\esp32\1.0.4\libraries\SPI\src\SPI.cpp文件中,修改以下代码中的MISO为26

if(sck == -1 && miso == -1 && mosi == -1 && ss == -1) {
    _sck = (_spi_num == VSPI) ? SCK : 14;
    _miso = (_spi_num == VSPI) ? MISO : 12; // 需要改为26
    _mosi = (_spi_num == VSPI) ? MOSI : 13;
    _ss = (_spi_num == VSPI) ? SS : 15;

这是因为,硬件上连接屏幕和SD卡分别是用两个硬件SPI,其中HSPI的默认MISO引脚是12,而12在ESP32中是用于上电时设置flash电平的,上电之前上拉会导致芯片无法启动,因此我们将默认的引脚替换为26。

也可以通过设置芯片熔丝的方式解决这个问题,不过那样的操作时一次性的,不建议这么玩。

另外:

由于我赶视频制作,代码都是临时写的非常杂乱有很多dirty code,因此仓库中的是所有驱动调通之后的模板代码,可以自己基于这个框架自由开发。

我后面有空了整理好APP应用代码也会更新出来。

3. 关于分光棱镜

我用的时25.4mm x 25.4mm x 25.4mm的棱镜,淘宝应该可以搜到,单个价格80元左右。

4. 文件说明

Hardware

  • Naive Version:视频中出现的版本,因为周末制作+赶视频时间匆忙所以结构设计得比较简单,以下两个外壳结构都是用这个电路版本↓

  • Ironman Version:新设计的钢铁侠风格结构件的配套电路,原理图是一样的,下面的结构用这个版本电路(该版本为和朋友合作设计的,后面可能会授权他联名量产)

Software

  • Visual Studio的工程,可以在电脑上模拟LVGL的界面效果,改好之后代码粘贴到Arduino固件那边就可以完成界面移植。这样省的每次修改都要重新交叉编译Arduino的固件,提升开发效率。

其他的后续再补充,有用的话记得点星星~

Comments
  • 购买三棱镜贴膜问题

    购买三棱镜贴膜问题

    硬件方面的小白完全体有个问题:

    我准备跟着Gihub 下手试一试这个项目啦。

    想问一下 我看到了2个棱镜:

    1. https://item.taobao.com/item.htm?id=608974731299&ali_trackid=2:mm_26632674_99800204_108708850297:1626497619_140_1019591071&union_lens=lensId:[email protected]@[email protected];linkRuleId:2;recoveryid:1626497619_140_1019591071&spm=a21wu.12321156.0.0&ak=26008535&bxsign=tbkwC6LH/YYinyaaGXJRpDwtLRN3HuN2LFz/ag0N6vGbZJn695xCDoYEuiyMTCTuPy/8i5hOZytTTDsa4rTR5HiUtSegwUK+X45Det/tIEXJ8g=

    2. https://item.taobao.com/item.htm?spm=a21wu.12321156.0.0.d54270ee4aMdYQ&id=611950292711

    image 第一个它说没有镀膜, 是不是就是不能买? 我记得 zhihui君在视频里提到过 两块棱镜的粘合面是镀有分光膜的。所以没有镀膜就是没有分光膜 对吗?

    然后 我看我即使选择不同的颜色 比如 黑色、米白色、灰色等 淘宝网站上现实的都是透明的三棱镜。 所以它这个颜色不是说三棱镜玻璃体的颜色,而是说 镀膜的颜色??? 我一直以为一定要选 透明的 才行?

    没想到在第一步 就卡住了。 毕竟不在国内 买错了一次 估计要等好几周到1个多月才能再次收到了,所以十分小心。

    希望zhihuijun和各位大佬能帮忙排忧解难一下。 非常感谢~!

    opened by franva 11
  • OCA贴膜问题

    OCA贴膜问题

    请问大家, 在这个项目里面是不是要用到OCA两次在两个不同的地方?

    1.用OCA把两个三棱镜粘起来 2.用OCA把这2个棱镜组成的方块粘到屏幕上?

    如果是,那你们是怎么裁减OCA贴膜的呢? 市面上买的贴膜肯定都比1.3存屏幕和三棱镜的贴合面大。 如果直接用剪刀裁减 会不会把OCA贴膜的边界给挤压 的不平整了?

    opened by franva 9
  • MPU6050中央焊盘是否应该接地?

    MPU6050中央焊盘是否应该接地?

    稚晖君您好,我发现您的PCB中MPU6050中央焊盘为GND网络且打了过孔,但MPU6050数据手册中说明 “The MPU-60X0 has very low active and standby current consumption. The exposed die pad is not required for heat sinking, and should not be soldered to the PCB. Failure to adhere to this rule can induce performance changes due to package thermo-mechanical stress. There is no electrical connection between the pad and the CMOS.” MPU-60X0有很低的动态性能和标准的电流损耗。该焊盘不要求进行散热,同时也不能连接到PCB上。该焊盘是为了增加芯片的机械应力,不应该有任何的电气连接。“ 请问您将中央焊盘接地是什么原因,接地会不会对MPU6050造成影响?如果手册中说不接地应该怎么处理呢?

    opened by fan-ziqi 5
  • A fatal error occurred: Timed out waiting for packet content

    A fatal error occurred: Timed out waiting for packet content

    下载时经常遇到:A fatal error occurred: Timed out waiting for packet content 和 A fatal error occurred: MD5 of file does not match data in flash! 两个问题。中间也有下载成功过,不知道是什么原因导致的。请教一下应该如何解决!

    opened by Xuyinsong 4
  • 无法上传固件,报错:A fatal error occurred: Failed to connect to ESP32: No serial data received.

    无法上传固件,报错:A fatal error occurred: Failed to connect to ESP32: No serial data received.

    Retrieving maximum program size .pio\build\pico32\firmware.elf Checking size .pio\build\pico32\firmware.elf Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" RAM: [== ] 17.7% (used 57924 bytes from 327680 bytes) Flash: [==== ] 39.7% (used 520333 bytes from 1310720 bytes) Configuring upload protocol... AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa CURRENT: upload_protocol = esptool Looking for upload port... Using manually specified: COM4 Uploading .pio\build\pico32\firmware.bin esptool.py v3.3 Serial port COM4 Connecting......................................

    A fatal error occurred: Failed to connect to ESP32: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

    固件上传失败,尝试GPIO0短接GND试过了也是这个报错失败,重新焊接后依旧。有人知道怎么解决吗

    opened by ZFYoung 2
  • 求助:vscode PlatformIO 编译失败

    求助:vscode PlatformIO 编译失败

    arduino IDE已经安装, ESP32包也装了。 ----------报错误内容-------------

    Building in release mode Linking .pio\build\pico32
    collect2.exe: error: ld returned 1 exit status *** [.pio\build\pico32\firmware.elf] Error 1

    求教, 谢谢大家!

    opened by 3lide 1
  • 未找到2.Firmware\HoloCubic_fw\lv_fs_fatfs.c

    未找到2.Firmware\HoloCubic_fw\lv_fs_fatfs.c

    我用vs打开的时候出现这个 Ignoring source code that is included in the project but can not be located: E:\XXX\HoloCubic\2.Firmware\HoloCubic_fw\lv_fs_fatfs.c 编译时出现: ensa-esp32-elf-g++*: error: C:\Users\zjy\AppData\Local\Temp\VMBuilds\HoloCubic_fw\espressif_pico32\Debug\lv_fs_fatfs.c: No such file or directory

    opened by shiniankanchaige 1
  • 请问这个错误是不是我找的MPU6050文件有问题

    请问这个错误是不是我找的MPU6050文件有问题

    1、这里显示两个变量没有定义,是不是我找的MPU6050文件有问题,可以的话请大佬发一下这个文件夹。 2、这里出现了重复库会不会影响最后的编译结果。 3、安装完esp32的支持包后,出现很多开发板的选项,请问编译的时候需要选择哪一个。

    `E:\Arduino\libraries\MPU6050\MPU6050.cpp: In member function 'int8_t MPU6050::GetCurrentFIFOPacket(uint8_t*, uint8_t)': E:\Arduino\libraries\MPU6050\MPU6050.cpp:2763:32: error: 'BUFFER_LENGTH' was not declared in this scope uint8_t Trash[BUFFER_LENGTH]; ^ E:\Arduino\libraries\MPU6050\MPU6050.cpp:2769:39: error: 'Trash' was not declared in this scope getFIFOBytes(Trash, (uint8_t)RemoveBytes); ^

    "WiFi.h" 对应多个库 已使用: E:\Arduino\hardware\espressif\esp32\libraries\WiFi 未使用:E:\Arduino\libraries\WiFi

    "SD.h" 对应多个库 已使用: E:\Arduino\hardware\espressif\esp32\libraries\SD 未使用:E:\Arduino\libraries\SD

    exit status 1 为开发板 ESP32 Dev Module 编译时出错。`

    opened by Aria-CYF 1
  • docs: Fix a few typos

    docs: Fix a few typos

    There are small typos in:

    • 2.Firmware/HoloCubic-fw/lib/FastLED/README.md
    • 2.Firmware/HoloCubic-fw/lib/TFT_eSPI/README.md
    • 2.Firmware/Libraries/FastLED/README.md
    • 2.Firmware/Libraries/FastLED/controller.h
    • 2.Firmware/Libraries/FastLED/fastspi_types.h
    • 2.Firmware/Libraries/FastLED/pixeltypes.h
    • 2.Firmware/Libraries/FastLED/platforms/arm/common/m0clockless.h
    • 2.Firmware/Libraries/FastLED/platforms/arm/k20/clockless_block_arm_k20.h
    • 2.Firmware/Libraries/FastLED/platforms/arm/k66/clockless_block_arm_k66.h
    • 2.Firmware/Libraries/FastLED/platforms/esp/32/clockless_i2s_esp32.h
    • 2.Firmware/Libraries/TFT_eSPI/Processors/TFT_eSPI_STM32.c
    • 2.Firmware/Libraries/TFT_eSPI/README.md
    • 2.Firmware/Libraries/lvgl/examples/lvgl_display/porting/lv_port_disp_template.c
    • 2.Firmware/Libraries/lvgl/examples/lvgl_fs/porting/lv_port_disp_template.c
    • 3.Software/LvglSimulator/vs2019_proj/lv_drivers/lv_drv_conf_template.h
    • 3.Software/LvglSimulator/vs2019_proj/lv_drv_conf.h
    • 3.Software/LvglSimulator/vs2019_proj/lvgl/examples/porting/lv_port_disp_template.c
    • 3.Software/LvglSimulator/vs2019_proj/lvgl/scripts/release.py

    Fixes:

    • Should read number rather than numnber.
    • Should read display rather than dispay.
    • Should read purchasing rather than purchaing.
    • Should read number rather than numner.
    • Should read compatible rather than compataible.
    • Should read compatible rather than compatable.
    • Should read calibration rather than calibraion.
    • Should read update rather than upadte.
    • Should read transpose rather than tranpose.
    • Should read dramatically rather than dramtically.
    • Should read convenience rather than convinience.
    • Should read constant rather than contstant.
    • Should read chipset rather than chispset.
    • Should read anything rather than anyting.

    Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    opened by timgates42 0
  • 刷入固件后串口一直输出rst:0x10 (rtcwdt_rtc_reset),boot:0x13 (spi_fast_flash_boot)

    刷入固件后串口一直输出rst:0x10 (rtcwdt_rtc_reset),boot:0x13 (spi_fast_flash_boot)

    烧录显示成功,但是串口输出为以下内容,怎么解决? rst:0x10 (rtcwdt_rtc_reset),boot:0x13 (spi_fast_flash_boot) configsip: 188777542, spiwp:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:dio, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1216 ho 0 tail 12 room 4 load:0x40078000,len:10944 load:0x40080400,len:6388 entry 0x400806b4

    CA@CWV97$IVP0F%VFG%(14W

    opened by mrhp02 5
  • "不存在或开发板没有连接”

    上传时

    Traceback (most recent call last): esptool.py v3.1 File "esptool.py", line 4582, in Serial port COM5 File "esptool.py", line 4575, in main File "esptool.py", line 4074, in main File "esptool.py", line 120, in get_default_connected_device File "esptool.py", line 313, in init File "serial_init.py", line 90, in serial_for_url File "serial\serialwin32.py", line 64, in open serial.serialutil.SerialException: could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5) [788] Failed to execute script esptool 选择的串口 [788] Failed to execute script esptool 不存在或开发板没有连接

    是为什么

    opened by Muleizhang 0
Owner
稚晖
野生钢铁侠本侠。
稚晖