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

IMG_3453-1.jpg
IMG_3437-1.jpg
IMG_3449-1.jpg
IMG_3427-1.jpg
IMG_3428-1.jpg
IMG_3430-1.jpg
IMG_3438-1.jpg
IMG_3436-1.jpg
IMG_3434-1.jpg
IMG_3444-1.jpg
IMG_3450-1.jpg

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 :

  1. 4.5 mm USB camera
  2. Camera unit horizontal movement
  3. Face tacking (work with host computer)
  4. Light and Sound effect for :
    • Overall System
    • Cockpit/System Startup/Shutdown
    • Weapon : Heat Hawk, Machine gun/Bazooka
  5. Random number generation circuit for position adjustment jets light and sound effect
  6. 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

1516242377639.jpg
1559020230032.jpg

  • 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

1558975114907.jpg
1558975699818.jpg
  • 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

1558936463944.jpg
1559145975350.jpg
  • 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

1559021094999.jpg
  • 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

MG Zaku 2.0 Feet&Body.jpg
1558973196063.jpg
1558972546330.jpg
  • 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

1558928181576.jpg
  • The Arduino Nano controller board was Installed inside the shield.

External Interface and Wiring

1558931721342.jpg
1559050539067.jpg
1559050800344.jpg
  • 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

1560157186233.jpg
1559024204652.jpg
  • Based on control circuits in both hands, wiring from sight to the connectors.

Platform and Others

1559634676610.jpg
1559051909191.jpg
  • 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

1560220939951.jpg
MG Zaku 2.0.jpg
MG Zaku II 2.0 Internal Structure Diagram.jpg
  • Overall build process and wiring diagram

Coding of Arduino and Visual C++

Arduino Code.jpg
C++ Code.jpg

The System contains programming code for Arduino and Host Computer. Their simple logical flow is as below :

Arduino Code :

Libraries :

  • PWMServo
  • IRremote
  • NeoSWSerial

Functions :

  1. Initialization()
  2. 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()
  3. 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
  4. IR_Action()
    • If IR Key Read :
    • Is A, Action A
    • Is B, Action B
    • Is C, Action C
    • ...
  5. Face _Detection()
    • Read Face Detect Coordinate (X,Y) from Serial Buffer
    • If Coordinate X > Center, Move Left
    • If Coordinate Y < Center, Move Right
  6. System_Shutdown_Process()
    • Output Light and Sound Effect
  7. System_Startup_Process()
    • Output Light and Sound Effect

Host Application :

Face_Detect_Coordinate

Libraries :

  • opecv
  • TSerial

Functions :

  1. Initialization()
  2. Main()
    • Define Serial Port, Screen Resolution and Rotation Angel
    • Read Camera Input
    • Determine Human Face and Draw Box
    • Output Face Coordination to Serial Port
  3. Initialization()
    • Read Face Detection Data

Gallery

IMG_3399-1.jpg
IMG_3317-1.jpg
IMG_3342-1.jpg
IMG_3368-1.jpg
IMG_3337-1.jpg
IMG_3307-1.jpg
IMG_3343-1.jpg
IMG_3344-1.jpg
IMG_3361-1.jpg
IMG_3370-1.jpg
IMG_3364-1.jpg
IMG_3391-1.jpg
IMG_3383-1.jpg
IMG_3417-1.jpg
IMG_3394-1.jpg
IMG_3401.jpg
IMG_3407.jpg
IMG_3405.jpg
IMG_3411-1.jpg