Lesson 3 CP Robotics Revised
Lesson 3 CP Robotics Revised
Objectives
Content
Arduino Basics and LED with
Tinkercad
1
Learning Activities
Presentation
Discuss the Introduction about Aduino Basics.
Discussion
THIS IS ARDUINO
Microcontrollers
The heart of your Arduino is a microcontroller. Pretty much everything else on the
board is concerned with providing the board with power and allowing it to
communicate with your desktop computer. A microcontroller really is a little computer
on a chip. It has everything and more than the first home computers had. It has a
processor, a kilobyte or two of random access memory (RAM) for holding data, a few
kilobytes of erasable programmable read-only memory (EPROM) or flash memory for
2
holding your programs and it has input and output pins. These input/output (I/O) pins
link the microcontroller to the rest of your electronics.
Inputs can read both digital (is the switch on or off?) and analog (what is the voltage at
a pin?). This opens up the opportunity of connecting many different types of sensor for
light, temperature, sound, and more.
Outputs can also be analog or digital. So, you can set a pin to be on or off (0 volts or 5
volts) and this can turn light-emitting diodes (LEDs) on and off directly, or you can use
the output to control higher power devices such as motors. The microcontroller on an
Arduino board is the 28-pin chip fitted into a socket at the center of the board. This
single chip contains the memory processor and all the electronics for the input/output
pins. The great thing about the Arduino is that it reduces this bewildering array of
choices by standardizing on one microcontroller and sticking with it.
A Microcontroller (or MCU, short for microcontroller unit) is a small computer (SoC)
on a single integrated circuit containing a processor core, memory, and programmable
input/output peripherals. It serves as the brain of our robot. Compared to our nervous
3
system, this unit sends the information programmed so different robotic parts can
function.
HARDWARE SPECIFICATION
4
The hardware consists of a simple open source hardware board designed around an
8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM.
These are the specifications of the Arduino MCU that is included in the kit.
Microcontroller: ATmega328
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: 40mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32KB(ATmega328)
SRAM: 2KB (ATmega328)
EEPROM: 1KB (ATmega328)
Clock Speed: 16MHz
Light Emitting Diode (LED) is a semiconductor diode that converts electric energy
into electromagnetic radiation at a visible and near infrared frequencies when it pn
junctions is forward biased.
In short, LEDs are like tiny light bulbs. However, LEDs require a lot less power to light
up by comparison.
1- Short pin to be
connected to GND
(ground)
2- Longer pin to be
connected to any of
the digital pins (pins 2-13)
5
Blinking LED
Materials:
Microcontroller
USB Cable
Jumper Wire
Breadboard
1kΩ Resistors
LED (Any color)
1. Given the 1kΩ resistance value, describe the brightness level of the LED.
2. What happened when you changed the resistance value to 520Ω
EXPLORING TINKERCAD
6
Tinkercad already has a lot to offer as a design program, but it also serves as a
replacement for Autodesk’s discontinued “123D Circuits” service, which was a free
and easy to use breadboard simulator.
Getting Started
Select “Create new Circuit” on the next page and you’ll be greeted with the following
screen:
To familiarize yourself with the circuit design homepage, let's go over the areas that
marked with numbers.
7
1. Change the name of your design here
2. This is the main toolbar. From the left to the right: Rotate the selected part
clockwise, delete the selected part, undo and redo your last action(s), create
annotations and toggle their visibility.
3. Some parts allow you to change their program. Click here to do so.
4. Start the simulation
5. Export your design to Autodesk EAGLE.
6. Choose the parts to display in the list below. I recommend choosing “All”.
7. These are the parts you can use.
8. The main work area. Drag and drop parts here to add them to your design.
9. Fit everything into the view.
8
Assessment
Directions: Based on your knowledge regarding the topic discussed, what is the main
role of Arduino in Robotics? Write your answer on space provided.
Worksheet 1:
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
______________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
____________________________________________________________________
________________________________________________________
1. __________________________
2. __________________________
3. __________________________
4. __________________________
5. __________________________
6. __________________________
7. __________________________
8. __________________________
9. __________________________
9
Directions: Follow the set up in the circuit diagram and key in the code for this
activity.
1. You will be given a set of materials
2. Build the circuit based on the materials given
3. Change the resistance value from 220Ω to 850Ω
4. Observe on what will happen to the LED, if you change the value of the
resistor.
Materials
Microcontroller
USB cable
Jumpire Wire
Breadboard
2pcs. 220Ω
Resistors
2pcs. LED (Any
color)
10
Congratulations!!
11
29