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 .
Video address: https://www.bilibili.com/video/BV1Uk4y1m7kd/ This project also adds the following functions after restoring its appearance:
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:
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.
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)
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.
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
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
The peripheral chip circuits are drawn according to the chip manual.
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
On the Raspberry Pi side, OpenCV and C++ are used for development, and on ESP8266, Arduino is used for development.
Library used by Raspberry Pi: Wiring Pi/Boost/Open CV(3.9.4)
Program execution flow:
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 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.
There is nothing to say about using SolidWorks to draw 3D models.
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.
2020/08/05 First version completed
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet