OSOYOO Building Block DIY
Programming Kit for Arduino

On-line Tutorial Link: https://osoyoo.com/?p=44354
Video Link: http://osoyoo.com/2021011600.html

https://osoyoo.com/?p=44354

Table of Contents
Ⅰ: Preparation before Class............................................................................. 3
1: Graphical programming – mBlock ......................................................... 3
2: Install OSOYOO Basic board and 9V battery case Block .................... 10
3: OSOYOO basic board for Arduino UNO .............................................. 14
4: OSOYOO Magic I/O Shield for Arduino ............................................... 23
Ⅱ:Tutorials .................................................................................................... 26
Lesson 1: Smart Gate.............................................................................. 26
Objective ................................................................................................. 26
Parts and devices ................................................................................... 26
How to build............................................................................................ 27
Circuit connection ................................................................................... 33
How to code ........................................................................................... 33
How to play............................................................................................. 40
Lesson 2: Elevator ................................................................................... 41
Objective ................................................................................................ 41
Parts and devices ................................................................................... 41
How to build............................................................................................ 42
Circuit connection .................................................................................47
How to code ........................................................................................... 47
How to play ............................................................................................ 54
Lesson 3: Oscillating Pedestal Fan ......................................................... 55
Objective ............................................................................................... 55
Parts and devices ................................................................................... 55
How to build............................................................................................ 561https://osoyoo.com/?p=44354

Circuit connection .............................................................................. 63
How to code ...................................................................................... 63
How to play........................................................................................ 70
Lesson 4: Spinning Ball ........................................................................... 71
Objective ........................................................................................... 71
Parts and devices .............................................................................. 71
How to build....................................................................................... 72
Circuit connection ............................................................................103
How to code ....................................................................................103
How to play......................................................................................109
Lesson 5: Tower crane...........................................................................110
Objective .........................................................................................110
Parts and devices ............................................................................110
How to build.....................................................................................111
Circuit connection ............................................................................136
How to code ....................................................................................136
How to play......................................................................................150
Lesson 6: Robot Crab............................................................................151
Objective .........................................................................................151
Parts and devices ............................................................................151
How to build.....................................................................................152
Circuit connection ............................................................................166
How to code ....................................................................................166
How to play......................................................................................1782https://osoyoo.com/?p=44354

Ⅰ: Preparation before Class
1: Graphical programming – mBlock
mBlock is designed for the Science, Technology, Engineering, Arts andMathematics (STEAM) education. Inspired by Scratch 3.0, it supports bothgraphical and textual programming languages.

Software versions
Currently, the following versions are available:
For PCs (software required): https://www.mblock.cc/en-us/download
Web version (no software required): https://ide.mblock.cc/
For Android and iOS: Search for mBlock on any app store to download it
By signing in to mBlock 5, you can have your projects automatically stored in
the cloud. Try synchronizing your projects across devices (such as PCs andmobile devices) now!

Get to Know the UIToolbar
Toolbar

1. Language: Click it to change the UI language.
2. File: Click it to create, open, save a project, import a project from yourPC, or export your project to PC.
3. Edit: Click it to turn on/off the stage turbo mode or hide/unhide the stage.
4. Title: Click it to set or change the title of the current project.
5. Save: Click it to save the current project to My Projects.
6. Publish: Cick it to publish the current project to the mBlock community.
7. Courses:
Click
it
to
visit
the
website:https://education.makeblock.com/resource/.

3https://osoyoo.com/?p=44354

8. Tutorials: Click it to view online user guide and example programs.
9. Feedback: Click it to give your feedback for mblock.
10. More: Click it to see more functions about Check For Updates, About
mBlock, About version 5.4.0, Serial driver quick install, Set as default
editor, Cooperation
11. Sign up/Sign in: Click it to sign up an mBlock account or sign in. Aftersigning in to mBlock 5, you can click it to view your projects, profile,account center, and cloud service authentication code, or click to signout.
12. Python Editor: Click it to enter mBlock-Python Editor.
Editing area：Stage area: You can present your designs, connect devices, and set
your sprites and backdrops here.
Blocks area: You can find the blocks you need by category and color
here.

4

https://osoyoo.com/?p=44354

Scripts area: You can compile your program by dragging blocks to thisarea.

When you drag a block in Scripts area, and right click on the block, you will
can do these operation for the block as the above picture.

When you drag a block in Scripts area, and right click on blank, you will cando these operation for the block as the above picture.
Connect OSOYOO basic board
Step 1) Download OSOYOO_UNO.mext device file fromhttps://osoyoo.com/driver/mblock/osoyoo_uno.mext
Step 2) Run the mBlock PC software by double click the lovely Panda icon.
You will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

5https://osoyoo.com/?p=44354

Step 3) Drag and Drop osoyoo_uno_mext file (downloaded in Step 1) tomBlock software as following:6https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Upload program to OSOYOO Basic board
1) You need connect your Arduino board to your PC with a USB cable first.
Then click the Connect button in the bottom of the mBlock software, you will
see a USB window pop up,2) select Show all connectable device check box , then a device drop-downmenu will show up,3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino

7https://osoyoo.com/?p=44354

5)After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to8https://osoyoo.com/?p=44354

Arduino UNO board:

For more information, please click user guide to learn more or visit the link:
https://www.yuque.com/makeblock-help-center-en/mblock-5

9https://osoyoo.com/?p=44354

2: Install OSOYOO Basic board and 9V battery caseBlock
To make the OSOYOO basic board and 9V battery case build blocks easily,
we design two Acrylic plate for these two parts. Before you build otherprojects, please follow this class to complete OSOYOO Basic board Blockand 9V battery case Block.

Please install OSOYOO basic board on blocks as the following steps:10https://osoyoo.com/?p=44354

You can also follow this video to install board on block:https://youtu.be/KaGaRDugRE411

https://osoyoo.com/?p=44354

Please install OSOYOO basic board on blocks as the following steps:

12https://osoyoo.com/?p=44354

You can also follow this video to install board on block:https://youtu.be/0BLrQoU1ckI

13

https://osoyoo.com/?p=44354

3: OSOYOO basic board for Arduino UNO"The UNO is the best board to get started with electronics and coding. If this is
your first experience tinkering with the platform, the UNO is the most robust
board you can start playing with. The UNO is the most used and documented
board of the whole Arduino family." ---------------- www.Arduino.cc

Overview
The Osoyoo UNO Board is fully compatible with Arduino UNO rev.3, it is a
microcontroller board based on the ATmega328P (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a
reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC
adapter or battery to get started.. You can tinker with your UNO without worring
too much about doing something wrong, worst case scenario you can replace
the chip for a few dollars and start over again.
"Uno" means one in Italian and was chosen to mark the release of Arduino
Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE)
were the reference versions of Arduino, now evolved to newer releases. The14

https://osoyoo.com/?p=44354

Uno board is the first in a series of USB Arduino boards, and the reference
model for the Arduino platform; for an extensive list of current, past or outdated
boards see the Arduino index of boards.
Note:This is an Arduino Compatible board. It is NOT an original Arduino board, but
is similar. None of the Arduino Uno R3 boards sold on the internet at this priceare original, they are all copies. This is perfectly legal, seeing that the whole
Arduino ecosystem is open source! Please note this board is manufactured by
Osoyoo! We do have control of the brand and quality of components used! We
have also carefully selected suppliers that consistently supply quality products.
We strictly control the quality of the products before leaving the factory. The
excellent after-sales service and professional technical support will ensure you
have a good time with Osoyoo UNO Board

Specifications of Osoyoo UNOMicrocontroller: ATmega328P-PU

15

https://osoyoo.com/?p=44354













Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6
DC Current per I/O Pin: 40 mA
DC Current for 3.3V Pin: 50 mA
Flash Memory: 32 KB of which 0.5 KB used by bootloader
SRAM: 2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
Clock Speed: 16 MHz

Pinout of Osoyoo UNO

Schematics

16https://osoyoo.com/?p=44354

Arduino Uno is open-source hardware! You can build your own board using
the following files from the Arduino official site:

Arduino_Uno_Rev3 Eagle files
Arduino_Uno_Rev3 schematic PDF file
Arduino_Uno_Rev3 DXF file

Documentations
Programming
The Arduino Uno can be programmed with the (Arduino Software (IDE)).
Select "Arduino/Genuino Uno from the Tools > Board menu (according to themicrocontroller on your board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preprogrammed with abootloader that allows you to upload new code to it without the use of an
external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller throughthe ICSP (In-Circuit Serial Programming) header using Arduino ISP or similar;
see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source codeis available in the Arduino repository. The ATmega16U2/8U2 is loaded with a
DFU bootloader, which can be activated by:

On Rev1 boards: connecting the solder jumper on the back of the board(near the map of Italy) and then rese ing the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2
HWB line to ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer(Mac OS X and Linux) to load a new firmware. Or you can use the ISP header
with an external programmer (overwriting the DFU bootloader). See this usercontributed tutorial for more information.
Warnings

17https://osoyoo.com/?p=44354

The Arduino Uno has a resettable polyfuse that protects your computer's USB
ports from shorts and overcurrent. Although most computers provide their own
internal protection, the fuse provides an extra layer of protection. If more than
500 mA is applied to the USB port, the fuse will automatically break theconnection until the short or overload is removed.
Differences with other boards
The Uno differs from all preceding boards in that it does not use the FTDI
USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2
up to version R2) programmed as a USB-to-serial converter.
Power
The Arduino Uno board can be powered via the USB connection or with an
external power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wallwart) or battery. The adapter can be connected by plugging a 2.1mm centerpositive plug into the board's power jack. Leads from a battery can be inserted
in the GND and Vin pin headers of the POWER connector.
The board can operate on an external supply from 6 to 20 volts. If suppliedwith less than 7V, however, the 5V pin may supply less than five volts and theboard may become unstable. If using more than 12V, the voltage regulator
may overheat and damage the board. The recommended range is 7 to 12
volts.
The power pins are as follows:Vin. The input voltage to the Arduino/Genuino board when it's using an
external power source (as opposed to 5 volts from the USB connection
or other regulated power source). You can supply voltage through thispin, or, if supplying voltage via the power jack, access it through this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The
board can be supplied with power either from the DC power jack (7 12V), the USB connector (5V), or the VIN pin of the board (7-12V).
Supplying voltage via the 5V or 3.3V pins bypasses the regulator, andcan damage your board. We don't advise it.

18

https://osoyoo.com/?p=44354




3V3. A 3.3 volt supply generated by the on-board regulator. Maximum
current draw is 50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino/Genuino board provides the voltage
reference with which the microcontroller operates. A properly configured
shield can read the IOREF pin voltage and select the appropriate powersource or enable voltage translators on the outputs to work with the 5V
or 3.3V.

MemoryThe ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also
has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with
the EEPROM library).
Input and Output
See the mapping between Arduino pins and ATmega328P ports. The
mapping for the Atmega8, 168, and 328 is identical.
PIN MAPPING ATmega328P
Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(),digitalWrite(), and digitalRead() functions. They operate at 5
volts. Each pin can provide or receive 20 mA as recommended operating
condition and has an internal pull-up resistor (disconnected by default) of 2050k ohm. A maximum of 40mA is the value that must not be exceeded on any
I/O pin to avoid permanent damage to the microcontroller.
In addition, some pins have specialized functions:Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of theATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger aninterrupt on a low value, a rising or falling edge, or a change in value.
See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with theanalogWrite() function.

19https://osoyoo.com/?p=44354



SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication
using the Wire library.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide
10 bits of resolution (i.e. 1024 different values). By default they measure fromground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analogReference() function. There are a coupleof other pins on the board:

AREF. Reference voltage for the analog inputs. Used withanalogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.

Communication
Arduino/Genuino Uno has a number of facilities for communicating with acomputer, another Arduino/Genuino board, or other microcontrollers. The
ATmega328 provides UART TTL (5V) serial communication, which isavailable on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board
channels this serial communication over USB and appears as a virtual com
port to software on the computer. The 16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a .inf
file is required. The Arduino Software (IDE) includes a serial monitor whichallows simple textual data to be sent to and from the board. The RX and TX
LEDs on the board will flash when data is being transmitted via the USB-toserial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
A SoftwareSerial library allows serial communication on any of the Uno's
digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The
Arduino Software (IDE) includes a Wire library to simplify use of the I2C bus;20

https://osoyoo.com/?p=44354

see the documentation for details. For SPI communication, use the SPI
library.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload,
the Arduino/Genuino Uno board is designed in a way that allows it to be resetby software running on a connected computer. One of the hardware flow
control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of
the ATmega328 via a 100 nanofarad capacitor. When this line is asserted(taken low), the reset line drops long enough to reset the chip. The Arduino
Software (IDE) uses this capability to allow you to upload code by simply
pressing the upload button in the interface toolbar. This means that thebootloader can have a shorter timeout, as the lowering of DTR can be wellcoordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either acomputer running Mac OS X or Linux, it resets each time a connection ismade to it from software (via USB). For the following half-second or so, thebootloader is running on the Uno. While it is programmed to ignore malformed
data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it
first starts, make sure that the software with which it communicates waits asecond after opening the connection and before sending this data.
The Uno board contains a trace that can be cut to disable the auto-reset. The
pads on either side of the trace can be soldered together to re-enable it. It'slabeled "RESET-EN". You may also be able to disable the auto-reset byconnecting a 110 ohm resistor from 5V to the reset line; see this forum threadfor details.
Revisions
Revision 3 of the board has the following new features:

1.0 pinout: added SDA and SCL pins that are near to the AREF pin andtwo other new pins placed near to the RESET pin, the IOREF that allow
the shields to adapt to the voltage provided from the board. In future,shields will be compatible with both the board that uses the AVR, which21https://osoyoo.com/?p=44354



operates with 5V and with the Arduino Due that operates with 3.3V. The
second one is a not connected pin that is reserved for future purposes.
Stronger RESET circuit.
Atmega 16U2 replace the 8U2.

The Osoyoo UNO Board is 100% Software and Hardware compatible with
Arduino UNO Board, you can get more info from www.arduino.cc. Thanks fortheir efforts, it’s easier for us to learn Arduino！

22https://osoyoo.com/?p=44354

4: OSOYOO Magic I/O Shield for Arduino
Arduino Uno is the most popular Arduino board, however it is often frustratingwhen your UNO board needs connect many sensors and actuators withjumper wires. In worst cases, wrong connection of wires can burn Arduino
board, cause circuit short-cut fire and make your project become a nightmare.
The purpose of creating the OSOYOO Magic I/O Shield for Arduino is to help
people, especially beginners to make wire connection simple, convenient andsafe.
With the rich Plug and Play (PnP) connectors on the base board, you canconnect standardized OSOYOO sensor/actuator modules with the Arduino
Uno through this shield conveniently!

This OSOYOO Magic I/O Shield fits standard Arduino UNO compatible board.
It is a connection bridge between the electronic block module and UNO board.
It is has a build-in motor driver similar to L293/L298, which can provide
adjustable power to inductive loads such as relays, solenoids, DC and23https://osoyoo.com/?p=44354

stepping motors. It can drive two channels of DC motors with your Arduino
board, controlling the speed and direction of each one independently.
It extends SPI port, UART, I2C, PWM and analog INPUT pins for Arduino
board, so DIY enthusiasts, interactive designers can quickly attach themodules to the board for Arduino and accelerate project development
progress. An intelligent power regulator allows you to connect a battery andUSB cable simultaneously, and an on-board voltage switch makes it easy tochange the output voltage, making 3.3V or 5V sensors compatible. With theplug-and-play interfaces, this board simplifies all your needs for anautonomous robot such as line tracer, obstacle avoidance, maze solver etc.,
The shield can be interfaced with 2 motors, 12 digital sensors, 6 analog
sensors, a line array sensor and an ultrasonic sensor (4 pin and 3 pin).

- Compatible for Arduino UNO R3, Leonardo R3, Mega2560 R3- All sockets onboard are XH 2.54mm pitch.
- Motor socket number: 4- I2C socket number: 1- RGB socket number: 1- 4PIN socket number: 4- Power socket number: 1(DC 5V~12V)- Software Uart interface number: 1- Hardware Uart interface number: 1- Analog input socket number: 4(A0, A1, A2, A3)- Digital pin socket number：12（D2~D13）- Motor Driver socket: for OPEN-SMART car chassis- Colorful socket: 5 pins is red, 6 pins is blue, 20 pins is white.
- L LED for D13 pin-3.3V/5V Operating Voltage Switch- On-board reset button, power indicator led.

24

https://osoyoo.com/?p=44354

Easy to plug OPEN-SMART products with XH socket to this shield and do notneed to pay attention to the connection. So it is great for Training institutionsand visual programming education.

Dimensions

84mm x62mm x20mm

WeightG.W 32g25

https://osoyoo.com/?p=44354

Ⅱ: Tutorials
Lesson 1: Smart Gate
In this lesson, we use OSOYOO mini bricks to make a smart garage gate. When
Ultrasonic detect a car, the gate will open automatically.

26

https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

Please visit this link to watch video about Building Blocks:
https://youtu.be/xOFasFBVLA0

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson1/lesson1.pdf)
Note: The color of the building block is subject to the actual product, which
does not affect the use.

27https://osoyoo.com/?p=44354

28https://osoyoo.com/?p=44354

29https://osoyoo.com/?p=44354

30https://osoyoo.com/?p=44354

24

31https://osoyoo.com/?p=44354

25

M3 plastic screws x4

M3 plastic pillars x4

M3 plastic nuts x4

26

27

back

front

32

https://osoyoo.com/?p=44354

Connect ultrasonic sensor to D7D8 slot with 4pin PnP cable, Servo to D9 port
as per following picture:

Note: In this kit, we use mblock as programming tool, if you want to learn
more about mblock, please visit preparation before class 1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) Download mBlock PC from https://mblock.makeblock.com/enus/download/, select the download file as per your computer OS type:

Step 2) Download OSOYOO_UNO.mext device file fromhttps://osoyoo.com/driver/mblock/osoyoo_uno.mext33

https://osoyoo.com/?p=44354

Step 3) Run the mBlock PC software by double click the lovely Panda icon.
you will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

Step 4) Drag and Drop osoyoo_uno_mext file(downloaded in Step 2) to mBlock
software as following:

Now you will see a new device firmware in mBlock, see following picture:34

https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:
Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Now we will show you how to use blocks to turn above idea into reality.
Step 1: Click Control, then Drag and drop Forever block to programmingarea as following:35https://osoyoo.com/?p=44354

Step 2: Click Events,

add when Arduino Uno starts up block to the top:

Step 3: Click Control, add if then block inside forever block:36https://osoyoo.com/?p=44354

Step 4: Click Operator category, then add < 50 block into if else block
condition area, change the value from 50 to 15 as following:

Step 5: Click Sensor category, add read ultrasonic sensor block into <15
block, change trig pin to 7 , echo pin to 8 as following:37https://osoyoo.com/?p=44354

Step 5: Click Action category, add two pcs set servo pin blocks into if else
block, change angle as value to 20 and 90 as following:

Now we have completed the block programming. The final blocks look likefollowing:Upload the program to Arduino
1) you need click the Connect button in the bottom of the mBlock software,
you will see a USB window pop up,2) select Show all connectable device check box , then a device drop-38https://osoyoo.com/?p=44354

down menu will show up,3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino5) After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to
Arduino UNO board:39https://osoyoo.com/?p=44354

When your car arrives the gate front and is detected by ultrasonic sensor, thegate will open. When the car passes the gate, the gate will close
automatically.

https://osoyoo.com/picture/Block_kit/lesson1/1-5.mp4

40

https://osoyoo.com/?p=44354

Lesson 2: Elevator
The OSOYOO building bricks is mechanically compatible with leading building
bricks. In this lesson, we will use OSOYOO Bricks to build an elevator anduse OSOYOO electronic sensor module blocks to control it. When you press
the push button, the elevator will be up; and when release, the elevator will bedown.

Please prepare the following parts to complete this project:41

https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

Please visit this link to watch the video about Building Blocks:
https://youtu.be/J5FtYgJiEKs

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson2/lesson2.pdf)
Note：the color of the building block is subject to the actual product, which
does not affect the use.

42

https://osoyoo.com/?p=44354

43https://osoyoo.com/?p=44354

44https://osoyoo.com/?p=44354

45https://osoyoo.com/?p=44354

1x

21

46

https://osoyoo.com/?p=44354

Connect push button to D2 port with 3pin PnP cable, Servo to D9 port as perfollowing picture:

Note: In this kit, we use mblock as programming tool, if you want to learn moreabout
mblock,pleasevisit
preparation
beforeclass
1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) Download mBlock PC from https://mblock.makeblock.com/enus/download/, select the download file as per your computer OS type:

Step 3) Run the mBlock PC software by double click the lovely Panda icon.
You will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

47https://osoyoo.com/?p=44354

Step 4) Drag and Drop osoyoo_uno_mext file (downloaded in Step 2) tomBlock software as following:48

https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Now we will show you how to use blocks to make our Oscillating Pedestal Fan
into reality.
Step 1: Click Control, then Drag and drop Forever block to programming

49https://osoyoo.com/?p=44354

area as following:

Step 2: Click Events, add when Arduino Uno starts up block to the top:

Step 3: Click Control, drag if else block to forever loop,50

https://osoyoo.com/?p=44354

Step 4: Click Sensor, Add Button Pressed block to if condition area, change
Pin number to 2:

Step 5) Click Action, then drag set Servo Pin block to if else block as following:51

https://osoyoo.com/?p=44354

Now all the programming blocks have been completed! From above picture, thelogic is pretty straight forward:
When Arduino is started, computer will enter a dead loop which will check the
button status, when button is not pressed, the servo will stop at original position(in my servo 0 degree) and elevator is in the ground, when button is pressed,
the servo arm will rotate from 0 degree position to 180 degree position and theelevator is lifted to the air.
Step 6) Upload the program to Arduino
1) Please connect your Arduino board to your PC with USB cable firstly. Thenclick the Connect button in the bottom of the mBlock software, you will see a
USB window pop up,2) select Show all connectable device check box , then a device drop-downmenu will show up,3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino52https://osoyoo.com/?p=44354

5) After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to UNO
board:

53https://osoyoo.com/?p=44354

Now power UNO board via USB cable, the Arduino will start to work andelevator is in the ground. Press the button on D2, your elevator will be lifted,
when you release the the button, the elevator will go back to the ground.

https://osoyoo.com/picture/Block_kit/lesson2/4.mp4

54https://osoyoo.com/?p=44354

Lesson 3: Oscillating Pedestal Fan
The OSOYOO building bricks is mechanically compatible with leading building
bricks. In this lesson, we will use OSOYOO Bricks to build an Oscillating
Pedestal Fan.

Please prepare the following parts to complete this project.

55https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

Please visit this link to watch video about Building Blocks:
https://youtu.be/kxr5pzBB_G8

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson3/lesson3.pdf)
Note：the color of the building block is subject to the actual product, which does
not affect the use.

56https://osoyoo.com/?p=44354

57https://osoyoo.com/?p=44354

58https://osoyoo.com/?p=44354

59https://osoyoo.com/?p=44354

60https://osoyoo.com/?p=44354

29

30

61

https://osoyoo.com/?p=44354

31

33
35

32

1×

34
36

2×

=

35
37

62

https://osoyoo.com/?p=44354

Connect wires as per following picture:
1. Motor(red) to L1 or L2
2. Push Button to D2 port
3. Servo(grey) to D9 port
4. IN1 to D12
5. IN2 to D11
6. ENA to D5

Note: In this kit, we use mblock as programming tool, if you want to learn
more about mblock, please visit preparation before class 1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) Download mBlock PC from https://mblock.makeblock.com/enus/download/, select the download file as per your computer OS type:63https://osoyoo.com/?p=44354

Step 2) Download OSOYOO_UNO.mext device file fromhttps://osoyoo.com/driver/mblock/osoyoo_uno.mext
Step 3) Run the mBlock PC software by double click the lovely Panda icon.
you will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

Step 4) Drag and Drop osoyoo_uno_mext file(downloaded in Step 2) tomBlock software as following:64https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Now we will show you how to use blocks to make our Oscillating Pedestal Fan
into reality.

65https://osoyoo.com/?p=44354

Step 1: Click Control, then Drag and drop Forever block to programming area
as following:

Step 2: Click Events, add when Arduino Uno starts up block to the top:66

https://osoyoo.com/?p=44354

Step 3: Click Control, drag if else block to forever loop,

Step 4: Click Sensor, Add Button Pressed blocks to if condition area,change Pin number to 2:

Step 5: Click Action , then drag Move Left Right Speed block, set Servo
Pin blocks, and Stop Moving blocks as following:67https://osoyoo.com/?p=44354

Step 6: Click Control, then add 6 pcs wait block under each set servo pin
block, change wait time to 0.2 seconds

68https://osoyoo.com/?p=44354

Now all the programming blocks have been completed! From above picture, thelogic is pretty straightforward:
When Arduino is started, computer will enter a dead loop which will check the
button status, when button is pressed, the Fan will rotate at speed 150, at thesame time servo will oscillate from 60 degree position to 140 degree position.
Each location will stop 0.2 seconds.
When you release the button, the servo and fan will stop after a short time.
Step 7: Upload the program to Arduino
1) you need connect your Arduino board to your PC with a USB cable first.
Then click the Connect button in the bottom of the mBlock software, you will
see a USB window pop up,2) select Show all connectable device check box , then a device drop-downmenu will show up,3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino5)After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to
Arduino UNO board:69https://osoyoo.com/?p=44354

Now turn on the power switch in the Magic board, the Arduino will start towork. Press the button on D2, your fan begins to rotate and servo start tooscillate. When you release the button, fan and servo will stop moving.

https://osoyoo.com/picture/Block_kit/lesson3/4.mp470https://osoyoo.com/?p=44354

Lesson 4: Spinning Ball
In this lesson, we use OSOYOO mini bricks to make a Spinning Ball Toy.

Please prepare the following parts to complete this project.

71https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

Please visit this link to watch video about Building Blocks:
https://youtu.be/PoTajLijLBg

72

https://osoyoo.com/?p=44354

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson4/lesson4.pdf )Note：the color of the building block is subject to the actual product, which
does not affect the use.

73

https://osoyoo.com/?p=44354

74https://osoyoo.com/?p=44354

75https://osoyoo.com/?p=44354

76https://osoyoo.com/?p=44354

77https://osoyoo.com/?p=44354

78https://osoyoo.com/?p=44354

79https://osoyoo.com/?p=44354

80https://osoyoo.com/?p=44354

81https://osoyoo.com/?p=44354

82https://osoyoo.com/?p=44354

83https://osoyoo.com/?p=44354

84https://osoyoo.com/?p=44354

85https://osoyoo.com/?p=44354

86https://osoyoo.com/?p=44354

87https://osoyoo.com/?p=44354

88https://osoyoo.com/?p=44354

89https://osoyoo.com/?p=44354

90https://osoyoo.com/?p=44354

91https://osoyoo.com/?p=44354

92https://osoyoo.com/?p=44354

93https://osoyoo.com/?p=44354

94https://osoyoo.com/?p=44354

95https://osoyoo.com/?p=44354

96https://osoyoo.com/?p=44354

97https://osoyoo.com/?p=44354

98https://osoyoo.com/?p=44354

99https://osoyoo.com/?p=44354

100https://osoyoo.com/?p=44354

101https://osoyoo.com/?p=44354

172

M3 plastic screws x4

M3 plastic pillars x4

M3 plastic nuts x4

173

174

front

102

back

https://osoyoo.com/?p=44354

Connect Motor to L1, ENB--D6 ;IN4--D12;

IN3-D11

Note: In this kit, we use mblock as programming tool, if you want to learn moreabout
mblock,pleasevisit
preparation
beforeclass
1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) Download mBlock PC from https://mblock.makeblock.com/enus/download/, select the download file as per your computer OS type:

Step 3) Run the mBlock PC software by double click the lovely Panda icon. you103https://osoyoo.com/?p=44354

will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

Step 4) Drag and Drop osoyoo_uno_mext file(downloaded in Step 2) to mBlock
software as following:

Now you will see a new device firmware in mBlock, see following picture:104https://osoyoo.com/?p=44354

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Now we will show you how to use blocks to make our Oscillating Pedestal Fan
into reality.
Step 1: Click Control, then Drag and drop Forever block to programmingarea as following:105https://osoyoo.com/?p=44354

Step 2: Click Events, add when Arduino Uno starts up block to the top:

Step 3) Click Action , then drag Backward left speed 100 to Right speed 100
blocks to forever block as following:106https://osoyoo.com/?p=44354

Then change the Backward left speed 100 to Right speed 100 to Backward
left speed 100 to Right speed 0.
Now all the programming blocks have been completed!

Upload the program to Arduino
1) you need connect your Arduino board to your PC with a USB cable first.
Then click the Connect button in the bottom of the mBlock software, you will
see a USB window pop up,2) select Show all connectable device check box , then a device drop-downmenu will show up,3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino107https://osoyoo.com/?p=44354

5)After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to Arduino
UNO board:108https://osoyoo.com/?p=44354

Now turn on the power switch in the Magic board, the Arduino will start to work.

https://osoyoo.com/picture/Block_kit/lesson4/1-5.mp4

109https://osoyoo.com/?p=44354

Lesson 5: Tower crane
In this lesson, we use OSOYOO mini bricks to make a tower crane.

110https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

111

https://osoyoo.com/?p=44354

Please visit this link to watch video about Building Blocks:
https://youtu.be/XoR6yXXqTtM

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson5/lesson5.pdf )Note:
The color of the building block is subject to the actual product, which does notaffect the use.

112

https://osoyoo.com/?p=44354

113https://osoyoo.com/?p=44354

114https://osoyoo.com/?p=44354

115https://osoyoo.com/?p=44354

116https://osoyoo.com/?p=44354

117https://osoyoo.com/?p=44354

118https://osoyoo.com/?p=44354

119https://osoyoo.com/?p=44354

120https://osoyoo.com/?p=44354

121https://osoyoo.com/?p=44354

122https://osoyoo.com/?p=44354

123https://osoyoo.com/?p=44354

124https://osoyoo.com/?p=44354

125https://osoyoo.com/?p=44354

126https://osoyoo.com/?p=44354

127https://osoyoo.com/?p=44354

128https://osoyoo.com/?p=44354

129https://osoyoo.com/?p=44354

130https://osoyoo.com/?p=44354

131https://osoyoo.com/?p=44354

132https://osoyoo.com/?p=44354

133https://osoyoo.com/?p=44354

132(step130)+(step65)134https://osoyoo.com/?p=44354

133

134
1x

135

136
4X

M3 plastic screws x4

M3 plastic pillars x4

M3 plastic nuts x4

138

137
1X

135

4X

2X

https://osoyoo.com/?p=44354

Connect the IR receiver module to D2 port, plug arm motor to L1 port, plugcrane cable servo to D9 as following:

Note: In this kit, we use mblock as programming tool, if you want to learn
more about mblock, please visit preparation before class 1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) If you haven't install mBlock software in your PC, please read Lesson
1, download and install the software.

136https://osoyoo.com/?p=44354

Step 2) Download OSOYOO_UNO.mext device file fromhttps://osoyoo.com/driver/mblock/osoyoo_uno.mext
Step 3) Run the mBlock PC software by double click the lovely Panda icon. You
will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

Step 4) Drag and Drop osoyoo_uno_mext file (downloaded in Step 2) to mBlock
software as following:137https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!
Now we will show you how to use blocks to turn above idea into reality.
Step 1: Click Events, add when Arduino Uno starts up block to programming
area.

138

https://osoyoo.com/?p=44354

Step 2：Click Action, drag set servo pin 9 Angle as 90 block twice and change
angle to 0 and 180 as following:

Step 3： Click Control, drag wait 1 seconds block twice under the set servo
pin 9 Angle as 90 block as following:139https://osoyoo.com/?p=44354

Step 4：Click Control, then Drag and drop Forever block under wait 1
seconds block as following:

Step 5:Click Control, drag if-then block to forever loop as following:140https://osoyoo.com/?p=44354

Step 6: Click Operation, drag X =50 block on the placeholder of the if-thenblock, and change 50 to 85 as following:141https://osoyoo.com/?p=44354

Step 7: Click Sensor, drag Read IR data from Pin 2 block on the firstplaceholder of the X =85 block as following:

Step 8: Click Action, drag set servo pin 9 Angle as 90 under the if-thenblock, and change 90 to 0 as following:142https://osoyoo.com/?p=44354

Step 9 :Click Control, then drag wait 1 seconds block, and change 1 to 0.01
as following:

Step 10: Repeat Step 5 ~ Step 8 , you will get it as following:143https://osoyoo.com/?p=44354

then change the date as following：

Step 11:Click Control, drag if-then block; Click Operation, drag X =50
block;Click Sensor, drag Read IR date from Pin 2 block as following:144

https://osoyoo.com/?p=44354

then change the date as following:

Step12 :Click Action, then drag Forward Left Speed 100 Right Speed
100 block, and change 100 to 0 and 80 as following:

Step13:Click Control, drag wait 1 seconds block and change 1 to 0.1; Click
Action, drag Stop Moving as following:145https://osoyoo.com/?p=44354

Step14: Click Control, drag if-then block; Click Operation, drag X =50
block;Click Sensor, drag Read IR date from Pin 2 block as following:

then change X =50 to X=82 as following:146https://osoyoo.com/?p=44354

Step15:ClickAction, then drag backward Left Speed 100 Right Speed 100
block, and change 100 to 0 and 80;
Click Control, drag wait 1 seconds block and change 1 to 0.1; Click Action,
drag Stop Moving as following:147https://osoyoo.com/?p=44354

Now we have completed the block programming. The final blocks look likefollowing:Upload the program to Arduino1)you need click the Connect button in the bottom of the mBlock software, youwill see a USB window pop up,2) select Show all connectable device check box , then a device dropdown menu will show up,

148https://osoyoo.com/?p=44354

3) select your Arduino port from device drop-down menu
4) click Connect button to connect your PC to Arduino5) After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to
Arduino UNO board:149https://osoyoo.com/?p=44354

1) When you press ◄ key in IR controller, the crane arm will rotate to left
(clockwise), when you press ►key, crane arm will rotate to right(counterclockwise).
2) When you press ▲ key, the cable servo will drive the cable up, if you press▼key, the cable servo will drop the cable down.

https://osoyoo.com/picture/Block_kit/lesson5/1-5.mp4

150

https://osoyoo.com/?p=44354

Lesson 6: Robot Crab
The OSOYOO building bricks is mechanically compatible with leading building
bricks. In this lesson, we will use OSOYOO Bricks to build a robot crab which
can use its eyes (Ultrasonic Sensor) to detect objects and use pincers (finger
servo) to catch object.

Please prepare the following parts to complete this project.

151https://osoyoo.com/?p=44354

152https://osoyoo.com/?p=44354

Before you build an elevator with blocks, please according to the Preparation
before class 3: https://osoyoo.com/2021/12/01/preparation-before-class-3

Please visit this link to watch video about Building Blocks:
https://youtu.be/v8OrD19aDhE

Please follow the instruction to build the blocks (Download link:
https://osoyoo.com/picture/Block_kit/lesson6/lesson6.pdf )Note：
The color of the building block is subject to the actual product, which does notaffect the use.

153

https://osoyoo.com/?p=44354

154https://osoyoo.com/?p=44354

155https://osoyoo.com/?p=44354

156https://osoyoo.com/?p=44354

157https://osoyoo.com/?p=44354

4x

4x

1x

M3*10 screws x4
M3 nuts x4

158

1x

https://osoyoo.com/?p=44354

A05S

A05S

1：1
0

1

2

3

4

5

6

7

8

9

10

11

A050

A050

1：1
0

159

1

2

3

4

5

6

7

8

9

10

11

https://osoyoo.com/?p=44354

A050

A050

160

https://osoyoo.com/?p=44354

A050

161

https://osoyoo.com/?p=44354

A050

A05S

A05S

162

https://osoyoo.com/?p=44354

A050

163

https://osoyoo.com/?p=44354

63

64

65

66

164

https://osoyoo.com/?p=44354

67

68

70
69

70
1x

72
71

165

2x

https://osoyoo.com/?p=44354

Connect wires as per following picture:
Motor(Red) to L1 or L2
Servo(Grey) to D9 port
IN1 to D12
IN2 to D11
ENA to D5
Ultrasonic Sensor to D7D8 port

Note: In this kit, we use mblock as programming tool, if you want to learn
more about mblock, please visit preparation before class 1:
https://osoyoo.com/2021/12/01/preparation-before-class-1
Step 1) Download mBlock PC from https://mblock.makeblock.com/enus/download/, select the download file as per your computer OS type:166https://osoyoo.com/?p=44354

Step 2) Download OSOYOO_UNO.mext device file fromhttps://osoyoo.com/driver/mblock/osoyoo_uno.mext
Step 3) Run the mBlock PC software by double click the lovely Panda icon.
you will see mBlock UI as following picture. Please delete the default device
CyberPi by click the cross in the red circle.

Step 4) Drag and Drop osoyoo_uno_mext file(downloaded in Step 2) tomBlock software as following:167https://osoyoo.com/?p=44354

Now you will see a new device firmware in mBlock, see following picture:

Now mBlock software and OSOYOO_UNO device firmware have beensuccessfully installed in our PC!

168https://osoyoo.com/?p=44354

Now we will show you how to use blocks to make our Robot Crab into reality.
Step 1: Click Events, add when Arduino Uno starts up block toprogramming area:

Step 2: Click Action, drag set servo pin 9 Angle as 0 block twice andchange angle to 0 and 45 as following:169https://osoyoo.com/?p=44354

Step 3: Click Control, drag wait 1 seconds block twice under set servo pin
9 Angle as 0 block and change 1 to 0.5 as following :170https://osoyoo.com/?p=44354

Step 4: Click Control, then Drag and drop Forever block under wait x
seconds block as following:

Step 5: Click Control, drag if-then-else block to forever loop as following:171https://osoyoo.com/?p=44354

Step 6: Click Operation, drag X < 50 block on the placeholder of the if-thenelse block, and change 50 to 8 as following:

Step 7: Click Sensor, drag read ultrasonic sensor trig pin 1 echo pin 1
block on the first placeholder of the X < 8 block as following:172https://osoyoo.com/?p=44354

Step 8: Click Control, drag Wait 1 seconds block five times inside the“then” section of the if-then-else block as following:

Step 9: Click Action , then drag set Servo Pin blocks twice to between wait
1 seconds blocks and change angles to 0 and 45 as following:173https://osoyoo.com/?p=44354

Step 10: Click Action , then drag Forward Left Speed 100 Right Speed 100
block and Backward Left Speed 100 Right Speed 100 block and change
Left Speed to 0 as following:

Step 11: Click Action , then drag Stop Moving block twice under wait x
seconds as following:174https://osoyoo.com/?p=44354

Step 12: Click Action , then drag Stop Moving block and set Servo Pinblock inside the “else” section and change the angle to 45 as following:

Step 13: Click Control , then drag wait 1 seconds block and change time to
0.5 seconds as following:

175https://osoyoo.com/?p=44354

Now all the programming blocks have been completed! From above picture,
the logic is pretty straight forward:
When Arduino is started, the crab will close at the beginning and then open
(my servo 0 degree is closed and 45 degree is opened ). Computer will entera dead loop which will check the distance between object and ultrasonicsensor. When the ultrasonic sensor "see" the object under 8cm distance, thecrab close to catch the object and the motor move the crab to right, then the
crab open to throw the object away, then the motor move the crab back. If the
distance is over 8cm, the crab will stay still.
Upload the program to Arduino1)you need connect your Arduino board to your PC with a USB cable first.
Then click the Connect button in the bottom of the mBlock software, you will
see a USB window pop up,2) select Show all connectable device check box , then a device dropdown menu will show up,3) select your Arduino port from device drop-down menu176https://osoyoo.com/?p=44354

4) click Connect button to connect your PC to Arduino5)After you PC is connected to Arduino UNO board, please click Upload
button in the bottom of your software, then the code will be uploaded to
Arduino UNO board:177https://osoyoo.com/?p=44354

Now turn on the power switch in the Magic board, the Arduino will start towork. Press the button on D2, your fan begins to rotate and servo start tooscillate. When you release the button, fan and servo will stop moving.

https://osoyoo.com/picture/Block_kit/lesson6/18.mp4

178