念慈菴

Misaka Sister Goggles (based on Raspberry Pi)

 
Overview

cover.jpg

Misaka Sister GogglesX Raspberry Pi

Hi, this is a hard-core ACG peripheral production project based on Raspberry Pi. Its prototype is the tactical goggles worn by Misaka Mikoto 's clone in "A Certain Scientific Railgun" : Misaka's sister .

structure.png

Video address: https://www.bilibili.com/video/BV1Uk4y1m7kd/ This project also adds the following functions after restoring its appearance:

  • night vision
  • Face detection
  • edge snapping
  • Video
  • Zoom in

Temporarily, the function is relatively simple. But relying on the powerful performance of Raspberry Pi, I plan to continue to add functions to it. Currently, I plan to add:

  • Face recognition (can identify who you are)
  • Item identification
  • OCR

This is the first available version at this stage, and subsequent changes will be updated at the end of this document.

*If you have any questions, please submit an issue.

Source file structure

3DModel : model drawn by Solidworks, and stl file for 3D printing.

Esp8266 : Arduino code for esp8266

Raspberrypi : C++ program code for Raspberry Pi

python_demo : python code developed in the first generation, which has basically the same functions as C++. This project was initially developed in python, but later the project language was changed to C++ due to python's execution efficiency issues. The python code is for reference only.

PCB : schematic, Gerber, PCB layout (EDA format)

Hardware composition

This is a diagram of the main parts.

This project includes schematic diagram and PCB layout. Please refer to the schematic diagram for detailed BOM.

Note that in the PCB layout, GPIO15 of ESP8266 needs to be pulled down to GND, otherwise the Arduino program cannot be burned normally. I forgot to draw it in the PCB, you can change it yourself or connect it manually after the PCB is printed.

raspberry pie

The connection method between the Raspberry Pi and the motherboard here is pin header connection, and 0 series and Model A series Raspberry Pi can be used.

This project tried using Raspberry Pi Zero w and 3A+.

GPIO allocation:

BCM 2/3: Voltage data transmission

BCM 17/27/22/10/9/11/8: LCD display data transmission

BCM 6: Raspberry Pi working status indicator

BCM 13/19/26/21: Touch key input

BCM 20: Decorative LED switch

BCM 14/15: Serial communication

ESP8266

In this project, ESP8266 is used as a microcontroller to provide battery voltage measurement and WS2812 control for Raspberry Pi.

Note that in the PCB layout, GPIO15 of ESP8266 needs to be pulled down to GND, otherwise the Arduino program cannot be burned normally. I forgot to draw it in the PCB, you can change it yourself or connect it manually after the PCB is printed.

The remaining peripheral circuits are the minimum system circuits of ESP8266.

GPIO allocation:

GPIO 14/12: Voltage data transmission

ADC: measure voltage

GPIO 2: Raspberry Pi working status indication

GPIO 13: WS2812 control

Other peripheral chips

The peripheral chip circuits are drawn according to the chip manual.

PCB jumper settings

I set up zero ohm lines on the PCB to switch the power supply to various parts.

J_VIN: The charging jumper of IP5306. After removing it, connecting to USB1 will not charge the battery.

J_5V: The output jumper of IP5306. After removal, the battery will not power the entire system.

RPI_USB5VIN: 5V power supply of USB2. After disconnecting J_5V, you can connect this jumper to use USB2 to power the entire system.

J_WS2812_PWR: WS2812 power supply

software design

On the Raspberry Pi side, OpenCV and C++ are used for development, and on ESP8266, Arduino is used for development.

Raspberry Pi side

Library used by Raspberry Pi: Wiring Pi/Boost/Open CV(3.9.4)

Program execution flow:

workflow.png

gpio_status

Among them, all selection information is stored in the gpio_status object.

In addition, this object is also responsible for processing the level signal from the touch chip and processing:

Use the Wiring Pi library to configure the corresponding pin of the touch chip as a falling edge interrupt, and call the function bound in main for processing when an interrupt occurs.

fb-pusher

This object is responsible for pushing the image generated by OpenCV to /dev/fb*, which is the Framebuffer.

Reference from https://stackoverflow.com/questions/32709175/writing-to-dev-fb0-using-opencv

voltage_detect

This object is responsible for receiving the voltage data transmitted by the microcontroller. The transmission protocol is a very simple protocol written by myself:

After 12 consecutive low levels are transmitted, the confirmation data begins to be transmitted.

First, a four-digit binary number is transmitted, representing the units digit.

Secondly, two sets of four-digit binary numbers are transmitted to represent the first and second digits after the decimal point respectively.

These three sets of binary numbers represent the value of the voltage.

video_player

Responsible for playing the boot animation

frame_stacker

Responsible for text stacking

ESP8266

ESP8266 is mainly responsible for two things: battery voltage detection and Raspberry Pi working status indication.

When powered on, signal (BCM6-GPIO2) will be pulled up and in a high level, indicating that the Raspberry Pi is not started.

At this time ESP8266 will control WS2812 to signal to the user.

After the Raspberry Pi starts up, the signal (BCM6-GPIO2) will be pulled low, indicating that the Raspberry Pi starts up. ESP8266 will shut down WS2812 and start transmitting voltage data to the Raspberry Pi.

3D model

There is nothing to say about using SolidWorks to draw 3D models.

bits and pieces

1) The key debounce of the capacitive touch chip is not very good, so it is not recommended to use this chip.

2) TYPEC’s female socket is better to be more expensive. The female socket I bought for 70 cents each is already very loose when plugging in and out.

renew

2020/08/05 First version completed

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-08-08 23:21:47

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号