Project 08:Large Crane

8-1

1. Overview

Crane is a machine that integrates loading, transportation and unloading, which is widely used in ports, workshops, electric power as well as construction sites. In this project, we will seek to make a large crane.

2. Components

Img

Img

Img

Kidsuno Mainboard×1

IR Receiver×1

IR Remote Control×1

Img

Img

Img

360°Servo×1

270°Servo×1

Connection Wire×1

Img

Img

Img

USB Cable×1

Lego Series×1

Wire×1

Img

3. Installation

Preparation:

Img

Step1:

Img

Step2:

Img

Step3:

Img

Step4:

Img

Step5:

Img

Step6:

Img

Step7:

Img

Step8:

Img

Step9:

Img

Step10:

Img

Step11:

Img

Step12:

Img

Step13:

Img

Step14:

Img

Step15:

Img

Step16:

Img

Step17:

Img

Step18:

Img

Step19:

Img

Step20:

Img

Step21:

Img

Step22:

Img

Step23:

Img

Step24:

Img

Step25:

Img

Step26:

Img

Step27:

Img

Step28:

Img

Step29:

Img

Step30:

Img

Step31:

Img

Step32:

Img

Step33:

Img

Step34:

Img

Step35:

Img

Step36:

Img

Step37:

Img

Step38:

Img

Complete:

Img

4. Read the Button Value of IR Remote Control

Img

5. Programming Steps

Step1:Wiring Diagram

Connect the kidsuno mainboard and computer via a USB cable, connect the IR receiver module to the No. 2 interface of the mainboard. Then connect the 270° servo to the G, V and D12 interface, the brown wire is connected to G, the red wire is connected to V and the orange wire is connected to D12, the 360° servo to the G, V and D13 interface of the mainboard(brown wire: G, red wire: V , orange wire: D13).

Img

Step2:Add the IR Receiver

Tap the “Communication” module in the “Extension” , then select ” IR Receiver ” and click Imgto return to the programming interface.

Img

Diagram of the Extension Instruction Block.

Img

Add “IR Receiver”.

Img

Step2: Description of Building Blocks

Img

This block is used to initiate IR receiver to the specified pin.

Img

This block is used to receive data from the IR remote control.

Img

This block is used to read received IR data.

Img

This block is used to refresh the IR received data and receive the next value.

Step3:Write the Program

① Drag the instruction block Imgin the Events module to the script area.

Img

② Drag the instruction block Imgin the Serial module to the script area and take the baud rate 9600 as an example.

Img

③ Drag the instruction blockImgin the IR Remote module to the script area, since the IR receiver module is connected to the D6 pin of the No. 2 interface on the mainboard, then change the number 2 to 6.

Img

④ Drag the instruction block Imgin the Control module to the script area.

Img

⑤ Drag the instruction block Imgin the Control module to the script area.

Img

⑥ Drag the instruction blockImgin the IR Remote module to the script area and place it intoImg .

Img

⑦ Drag the instruction blockImg in the Serial module to the script area, then change “warp” to “HEX”.

Img

⑧ Drag the instruction blockImgin the IR Remote module to the script area and place it intoImg.

Img

⑨ Drag the instruction blockImgin the IR Remote module to the script area.

Img

⑩ Drag the instruction block Imgin the Control module to the script area and change the number 1 to 0.05.

Img

⑪ Complete Program

Img

Step3:Test Result

ClickImgto upload the complete program to the kidsuno mainboard and power up, pull out the transparent sheet at the bottom of the IR remote control, then pull out the button slot, and then put in the battery(“+”pole is downward )and insert into the slot.

 Battery type:CR2025(provided by yourself).

Img

Then click Img in the serial monitor area to set the baud rate to 9600. Point the IR remote control to the IR receiver module, press a button on the IR remote control, and you will see a coded value in the serial monitor. Press the same key multiple times to make sure the value is correct. If you see “FFFFFFFF”, ignore it.

Img

Img

6. IR Remote Controls Large Crane

Img

7. Programming Steps

Step1: Flow Chart

Setting

set 360° servo to 90°,270° servo rotates from 0° to180°(object raises)and OLED displays “Img”pattern

Img

Value:FF22DD

State

Crane turns left and OLED displays “←” pattern

Img

Value:FFC23D

State

Crane turns right and OLED displays “→” pattern

Img

Value:FF629D

State

Object raises and OLED displays“↑” pattern

Img

Value:FFA8573

State

Object lowers and OLED displays “↓” pattern

Img

Step3:Add Servo

Img

Step4:Write the Program

① Find building blocks

(1)Img

(2)Img

(3)Img

(4)Img

(5)Img

(6)Img

(7)Img

(8)Img

(8)Img

② Complete Program

Img

Step5:Test Result

ClickImgto upload the complete program to the kidsuno mainboard and power up, the object raises and OLED displays“Img” pattern. Press Img, crane turns left and OLED displays “←” pattern, press Img, crane turns right and OLED displays “→” pattern, press Img, object raises and OLED displays“↑” pattern, press Img, object lowers and OLED displays “↓” pattern.

8-7