1/100 MG Zaku II 2.0 Using Arduino Nano
by LukW1 in Circuits > Arduino
2664 Views, 4 Favorites, 0 Comments
1/100 MG Zaku II 2.0 Using Arduino Nano
Based on the experience of building Zaku Head by Arduino Nano, USB camera and MP3 player. This build further include similar features in a smaller model of MG Zaku II 2.0, as below :
- 4.5 mm USB camera
- Camera unit horizontal movement
- Face tacking (work with host computer)
- Light and Sound effect for :
- Overall System
- Cockpit/System Startup/Shutdown
- Weapon : Heat Hawk, Machine gun/Bazooka
- Random number generation circuit for position adjustment jets light and sound effect
- InfraRed remote control
Blog : https://kwluk717.blogspot.com/
Reference for previous work on face tracking
https://www.facebook.com/kwluk/media_set?set=a.101...
Video Links :
Supplies
- 1/100 MG Zaku II 2.0 model
- 4.5mm USB Camera
- Arduino Nano
- DFPlayer
- FE 1.1S
- 8 ohm speaker
Main Camera and Eye Movement
- 4.5 mm endoscope parts
- External cover with transparent red color, the relative long distance between it and the lens caused it look like cataract in the camera view.
- Using 9g servo control the movement of camera. The placement of servo was chosen to right-side. This decision was based on Zaku mechanical design, the right cover seem keep close all the time.
Pilot and Cockpit
- Char Aznable figure by simple paint, comparison between nowadays and 15 yrs. ago…
- In addition, tri-color LEDs x 2 were added and white LEDs x 3 for the interior light effect. Unfortunately, GREEN color on right side was damaged during troubleshooting of camera movement.
- A soft switch was added at the left of Cockpit for system startup/shutdown effect activation.
Heat Hawk
- The design of Heat Hawk is heating effect rather than laser light effect; hence it should be solid color instead of transparent during standby status.
- LEDs x 5 have been used.
- Total of two heat hawks were made because version 1 was accidentally damaged when it was finished.....
- Version 1 (Left) made by multi-layer 0.4mm plastic plate with transparent yellow each.
- Version 2 (Right) made by 2 x 2mm transparent plat and colored with transparent yellow. Then silver on topmost layer.
Rocket Pack and Foot Rocket Units
- PWM was being disabled due to the used of timer2. So the injection effect was achieved by light flashing, colored by transparent red.
- Foot Rockets are made of simple PWM control on 5mm LED with transparent red color.
Posture Adjustment Jets
- In order to simulate injection and fade out effect, a random number generation circuit was built with 4017 IC. Together with capacitors and diodes for the fade out effect. Result to 10 digits output can be used. The circuit diagram is as attached.
- Due to the small room available in chest and skirt areas, 6 x 0402 package LEDs and 1mm external cover rings have been used. Colored with transparent blue.
Arduino Nano Controller Board
- The Arduino Nano controller board was Installed inside the shield.
External Interface and Wiring
- Initially I installed a mini-USB socket in left foot but found that it will limit the movable angle, so I changed to mico-USB in right foot.
-
Chaos wire, hope it can improve in future.
Machine Gun and Bazooka
- Based on control circuits in both hands, wiring from sight to the connectors.
Platform and Others
- Base Platform was built by 150mm transparent plastic plate, together with plastic tube and USB plug, colored with flat black.
-
Other modification Including light effect at right chest cockpit, InfraRed receiver and simple weathering.
Summary
- Overall build process and wiring diagram
Coding of Arduino and Visual C++
The System contains programming code for Arduino and Host Computer. Their simple logical flow is as below :
Arduino Code :
Libraries :
- PWMServo
- IRremote
- NeoSWSerial
Functions :
- Initialization()
- Loop
- Read Cover Status
- If Cover Status is :
- Close from Close
- IR_Action()
- Face_Detection()
- Close from Open
- System_Startup_Process()
- Open from Close
- System_Shutdown_Process()
- Close from Close
- Initialization()
- Definition of variables and constants :
- DFPlayer commands
- Face detection coordinate input from camera host application
- Random Number Circuit Clock counter
- Arduino Nano Pin assignment
- InfraRed remote key code
- IR_Action()
- If IR Key Read :
- Is A, Action A
- Is B, Action B
- Is C, Action C
- ...
- Face _Detection()
- Read Face Detect Coordinate (X,Y) from Serial Buffer
- If Coordinate X > Center, Move Left
- If Coordinate Y < Center, Move Right
- System_Shutdown_Process()
- Output Light and Sound Effect
- System_Startup_Process()
- Output Light and Sound Effect
Host Application :
Face_Detect_Coordinate
Libraries :
- opecv
- TSerial
Functions :
- Initialization()
- Main()
- Define Serial Port, Screen Resolution and Rotation Angel
- Read Camera Input
- Determine Human Face and Draw Box
- Output Face Coordination to Serial Port
- Initialization()
- Read Face Detection Data