Fundamental:
The LM1084S-5.0 chip outputs four channels of 5V voltage to power the servo, one of which is transferred to the AMS1117-3.3 chip to output two channels of 3V3 to power the Hi3861 and PCA9685PW chips. The main control Hi3861 controls the PCA9685 to output three channels of PWM signals through I2C, thus Control the steering gear to realize the function.
Function implementation:
Draw pictures and write time in real time
Materials (except BOM):
Small clock structure: 3mm acrylic cutting version (the cost of a certain treasure is about 20 yuan)
3 servos (mg90s metal gear 180°)
Two 18650 batteries and one battery box (purchase by yourself)
A large-headed pen (needs to be consistent with the pen grip of Xiaojian Zhong structure)
An erasable pen cap (needs to be matched with a large pen)
Some screws and nuts
Schematic drawing:
Use the chip data manual provided by Lichuang Mall, and draw the external circuit of the linear regulator (LDO), Hi3861 chip, and PCA9685 according to the circuit provided in it, and add the I2C interface pull-up resistor. Pay attention to the filtering of the power supply (small capacitor filters high frequency, Large capacitor filters high frequency), power indicator light, reserved I/O port of the main control chip, 5V, 3V3, and download interfaces.
PCB drawing (no sharp or right angles! The line width should not be smaller than 5mil!!):
Typesetting first and then wiring. The typesetting is neat and clear. You can modify the PCB circuit by modifying the schematic diagram. Remove copper under the Hi3861 antenna, make the power supply line thicker (about 2 times the default value), and add heat dissipation holes and filtering under the 5V LDO. The principle of keeping capacitors close, the differential signal lines (TXD, RXD) should be close, and the lead-out interfaces should be explained comprehensively with silk screen printing.
Welding part:
Equipment: A Baoli Luxianzi LED desoldering station, Anlixin solder paste (syringe), tin wire, solder suction device, tweezers, Huanghua soldering iron (blade), high temperature resistant tape
Suggestion: For patch welding, first apply a little solder paste syringe on each solder joint, and then place resistors, capacitors, LEDs, chips, and switches.
Assemble the desoldering station and power on (pay attention to ventilation, make sure the wires are not short-circuited, do it in an open area, and do not let the wires touch the heating table).
Then you can enjoy the beautiful scene of the solder paste solidifying! Don’t heat it for too long! ! Finally, check whether there is any soldering or weak soldering, and if so, use a soldering iron tip to repair it.
It is best to fix the pin header with some high-temperature resistant tape, and then use tin wire to weld the back. After the welding is completed, touch the pin header with the tip of the soldering iron to prevent false soldering. The same is true for the switch welding.
Assembly of the little cheap clock:
Software part:
genki_web_plotclock.h Lines 15-18 of code change the pins of the servo signal line here.
The 91st line of code in genki_web_plotclock.c can modify the information of the web page after connecting to WiF, such as adding or subtracting some functions. When adding, you must also write parameters in the corresponding function keys; the 459-482 lines of code can be modified. The angle of each step of turning on the servo is the parameter of SERVO_BOTTOM_PORT.
Precautions:
Please use Hiburn.exe to burn the firmware program.
See the attachment for the code and burning tools.
VMware Workstation 16 player virtual Linux system, then download the Clion compiler, first clone the complete environment code, then open it with CLion, copy the plotclock directory of Xiaojiazhong, and copy it to the complete environment following directory ohosdog/applications/genkipi/app (note Comment out dog_py in BUILD.gn)
At the same time, replace libdtpython.a in device/itcast/genkipi/sdk_liteos/build/libs/libdtpython.a (the libdtpython.a file is in the project attachment)
After the compilation is completed, find the Hi3861_wifiiot_app_allinone.bin file under the ohosdog/out/genkipi/genkipi file, copy it, put it in the same file as the Hiburn.exe burning file, open Hiburn.exe and burn it.
Areas for improvement:
Use a voltage comparator + Mosfet to implement power switching and protect the circuit; use a Micro usb plug with the circuit of the CH340 chip to implement the serial port burning program, and design additional charging circuits.
The above information comes from: participating in the bionic robot dog training camp organized by Jialichuang EDA and Chuanzhi Education, dark horse programmers, and Chuanzhihui and CSDN.