You are on page 1of 138

Objective

Develop a basic approach and understanding NXT.

Structures

Theory

Hands-on

Programming Skills

WHAT IS A ROBOT?

Main component of robotics


Environment

Lamp, moving
object, noise, wall

ENVIRONMENT

Sensor input

Examine the surroundings


Identify source of input

Main component of robotics


Environment

Lamp, moving
object, noise, wall

INPUT

Sensor input
Input

Light,
Touch, Light, Sound,
ultrasonic,
Ultrasonic
sound, touch
Send for process

Respond and collects data


from
surroundings
and
hundreds of other activities
without help from its human
creator

Main component of robotics


Environment

Lamp, moving
object, noise, wall

PROCESS

Sensor input
Input

Light,

Touch, Light, Sound,


ultrasonic,
Ultrasonic

sound, touch

Send for process

Process

Controller
Choose output

A program is a set of instructions


for my robot.
Programming is what you do when
you create a program.

Main component of robotics


Environment

Lamp, moving
object, noise, wall

OUTPUT

Sensor input
Input

Light,

Touch, Light, Sound,


ultrasonic,
Ultrasonic

sound, touch

Send for process

Process

Controller
Choose output

Output

Motor rotation,
brightness, display
Outcome

Move forward, back, right or left


Display picture on NXT display
Play sound though NXT speaker
Control the lamp brightness

Main component of robotics


Environment

Lamp, moving
object, noise, wall

RESULT

Sensor input
Input

Light,

Touch, Light, Sound,


ultrasonic,
Ultrasonic

sound, touch

Send for process

Process

Controller
Choose output

Output

Motor rotation,
brightness, display
Outcome

Result

Move forward, follow


line, climbing pole
Then youve got a
robot.

In a nutshell, a robot should be able


to move and react all on its own

Main component of robotics


Environment

Lamp, moving
object, noise, wall

RESULT

Sensor input
Input

Light,

Touch, Light, Sound,


ultrasonic,
Ultrasonic

sound, touch

Send for process

Process

Controller
Choose output

Output

Motor rotation,
brightness, display
Outcome

Result

Move forward, follow


line, climbing pole
Then youve got a
robot.

All components must keep on


repeating

Element item

Quantity
in Set

Intelligent NXT Brick

Rechargeable battery

Interactive servo motor

Touch sensor

Sound sensor

Light sensor

Ultrasonic sensor

USB wire

Connection cables, different lengths

Lamps

Converter cable

Total piece count (all elements in set)

437

NOTE: Transformer for rechargeable battery


is not included in 9797 Base Set

Storage solution & sorting


trays
Building instructions
(printed)

INTERACTIVE SERVO MOTOR

Tachometer
for Built-in
Rotation
Sensor

Hub with an axle


hole for attaching
a wheel
Motor core

Built-in gearing

9 volt geared motor


Without load, motor shaft turns at about 150 rpm.
Servo sensitive to 1 degree.
Built-in rotation sensor measures exact speed and distance
Enables precise motor control

- motors will align the speed when your robot moves

TOUCH SENSOR

Detects pressure (pressed, released or bumped)


Detects touching or bumping into something.
Counts single press and multiple presses
LEGO cross axle attachable to sensor button

LIGHT SENSOR
This is what you
see
This is what light sensor see

Shines a red light.


Reads reflection from IR emitter
Reads light intensity from surroundings
IR emitter can be turned off
Operates in "percent" mode
- 0 to 100
- A lighter surface reflects more light.

ULTRASONIC SENSOR

Enables your robot to see and detect objects.


Make your robot avoid obstacles, sense and measure distance, and
detect movement.
Measures distance in centimeters and in inches.
It is able to measure distances from 0 to 255 centimeters or 100 inch

SOUND SENSOR

The Sound Sensor detects decibels. A decibel is a measurement of sound


pressure.
The Sound Sensor can measure sound pressure levels up to 90 dB about
the level
of a lawnmower.
4-5% is like a silent living room
5-10% would be someone talking some distance away
10-30% is normal conversation close to the sensor or music played at a

INTELLIGENT NXT BRICK


3 Motor Outputs
(A, B, C)
On/Select
button
Left button
Go Back button

USB USB 2.0


port (12 Mbit/s)

100 x 64 pixel LCD


graphical display
Loud speaker - 8
KHz sound quality
Right button
4 Sensor Inputs
(1, 2, 3, 4)

Notes:
32-bit ARM7 microprocessor
(256 Kbytes FLASH, 64 Kbytes RAM)
8-bit AVR microprocessor
(4 Kbytes FLASH, 512 Byte RAM)

Bluetooth wireless communication


Power source: 6 AA batteries or special
rechargeable battery

MY FILES
Software files Programs you have
downloaded
computer.

from your

NXT files Programs you have made on the


NXT.

Sound files Sounds that are part of a


program

that you download.

SETTINGS
Change Volume: Here
you can adjust the volume
of the speakers in a range
of 0 (Off) to 4 (Loud).

Sleep mode: Can be set


to turn off when it is not
being used. You can also
select the Never setting so
that the NXT remains on
until you turn it off.

Delete all programs: You are


able to delete the programs from four
subfolders: Software files, NXT files,
Sound files, and Try Me files.

VIEW

Select the icon of the


Sensor or Motor that you
want to test. You can only
get readings from one
sensor or motor at a time.

Select the port to which


the Sensor or Motor is
attached.

The data from the Sensor or


Motor appears on the
display.

TRY ME

Try Sound

Press the Light Grey


Arrow to the right to go to
Try-Sound program.

Make sure the Sound Sensor


is in port 2. Make sounds
into the Sound Sensor.

The program Loops


continuously so press the
Dark Grey button to
stop the program.

Rechargeable Battery

Outputs
3 Motor & 1
Lamp
(Port A, B, C)

Inputs
4 Sensor Inputs
(Port 1, 2, 3, 4)

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

8 Studs Long

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT
Wheel

Tire

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT
Wheel

Tire

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

Light Sensor

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

5 MINUTE ROBOT

ON

!
!
!
!
E

ROBOT CABLE CONNECTION


SENSORS
Port 1 Touch sensor
Port 2 Sound sensor
Port 3 Light sensor
Port 4 Ultrasonic sensor

MOTORS
Port B Left motor
Port C Right motor

NXT 2.1 PROGRAMMING

CREATE A FILE NAME

Give a meaningful file


name & click on Go
button

USER INTERFACE
Comment tool
Pan tool
Pointer tool

MOVE
RECORD/PLAY
SOUND
DISPLAY

Drag & Drop Icon To


Here

WAIT
LOOP
SWITCH

Types of pallet: common, complete and custom

NXT Window

Download & Run Selecte

Check Information In
NXT, battery level &
memory.

Selected block/program will


downloaded & run autonomous after
downloading finish.

Stop

Download

Download the program to


NXT.

Download & Run

Program will run autonomous


after downloading finish.

Whole program will


stop.

ROBOT MOVEMENT

STEERING CONTROL

HOW IS THE MOVEMENT FOR


ROBOT ?

DRIVE FORWARD

Place your robot on mat no. 2, starting position 1.

WAIT BLOCK

TIME TOUCHLIGHT SOUND DISTANCE

SENSORS
TIME

TOUCH

SOUND

LIGHT

DISTANCE

TOUCH SENSOR
Program a robot will drive forward until it detects
a touch, then stop.

TOUCH SENSOR

ULTRASONIC SENSOR
Program a robot will drive forward until it detects
a obstacle, then stop.

ULTRASONIC SENSOR

LIGHT SENSOR
Program a robot will drive forward until it detects
a black line, then stop.

LIGHT SENSOR

MULTI TASKS
Run a difference task at the same time.
Program will run in parallel sequence.
Useful for controlling different motor for different
task .

PARALLEL PROGRAM

Left click & drag from start to


another sequence bean .

MY BLOCK
You can create your own custom programming blocks.
Useful when developing complex programs.
Can re-use.

Before

After

CREATE MY BLOCK
1
2

3
1. Highlight selected
blocks.
2. Click Create My
Block Button.

DONE!!

1. Give a meaningful name to


new custom my block.
2. Give a description to this my
block.
3. Click on next button for
design the custom my block
icon.
4. Click finish to save the new
custom my block.

CUSTOM PLATTE

Your new custom My


Block created.

1. Select custom platte.


2. Select, drag & drop
the custom my block.

LINE FOLLOWER

0
DARK

50

100
LIGHT

ONE LIGHT SENSOR


Sensor does not detect the line.
The robot moves to the left.

On moving to the left, the


sensor detects the line.
Hence the robot moves to
the right.

On moving to the right, the


sensor is back on the surface.
Hence it moves to the left
again.

TWO LIGHT SENSOR


Sensor does not detect line.
The robot moves forward.

On moving forward, the left sensor


detects the line and right sensor
does not detect line. Hence the
robot moves to the left.

On moving forward, the right


sensor detects the line and left
sensor does not detect line. Hence
the robot moves to the right.

COMPLETE PALETTE

COMMON
ACTION
SENSO
R
FLOW
DATA
ADVANCED

The Complete Palette contains all the blocks in the


Common Palette, plus many more for more advanced
functions.

6 SECTIONS
Section 1: Common Section

Section 2: Action Section

Section 3: Sensor Section

Section 4: Flow Section

Section 5: Data Section

Section 6: Advanced Section

SPEED CONTROL

Sensor

Complete Palette

Motor speed can be control by sensor according the data


reading from sensor.

SOUND SENSOR

Sensor Section

Common Section

Power

Data Wire

ULTRASONIC SENSOR

Sensor Section

Common Section

Power

Data Wire

DISPLAY

SETTINGS
IMAGE

TEXT

DRAWING

RESET

DISPLAY IMAGE

Display a LEGO Minifig Head on screen.

DISPLAY IMAGE

REACT TO LIGHT & DISTANCE

REACT TO LIGHT

REACT TO DISTANCE

LIGHT SENSOR

Sensor Section

Common Section

Data Wire

Power

Drag steering until end so robot


will turn on a point & set
duration to unlimited to prevent
robot over the signal point.

ULTRASONIC SENSOR
Common Section
Sensor Section
Data Section

Data Wire

Change the ultrasonic unit to


centimeters.

Power

Change operation to subtraction


with A = value maximum for
ultrasonic sensor 255.

VARIABLE

Go Edit -> Define Variables

Click CREATE to make a new


variable.

Give a meaningful file name & select the


variable type Logic, Number or Text.
After done setting close the dialog box.

Drag & drop the variable block from


Data Section.
New variable appearing in variable list.
Select the variables that requested by
user.

LOOPING

BUMP COUNTER

Create robot that can detect input from touch sensor & display
total times touch sensor press by user on the NXT screen.

PROGRAM FLOW
Data Section

Action Section

Flow Section

Advanced Section

EXPLANATION

Set action to Read to read the value from variable.

SET DEFAULT=0

READ

COUNT +1 UPDATE

Set action to Text

CONVERT DISPLAY

Convert number to
text for display on
NXT screen

Define a new variable called


COUNT .
Change the action to write .
Set default value = 0.

Using math block addition


function.
Set value for B=1 mean every
time touch sensor press will plus

ROTATION SENSOR

Create a robot count how many rotation was robot make in a p

RESET ROTATION SENSOR


Common Section

Flow Section

Advanced Section
Sensor Section

Read total degree/ rotation make by motor B.


Reset motor B back to
default value=0.

CALIBRATE SENSOR

Create a robot calibrate the intensity of light.

Follow the grey line as the picture.

CALIBRATE LIGHT INTENSITY


Advanced Section
Sensor Section

CALIBRATE LIGHT INTENSITY


Advanced Section
Sensor Section

Set calibrate minimum or maximum valu

Set calibrate or delete.

Calibrate minimum

Calibrate maximum

Delete calibrate

Change the button to right button.

BLUETOOTH

Make a program allow two NXT communicate with each others.

COMMUNICATE WITH EACH OTHER

Common Section

Flow Section

Master: Send Message

Action Section

Slave: Receive Message

Waiting block change to Receive Message

Input must same for system compare.


Mailbox must same

OFFICIAL WEBSITE

nrc.sasbadi.com

lego.sasbadi.com

Facebook : Malaysia Lego Educa

You might also like