Introduction: Manual of Warzone Tower Defense With Arduino Design

Introduction

We are group YOJIO (You only study in JI once, so treasure it.) UM-SJTU Joint Institute locates in the campus site of Shanghai Jiao Tong University, Minhang, Shanghai. VG100 is the fundamental course of engineering for freshmen students, which aims at cultivating teamwork and leadership.

For our first project, each team is required to make a bug and a paper tower. Three bugs move on three straight racetracks towards the paper tower. There are 4 tracks surrounding the tower and the bugs randomly occupy three of them. To defend the tower, it should stop the bug with the laser beam on top of the tower. The final score is based on the design of the bug, the performance and the weight of the tower: the lighter the tower and the earlier the bugs are killed, the higher score each team can get. See the third figure.

Constrains

→The racetrack (Provided in the game)

Black in general with a 4cm wide white line in the middle

White stop lines across the track both 1m and 0m from the bottom of the tower

Protection area 2.5m to 2m from the bottom (with shelter)

→The bug

Hardware:

∙ Bottom board made of PMMC

∙ A 15cm*10cm front board required

∙ A light sensor placed horizontally 5cm above the track in the front

Programming:

∙ Tracking function included

∙ Speed controlled at 0.2 to 0.3 m/s

∙ Moving in a straight line

∙ A 2 to 4 seconds stop at the middle stop line and can’t be killed at that moment

∙ A permanent stop at the white line next to the tower

→The paper tower

∙ Constructed with A4 paper

∙ Holding its weight on paper structure only

∙ At least 60 cm high

∙ Permitted to be stuck with only white glue

∙ No thicker than 3 pieces of paper anywhere in the tower

∙ Including only 1 laser beam on the top.

Material list

1.The bug:

Arduino UNO ¥ 33.00*2

Motor driving board L298N ¥ 8.40

Motor GA12-N20 ¥ 14.90

Motor Brackets 3PI miniQ N20 ¥ 2.50

Coupler M3 ¥ 2.90

Battery Box 9V 6F22 ¥ 6.88

Batteries 9V ¥ 9.90

Chassis 15*20cm ¥ 28.00

Caster 27mm ¥ 2.00

Line Tracking Sensor SEN0017 ¥ 22.00

Light Sensor BH1750 ¥ 6.14

Nylon Screws M3 ¥ 12.00

Screws M2*8 M2*10 M2*12 M3*8 Provided by the lab

Dupont Wires Provided by the lab

Breadboard 5cm*8cm Provided by the lab

Wheel 72mm Provided by the lab

2.The tower:

Cloud Terrace +Servo SG90 ¥21.9

360 degree Servo DS04-NFC ¥33

Ultrasonic Sensor SR04 ¥3.6*4

Tracking Sensor DFRobot ¥22

Video

Due to the terrible light condition on game day, we cannot provide a video of the game. Instead, we have posted a video of bug test on Youku.
The hyperlink is http://v.youku.com/v_show/id_XMTc3NjczNjg1Ng==.ht...

Step 1: Instruction Part I: Making the Bug

The exploded view is shown in figure 1.

Step 1: Draw a Circuit Diagram (as is shown in figure 2).

Step 2: Assemble the Motors and Wheels (as is shown in figure 3).

(1) Fix the motors with motor brackets, M2.5(*4) nuts and screws.

(2) Connect the wheels and motors with couplers. Use M2(*4) screws to fix them.

(3) Fix the universal wheel at the rear of our bug with M3(*4) screw and nuts.

Step 3: Make the Vertical Board(as is shown in figure 4).

(1) Cut a piece of crimp paper into the size of 12cm*15cm.

(2) Cut two corners and insert the paper board into the gap of the bug. (Diagram will be provided)

(3) Stick the vertical board to the bug with 502.

Step 4: Assemble the Sensors(as is shown in figure 5).

(1) Draw a line 5cm above the ground on the front board.

(2) Place the light sensor horizontally so that the light sensor plate matches the line drawn.

(3) Fix the light sensor with scotch tape.

(4) Use three M3*30 nylon columns to fix three tracking sensors so that the distance between the sensor and the ground is approximately 1.3cm, the best distance for precise detection.

Step 5: Integrated assembly

(1) Fix the battery box and motor driving board on the bug, at least 5*M3 screws and nuts are required. Fix the universal wheel at the back (as is shown in figure 6).

(2) Stick the breadboard under the bug board and Arduino board on the bug. (As shown in figure 7).

(3) Connect the related parts with Dupont Lines. (See Instructions in the circuit diagram part)

(4) Use a welding gun and a soldering station to weld all the places that are loose. (Caution! Hot! Do it under supervision! Not mandatory.)

Step 2: Instruction Part II: Making the Tower

The exploded view is shown in figure 1 and 2.

Step 1: Building the Base

(1) Fold a piece of A4 paper so that the two shorter sides touch.(As shown in figure 3).

(2) Open the folded paper. Further fold the paper from the inner side of 1) and make sure that the two touched sides in 1) now coincide at the middle line.(As shown in figure 4 and 5)

(3) Equably paste side A with white glue and stick it with the back side of side B (Not much white glue required) so that we can get a regular triangular prism.(As shown in figure 6 and 7)

(4) Repeat 1) to 3) 5 times to get 6 same prisms.

(5) Equably paste the 2 single layers of each prism with white glue. Stick the prisms together so that we get a regular hexagon prism. (As shown in figure 8)

Step 2: Make the Connection Part (As shown in figure 9)

(1) Prepare a piece of paper.

(2) Draw a regular hexagon whose length of side is 7.5 cm.

(3) Make a rectangular (2cm*7.5cm) next to each side of the regular hexagon

Step 3: Build the Upper Part of the Tower

(1) Fold a piece of A4 paper so that the two longer sides touch. (Refer to figure 5 but note the difference)

(2) Repeat (2) to (5) in Step 1.

(3) Make 12 pieces of 50mm*50mm paper.

(4) Fold the paper mentioned in Step3, 3) in half.

(5) Attach white glue to one of the inner sides mentioned in Step3, 4). (As shown in figure 9)

(6) Attach the pasted side to an outer side of the prism. The central line of the smaller one should coincide with the upper edge of the prism. (As shown in figure 10) Then do the same for the other 5 edges.

(7) Similarly, attach more pieces of small paper to the tower. However, this time they should be sticked inside. (As shown in figure 11) Then do the same for the other 5 edges inside.

(8) Cut all the parts that come out of the prism edge. (As shown in 12)

(9) Stick all small pieces of paper (if possible) to stabilize the structure. (As shown in figure 13)

(10) Repeat Step3 6) to 9) at the other end of the structure. Stick it to the connection part.

Step 4 Build the second connection part

(1) Draw 48 parallel lines, paralleling to the short side of A4 paper. Every two neighboring lines should have a distance of 5(mm).

(2) Fold the paper along the lines. Dash line means you should fold the paper towards you, and full line means you should fold the paper back to you. The cutaway view of the product will look like Figure 14.

(3) Use white glue to stick a piece of paper at the top of the corrugated paper.Stick another paper at the bottom.(Figure 15)

(4) Cut the corrugated paper into 12(cm)*15(cm)

Step 5 Build the top of the paper tower (the servo, power, laser and Arduino part)

(1) Assemble the cloud terrace with a SG90 servo and laser beam attached. Use 502 if necessary.

(2) Attach the tracking sensor on the cloud terrace. It should be strictly in a vertical plane with the laser beam. (As shown in figure 16)

(3) Draw 2 vertical black cross lines on a card board with white paper on it. The line should be 0.5cm wide. Then make a whole (radius=0.6cm) in the middle.

(4) Stick the other side of the board on the servo below. Put the cloud terrace on it. (See figure 17)

(5) Install Arduino, breadboard and batteries on the top of the tower and the ultrasonic sensors on the tower. (As shown in figure 18)

Step 3: The Final Outcome of Bug and Tower

See the figures above.

Step 4: Problem Shooting

1 We chose a modularized infrared sensor at first. It could only track a 2cm-wide white line, but the tournament provided 4cm-wide white lines for tracking.

Solution: Use at least 3 independent infrared sensors. You can adjust the distance between each two of them, so that the car can track lines with any widths.

2 The 360-degree servo was hard to control its rotation angle. We could only control its direction and speed of rotation.

Solution: Stick an infrared sensor on the cloud terrace. Draw a cross of black lines on a paper. Stick the paper on the top of the 360-degree servo (below the cloud terrace). When the sensor detects a black line, the 360-degree servo should stop at once so that it can rotate exactly 90 degree in a rotation.

3 Many objects should be placed at the top of the paper tower, but there is not so much space.

Solution: Fold a corrugated board. It provides extra load bearing space.

Step 5: References