Electronic Crocodile Robot


We are making an electronic robot using an Arduino board again!!!
We need to use motor control to implement the robot's production. This project is based on a classic mini-game, as shown in the picture below, which is the "biting crocodile."
The crocodile has many teeth, but only one tooth will trigger the mechanism to make the crocodile bite. The entire toy design is very interesting, utilizing a series of mechanical mechanisms without any electronic components.
This time, we are electronicizing our mechanical crocodile into a "biting electronic crocodile robot."
Supplies

The crocodile robot is part of the DINO-ROBOT series and is controlled using an Arduino board. This robot utilizes an Arduino control circuit.
Once again, it's simple and straightforward, but this time we've used a small Arduino board and one upper jaw (3D printed) to control the mouth's movement.
As with previous designs, this device can be installed with just an Arduino electronic board and basic circuit knowledge. The materials are as follows:
- Four 1.5V batteries with a battery holder to power the servos.
- One 9V battery to power the Arduino.
- One Arduino Mini board, which needs to be compact enough to fit in the box.
- One servo, as shown in the picture.
- Soldering iron, wires, and a hot glue gun.
- Two small switches: one to turn on the Arduino board and one to power the servo battery.
- Several wires. The rest will be 3D printed.
- Six small yellow push buttons, as shown in the picture.
- A DIY soldering hole board.
- Six red LED lights.
- Six 200-ohm resistors.
- Six 1k-ohm resistors.
Design the 3D Model


Step 1: Design a scary robot appearance in 3DS MAX. The robot consists of three parts: a movable upper jaw, a mostly stationary lower jaw, and a body section to hold the batteries. As shown in the picture below.
Design Electronic Circuit

The electronic circuit diagram is shown in the picture below. (It's actually not complicated; it mainly involves switch readings, LED lights, and rotating the servo.)
3D Print Parts

Step 3: In 3DS MAX, arrange the components in different colors for the printing in Step 3.
Separate the different colors, mainly yellow, blue, orange, and a small amount of white (transparent).
Installation






Step 4: Create the main board section at the bottom of the robot. All surfaces need to be soldered.
Solder in six buttons, six LED lights, six large resistors, six small resistors, and finally, solder in the pin headers for the wiring.
Bond the components together; the head design uses epoxy glue for connection, as shown in the picture. The head is also connected to the body with epoxy glue. Assemble the other mechanical parts.
The upper jaw is connected to the rotating rod with screws.
The rotating rod of the upper jaw is connected to the servo's rotating plate with screws.
The servo is placed inside the left side of the lower jaw, while the 9V battery and Arduino board are on the right side.
Arduino Programming

Step 5: Write the code for the Arduino board. This code is for the Arduino servo, as shown in the picture.
Logic:
- Press button 1 to start; the crocodile robot opens its mouth wide.
- The Arduino will select a random number.
- The LEDs corresponding to buttons 2–6 will turn on.
- Each time a player presses a button, it returns the button value and turns off the LED.
- If the button value matches the randomly selected value, the servo rotates to close the mouth.
- The first LED will blink, prompting the player to press button 1 to prepare for the next round.
[Click to download the Arduino code file you need]
Testing


Test the device by turning on the switch; it will enter standby mode. Then, press the first button to start the program.
The program selects a random number N, and each time the player presses a button, the corresponding red LED will turn off. If the player presses the Nth button, the crocodile will close its mouth, and the player loses. Press button 1 again to restart.
Below is the entire video of playing this mini-game.