Unit 8: Robotics and Animation
Learning Objectives
Learners will learn to:
understand the basics of Arduino board and how it can be integrated to build
circuits
use a visual block-based interface, PictoBlox, to control Arduino
use Arduino and PictoBlox to create a blinking LED Controller
Vocabulary
Arduino
microcontroller
Let Us Start
Hey there! I have heard about Arduino is a microcontroller
Arduino but never got the platform that you can
chance to try it. What exactly program to interact with the
can you do with it? physical world.
1
Get, Set, Go
8.1 Introducing Tinkercad Circuits
Tinkercad allows us to create virtual electronic circuits and test them. This is called
simulation. It allows you to create simple to complex circuits and test them before
creating the physical circuit.
Steps to open the Circuit workspace in Tinkercad
Step 1: Go to www.tinkercad.com and log in to your account.
Step 2: Click the Create button.
Step 3: Select the Circuit option. The Tinkercad Circuits workspace appears as shown.
2
8.2 Components of Tinkercad Circuits
The Circuits workspace in Tinkercad is similar to that of 3D design workspace.
In addition to the regular options, it contains tools for creating and testing
circuits. These are listed below.
Workspace
It is the area where the electronic components and 3D objects are placed.
Rotate
It is used to rotate the selected component placed on the workspace.
Wire color
It is used to change the colour of the wires used to connect the components in
a circuit.
Wire type
It is used to select the type of wire used to connect the different components
in a circuit.
Start/Stop Simulation
It is a toggle button that is used to test the working of circuits and
components.
3
8.3 Components
An electronic circuit is built using different components.
Circuit Assemblies
Circuit assemblies are simple, pre‐made circuits that can be incorporated into
3D designs. Some available circuit assemblies are the glow circuit, move circuit
and spin circuit.
Arduino
Arduino is an open‐source platform that helps to build electronic projects. It
consists of both hardware and software. The Arduino hardware is a
programmable circuit board called a microcontroller. You can tell the board
what to do by sending a set of instructions through code to the
microcontroller. Arduino software is an IDE (integrated development
environment) through which developers write and upload the code to the
microcontroller. The Arduino boards can read inputs such as a light on a
sensor, a finger on a button, or a Twitter message and turn them into outputs
such as activating a motor, turning on an LED, publishing something online, etc.
4
Micro Bit
The micro:bit is a small, programmable microcontroller. It
is a pocket‐sized computer that helps to learn how
software and hardware work together. It is designed to
learn electronics and coding. It consists of various input‐
output features such as LED light displays, sensors,
buttons, and lights that help to create amazing interactive
projects.
8.4 Arduino hardware
A circuit board, which can be programmed (a microcontroller)
and ready-made software called Arduino IDE (Integrated
Development Environment), which is used to write and upload
the computer code to the physical board.
Components of Arduino board
1. USB connector - The Arduino board can be powered by using the USB cable
from your computer. Connect the USB cable to the USB connector to set up a
connection.
5
2. Power port - The boards can be powered directly from the mains power
supply by connecting it to the power port.
3. Voltage Regulator - The function of the voltage regulator is to control the
voltage given to the Arduino board.
4. Crystal oscillator - The crystal oscillator on an Arduino board provide precise
timing for the microcontroller. Its stability and accuracy influence the reliability
of timing-dependent tasks and the overall performance of the Arduino
system.
5. Reset switch - You can reset your Arduino board, i.e., start your program from
the beginning.
6. Digital and Analog Pins - Arduino boards come with a set of digital and
analog input/output pins that can be used to connect sensors, LEDs, motors,
and other electronic components.
7. Microcontroller - Each Arduino board has its microcontroller. You can assume
it as the brain of the board. It is a pre-programmed chip with a bootloader,
allowing users to upload their programs using a USB connection.
8. TX RX LEDs - The TX (transmit) and RX (receive) LEDs on an Arduino board are
indicators that show the communication activity between the Arduino and
another device, such as a computer or another microcontroller.
9. USB interface chip - The USB interface chip on certain Arduino boards
facilitates communication between the Arduino microcontroller and a
computer or other devices via USB. It allows data to be exchanged between
the Arduino and the computer.
Features of Arduino board
The key features of Arduino are as follows:
Arduino boards can read analog or digital input signals from different sensors
and turn it into an output, such as activating a motor, turning LED on/off,
connecting to the cloud and many other actions.
6
You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE.
Arduino does not need an extra piece of hardware in order to load a new code
onto the board. It can be loaded using a USB cable.
8.5 Blink an LED With Arduino in Tinkercad Circuits
Steps to use Tinkercad Circuits to blink an LED with Arduino
Step 1: Log in to the Tinkercad Circuit account.
Step 2: Click on the "Create new circuit" button.
Step 3: From the components panel, find and drag an Arduino board, LED and
resistor onto the workspace.
Step 4: Connect the LED to two pins on the Arduino:
ground and pin 13, as shown.
Step 5: Click the "Start Simulation" button to run your circuit. Tinkercad will simulate
the behaviour and LED will start blinking.
Step 6: Click the Code button to see the corresponding code for the Arduino.
8.6 Creating Blinking LED Controller using Arduino and PictoBlox
Creating a Blinking LED Controller with Arduino and PictoBlox involves programming
an Arduino board to control an LED's blinking pattern using PictoBlox programming.
Components
Arduino Uno
LEDs (Red, Yellow, Green)
Resistors (for current limiting)
Breadboard and jumper wires
USB cable
7
Using PictoBlox
PictoBlox is a programming software based on Scratch 3.0; hence, its basic
functionality is similar. As additional features, it has various extensions
related to hardware, robotics, Artificial Intelligence and Machine learning.
Download PictoBlox
Use the link https://thestempedia.com/product/pictoblox/download-pictoblox/ and
choose the appropriate Operating System (Windows, macOS, Linux) to download it.
Opening Screen of PictoBlox
Just like the Scratch user interface, PictoBlox has the following basic elements.
Uploading the Firmware
Step 1: Open PictoBlox.
Step 2: Click on the Board button and select Arduino Uno.
Step 3: Connect your Arduino Uno to your computer using a USB cable.
Step 4: Select the appropriate serial port. Click on the Upload Firmware button.
8
Step 5: Once uploaded, disconnect the USB cable.
Interfacing Arduino Uno to PictoBlox
To run the scripts written in PictoBlox, you must first upload it to Uno.
Follow the procedure given below to interface Arduino Uno with PictoBlox.
Step 1: Connect Arduino Uno to your computer and open PictoBlox.
Step 2: Go to the toolbar and click on the Board menu. Select Arduino Uno.
In doing so, the Arduino Uno, Actuators, Sensors, Display, and Dabble extensions will
automatically appear in the Block palette.
Step 3: Click on the Connect menu and from the fly-out menu, select the Port. Once
you select the port, the icon beside the Connect tab will become connected.
9
Setting up the project
Step 1: Go to My Blocks palette. Click on Make a Block button. Type Red into the
name, add an input box and mention Status. Click OK.
Step 2: Go to Control Blocks and add ‘if else’ block.
Step 3: Use Operators, Arduino Uno blocks to create
the given script to make the Red LED blink.
Step 4: Similarly, create the custom blocks to Green and Blue LED and create the
script as shown.
10
Step 5: To create the main script, drag and
drop the ‘when Arduino uno starts up’ block
from Arduino Uno.
Step 6: Create the given script to make the 3
three LEDs blink.
Simulating circuit in Tinkercad Circuit
Using Tinkercad Circuits, create the circuit using Arduino board, LEDs, Resistors and
Jumper wires. Simulate the circuit to test it.
11
Assembling components
Step 1: Gather the hardware components and assemble it as shown.
Step 2: Connect the Arduino board to the computer using USB cable.
Step 3: Upload the code from PictoBlox to the Arduino Uno board.
Step 4: Change the Wait time to make the LED blink fast or slow.
Resources
https://ai.thestempedia.com/docs/pictoblox/pictoblox-tutorials/getting-started-with-pictoblox/
Reference Material
https://www.youtube.com/watch?v=VfsOv1Hdmzo
12