NXT Pit Viper - Lesson Planx - K12Lab

thunderclingAI and Robotics

Nov 13, 2013 (3 years and 4 months ago)



Snakes that belong to the pit viper family are named for the heat
sensing organs located near the eyes,
known as pits. This allows pit vipers to quickly and accurately find their prey. While our robot won't
strike within milliseconds, it can find prey usin
g its own Vernier Surface Temperature Sensors as pits.

In this exercise, we will build an NXT pit viper that will mimic the behavior of the real animal. We will
use two Vernier temperature sensors to monitor the air, much in the same manner that a pit vip
senses the temperature of its surroundings.
Close by, we will place a metal can filled with hot water.
The mechanical viper will move toward the high temperature, until it is situated in prime attacking
position. Once there, it will strike down, thr
owing its two claws around the can.


Upon completion of this lab, students should

Have a deeper understanding of how we can use robotics to model and
understand the
behaviors of living organisms

Understand how we can control robot behavior

based upon feedback from its surroundings

Have a better understanding of more complicated robotic systems

Know how to

LabVIEW VI’s and subVI’s to get a good idea of what a program does



Gather the necessary materials for this lab. You wil
l need the following:


Small aluminum can (the video example uses V8)


Hot Water

the higher the temperature, the easier it will be for the robotic viper to
sense its prey


NXT Lego Mindstorms kit


Two Vernier temperature sensors


Two Vernier motors


NXT roboti
c base


Open up Pit Viper.vi and examine the block diagram. Double click the NXT subVI’s and examine
their contents. If those VI’s have more subVI’s in them, the keep going down each level and go
through each one so you understand what they do. The top
level VI has description labels in it,
but as you go down through the layers, you will need to decipher each VI’s purpose on your


Build your pit viper with your NXT block and Legos.


Since the viper will not be moving its base

only its “head”


can create a stable
base for it like the one shown in the video.


Open the attached .lxf
file. To do so, you will need to have Lego Digital Designer
installed on your computer.
You can download LDD from the Lego website here:

Use the arrows on the top, bottom, left, and right side of the window to rotate
the robot

Use the zoom option at the bottom of the screen to get closer looks at the


Examine the file and build your robot as it is constructed in the .lxf file
. Make sure that
the temperature sensors are attached to the front
end, mobile extension, so that they
move with the motor.

This model was built using three 40
tooth gears to alter the gear ratio. Each NXT
kit only comes with two 40
tooth gears, so you may need to substitute the turntable for
the 40
tooth gears if you only own one kit. The last photo uses a turntable


Test your robot. Load the VI onto your NXT p
latform and place the robot within sensing
distance of the aluminum can. Fill the can with hot water, and then start the NXT program.
Observe how the robot “head”
moves to determine where the heat source is located. When the
head is centered on the can,

it will drop down like a pit viper attacking its prey.


Run several different tests on the robot, with a can containing cooler and hotter water.
How does this affect the time to attack?


Try running a test during which you move the can before the viper is
aligned to attack.
What happens when the “prey” changes locations while the program is running?


Notice how short the intervals of rotational movement are when the robot is trying to
locate the prey. What would happen if you increased the intervals of mo


We used three 40
tooth gears in our current setup to set the gear ratio. What would
happen if we expanded and added another gear, but kept the motor intervals the same?
What if we removed a gear


Take some time to think about what you accomplished during this exercise. You built a
feedback system that scans its environment and then takes action based on the data it receives.
This type of system is actually quite prevalent in a number of differe
nt industries.

For example,

MRI (magnetic resonance imaging) machines
, which

take very detailed
images of internal body parts, such as your bones or your brain. They capture the images by
scanning slivers of the area under inspection, one at a
time. Like the Pit Viper robot, the MRI
scanner scans an area, takes data, and then scans a different area.

Can you think of any other real
life systems that utiliz
e this scan and response

(either with
physical respo
nse or data collection/updates)?