10
Computer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots and the code that makes them run. They will drag and drop commands that replicate the chunks of code that control the robots. These bots are controlled by code written in C, but this interactive program makes coding easy through the use of drag and drop blocks. Kids can avoid worrying about things like syntax and just select the commands they want to use while exploring the basics of coding. How does this impact the world we live in? Robots have been used in situations from bomb sniffing to assembly lines to robotics surgery. All of these require code behind them to make it run. In a nation where almost everyone has access to a computer, only one in four schools have a class in computer programming. Only 8% of STEM (Science, Technology, Engineering, and Math) graduates are in computer science. Not only this, every student who has access to use a computer should have a chance to learn about algorithms, how to make an app or how to program a robot. Learning how to program is an essential concept that should be taught along with concepts like electricity or photosynthesis. Want to enhance your child’s programming skills? Here are some links that can help: Scratch is a cool way to start exploring how to code. You can go to the scratch website and start playing some modules! https://scratch.mit.edu/ Scratch will help teach you how to think like a programmer and will let you program your own stories, games, and animations. If you feel confident to try something harder, try exploring python! Python is a high-level programming language that has syntax that is easy to read. Codecademy has tutorials to learn how to use python effectively! https://www.codecademy.com/tracks/python Don't have a lot of time? Khan academy has a lot of links where you can learn the basics of coding and create cool projects that should take an hour or less. You can find the links for every- thing here: https://www.khanacademy.org/hourofcode Code is a good website to help anyone who has little to no experience programming learn and understand the concepts in a very clear and concise way. https://code.org/ Basic Arduino Starter Kit: http://amzn.to/2dluB7P : A well assembled kit of over 200 pieces and instruction manual for you child to explore and start using Arduino boards. http://bit.ly/2dPySTC : This kit will walk you through the basics of using the Arduino in a hands-on way by helping you do 15 different projects using the components provided http://bit.ly/2cJqtRO : A list of project and places to buy the materials for the project all in one place

Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

  • Upload
    vudat

  • View
    228

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

ARDUINO ROBOTS

What is the activity about?

In this lab, students will use a fun interface to explore Arduino robots and the code that makes them

run. They will drag and drop commands that replicate the chunks of code that control the robots.

These bots are controlled by code written in C, but this interactive program makes coding easy

through the use of drag and drop blocks. Kids can avoid worrying about things like syntax and just

select the commands they want to use while exploring the basics of coding.

How does this impact the world we live in?

Robots have been used in situations from bomb sniffing to assembly lines to robotics surgery. All of

these require code behind them to make it run. In a nation where almost everyone has access to a

computer, only one in four schools have a class in computer programming. Only 8% of STEM

(Science, Technology, Engineering, and Math) graduates are in computer science. Not only this,

every student who has access to use a computer should have a chance to learn about algorithms,

how to make an app or how to program a robot. Learning how to program is an essential concept

that should be taught along with concepts like electricity or photosynthesis.

Want to enhance your child’s programming skills? Here are some links that can help:

Scratch is a cool way to start exploring how to code. You can go to the scratch website and

start playing some modules! https://scratch.mit.edu/ Scratch will help teach you how to think like

a programmer and will let you program your own stories, games, and animations.

If you feel confident to try something harder, try exploring python! Python is a high-level

programming language that has syntax that is easy to read. Codecademy has tutorials to learn

how to use python effectively! https://www.codecademy.com/tracks/python

Don't have a lot of time? Khan academy has a lot of links where you can learn the basics of

coding and create cool projects that should take an hour or less. You can find the links for every-

thing here: https://www.khanacademy.org/hourofcode

Code is a good website to help anyone who has little to no experience programming learn and

understand the concepts in a very clear and concise way. https://code.org/

Basic Arduino Starter Kit:

http://amzn.to/2dluB7P : A well assembled kit of over 200 pieces and instruction manual for you

child to explore and start using Arduino boards.

http://bit.ly/2dPySTC : This kit will walk you through the basics of using the Arduino in a hands-on

way by helping you do 15 different projects using the components provided

http://bit.ly/2cJqtRO : A list of project and places to buy the materials for the project all in one

place

Page 2: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

ARDUINO ROBOTS

Arduino Robots Helpful Functions

turnCounterClockwise(turns) - turns the robot counterclockwise for the

number of turns. Acceptable input is in increments of quarter turns. (1.25, 3,

0.5, etc.)

turnClockwise(turns) - turns the robot clockwise for the number of turns.

Acceptable inputs is in increments of quarter turns. (1.25, 3, 0.5, etc.)

forward(distance) - moves the robot in the forward direction for the number

of centimeters that is provided. Acceptable input is anything more than

1.3cm

reverse(distance) - moves the robot in the reverse direction for the number of

centimeters that is provided. Acceptable input is anything more than 1.3cm

forwardUntilWall() - moves the robot forward until it senses something in front

of it (a wall, a foot, etc.) The robots can only “see” 15cm in front of it.

changeSpeed(speedValue) - makes the robot go faster or slower.

Acceptable values are between 1 (really slow) and 10 (really fast).

stopMoving() - makes the robot stop moving for a minute and a half.

Page 3: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

BLINKY PENDANT

Microcontrollers are miniature, inexpensive computers that can be programmed to accomplish different tasks.

Microcontrollers are also versatile devices that interact easily with different other technologies. The Blinky

Pendant uses a microcontroller in combination with other sensors to create a custom LED

display when the device is waived through the air.

Students will create a custom image using the program “Pattern Paint”. The image is separated into

pixels, where each pixel will be represented by an LED on the Blinky Pendant. When the image is

created, upload it to the device and the microcontroller will be programmed to light up the LEDs to show the

picture. The microcontroller also uses a sensor called an accelerometer. The accelerometer detects motion

so that the device knows when to light up each LED. Once the image is uploaded to the board, cycle

through the existing images until the desired image is found. Waive the board through the air at different

speeds until the image becomes clear.

But how can we see the entire image when only one part of it is being shown on the LEDs at a time? The Blinky

Pendant relies on an optical illusion referred to as “Persistence of Vision” (POV), which makes your brain think

that the flashing images are merged into one single image. The accelerometer is a sensor that tells the

microcontroller which lights to light up when it is being waived so that your brain can easily merge the flashing

images.

More about the Blnky Pendant Activity can be found here: http://blinkinlabs.com/blinkypendant/

More Information:

Programming for Beginners:

https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/

programming-intro

Here are some inexpensive microcontrollers that provide good tutorials for beginners:

Arduino: https://www.arduino.cc/

Tutorials: https://www.arduino.cc/en/Tutorial/HomePage

Raspberry Pi: https://www.raspberrypi.org/ & https://learn.adafruit.com/category/raspberry-pi

Societal Impact and Real-World Applications:

Microcontrollers are a huge part of today’s society because they are used virtually everywhere. This is possible

because microcontrollers are both small and inexpensive and incredibly versatile. Here are some real-world

applications of microcontrollers:

1. Home automation devices- microcontrollers are used frequently in home automation devices such as

automatic light control, because they are small, cheap, and have much flexibility.

2. Industrial sensors- microcontrollers are often programmed to control other types of sensors, for

example, temperature sensors. They use the data from the sensors to accomplish other tasks. The Blinky

Pendent uses an accelerometer that allows it to sense the movement of the pen to know what pixels to

display.

3. Health/Medical devices- medical devices such as heart rate monitors rely on microcontrollers so they can

be portable and also gather data while using less battery life.

Page 4: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

BLINKY PENDANT

Blinky Pendant is a small microcontroller with a strip of light emitting diodes (LEDs) that

creates an image when it is waved through the air. A microcontroller is a very small

computer that is put on a single chip and can be programmed to accomplish different

tasks. With Blinky Pendant, you can upload a pixel-by-pixel image to the

microcontroller, and a program will be generated to display the image on the LEDs.

Blinky Pendant uses an optical illusion called Persistence of Vision to show make your

brain think it can see an entire image when the microcontroller is only displaying part

of it at one time.

Create an Image

Using the software Pattern Paint, create an image to be displayed on the LEDs. The

image is separated into pixels, and each pixel will be shown on an LED on the board.

The microcontroller will use a program to tell the LEDs when to turn on and off.

Upload and Display the Image

Upload your image to the board. The image will be added to the group of images

that the board will display. Cycle through the images until you find yours and wave

the wand through the air to see your animation!

Page 5: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

DIGITAL LOGIC

Number systems are used to represent numbers in different ways. The decimal number system is how you

would normally count. Decimal is of base-10, meaning that numbers can be represented by 10 different

digits, 0-9. Binary is another way to represent numbers. The binary number system is base-2, with numbers

being represented by only 1s and 0s! Computers only think in the binary system and we have to convert to

decimal or another common system called hexadecimal. The hexadecimal number system is from 0-9 and

then A-F. This is used as shorthand for binary because every 4 binary numbers convert to 1 hexadecimal

number.

Computers today are capable of completing complicated tasks and generally respond to what we tell

them to do. But have you ever thought about how a computer actually “thinks”? Digital logic is the

answer to that! Digital logic uses binary numbers to allow electrical components to make decisions. 1s and

0s can represent various things in digital logic depending on how you are using it; true or false for

conditional cases, closed or open for switches, pressed or not pressed for buttons.

But digital logic isn’t having 1s and 0s just floating around or doing what 1s and 0s like to do. There are

operations that can be done with them. These operations, or “gates”, are what help computers come to

decisions based on what values are given. Some common gates in digital logic are AND, OR, and XOR.

These gates can be combined together into circuits to imitate more complicated decision making

processes. Digital logic doesn’t just have to be used with electrical components. It is actually used in

programming as well. It is a fundamental topic when creating programs and applications that require

decision-making based on information that is given.

More Information:

Digital Logic: https://learn.sparkfun.com/tutorials/digital-logic

http://www.electrical4u.com/digital-logic-gates/

Number Systems: http://number.webmasters.sk/numerical.php

Digital Logic Game: https://www.khanacademy.org/computer-programming/logic-gate-puzzler/1522357785

If you are familiar with the game Minecraft, or if your student is, digital logic can actually be used in the game

to create cool functionality in the game:

http://minecraft.gamepedia.com/Tutorials/Basic_logic_gates

Societal Impact and Real-World applications:

Digital logic forms the basis for all computers. Because of this, it is involved in a wide arrange of technology

and solves a multitude of problems. Some real-world application are:

1. Alarm / Security systems

2. Light switches

3. Cell phones

Page 6: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

DIGITAL LOGIC

The input is‘1’ when the button is pressed.

The output is ‘1’ when the LED is ON.

Unknown chip 1 is: ____________________________________

Unknown chip 2 is: ____________________________________

Unknown chip 3 is: ____________________________________

To see more with Digital Logic, visit the Electrical Engineering Exhibit and build your own

Digital Logic circuit!

Input (Buttons) Output (LED)

A B A AND B A OR B A XOR B

0

(unpressed)

0

(unpressed)

0

(off)

0

(off)

0

(off)

0

(unpressed)

1

(pressed)

0

(off)

1

(on)

1

(on)

1

(pressed)

0

(unpressed)

0

(off)

1

(on)

1

(on)

1

(pressed)

1

(pressed)

1

(on)

1

(on)

0

(off)

A B Unknown 1 Unknown 2 Unknown 3

0 0

0 1

1 0

1 1

Page 7: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

INSIDE A COMPUTER

Students were introduced to the five main components of a computer: the motherboard, CPU, hard

drive, RAM, and power supply. The focus is on how the parts function and work together to make a

computer. The motherboard handles communication between parts, the CPU is the brain, the hard

drive is the main memory, RAM is a smaller, faster memory to speed up processing, and the power

supply provides power to all the components. The CPU fits into a square socket on the motherboard, the

hard drive is connected through a cable, RAM fits into slots on the motherboard, and the power supply

plugs into the motherboard and hard drive. For more details and a picture guide, reference the student

handout.

In the interest of time, a few things were left out of this activity. First, the computer was assembled out of

the case and without regard to static electricity. Components can be adversely affected and often

broken if not handled or stored correctly. Also, a cooling system, usually fans but sometimes water

cooling, would normally be necessary because computers generate a lot of heat and will not function

unless it is dissipated. Finally, add-ons such as graphics cards were ignored because though they are

often used, they are not necessary for the basic operation of a computer and would overcomplicate

the activity.

More Information:

Take it apart: Find old hardware, pull it apart, and try to get it back together again. Online resources can

easily be found to describe what is going on inside and hands on experience with electronics is the best

way to feel comfortable with them.

The Engineer Guy(https://www.youtube.com/user/engineerguyvideo): This is a series of videos breaking

open and explaining how different technologies work. In particular, his videos on a LCD Screens and

hard drives are excellent.

PC Part Picker (https://pcpartpicker.com/): When building a computer, PC Part Picker will verify that the

parts selected will be compatible with each other. This also includes guides to different builds based on

the need of the computer.

Societal Impact and Real-World Applications:

Computer are used for everything from medical devices to autonomous cars to playing video games.

Understanding these components is vital for IT people who build computers and Computer Engineers

who will design the parts. Knowing how the parts of a computer work together opens up the possibility to

improve the computer based on its need. Some real-world applications are.

1. Server Farms: Massive buildings filled with thousands of computers and often used to run websites

and store data. With this many computers, they may not need high end graphics cards and instead

focus on energy efficient parts.

2. Old Computers: Often times when a computer gets slow, new life can be given to it by simply buying

more RAM or upgrading different parts. This can save money and reduce waste.

3. Computer Architects: Someone has to design the CPU, RAM, etc. Knowing how they function as a

part of the whole leads to better design and easier integration with the other parts.

Page 8: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Computer Engineering:

INSIDE A COMPUTER

Motherboard:

The motherboard connects and allows communication between the parts of a com-

puter so they can work together.

This is what we’ll attach all the other parts to. Lay the motherboard in front of you.

CPU:

The CPU (Central Processing Unit), also known as the core, is the brain of the computer.

All the thinking of how to run computer programs, from video games to Microsoft

Word, is done here.

Find the square of either pins or holes on the motherboard. This is the CPU socket. Grab

a CPU, match up the triangles on the socket and CPU, and drop it in. It should sit in

easily. If not, rotate the CPU.

Page 9: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Hard Drive:

The hard drive is where all the programs and files are stored. The CPU does the thinking

while the hard drive is like the bookshelf to store games, books, and photos. The hard

drive does not attach directly to the Motherboard, we run a cable from the hard drive to

the motherboard.

Grab a SATA cable:

Connect one end to the hard drive and the other to the motherboard.

RAM:

RAM (Random Access Memory) is another form of memory that helps your computer run

faster. Hard drives are slow, but hold a lot of memory. RAM is fast, but holds very little

memory. So when your computer runs a program, it transfers it from the hard drive to

RAM so that it can run faster.

Plug the RAM into 2 of the four long slots on the motherboard.

Page 10: Computer Engineering: ARDUINO ROBOTS · PDF fileComputer Engineering: ARDUINO ROBOTS What is the activity about? In this lab, students will use a fun interface to explore Arduino robots

Power Supply:

Your computer needs to plug into the wall to run right? Well the power from the wall

needs to get to all the pieces. The power supply helps to bring power to all the pieces.

A power supply has many connectors.

Find the connectors that match the hard drive and the motherboard. Connect them.

The motherboard shares its power with the CPU and RAM so now you’re finished!