Module:3 Sensors Programming Module Objectives Understand the use

Module:3 Sensors Programming Module Objectives  Understand the use

Module:3 Sensors Programming Module Objectives Understand the use of sensors. Program and use a touch sensor. Program, calibrate and use a Sound sensor. Program, calibrate and use a Light sensor. Program and use an ultrasonic sensor.

Program and use a Rotation sensor. Program and use the NXT buttons as a sensor. Use the Calibrate sensor block to calibrate sensors. Module Contents Sensors LEGO MINDSTORMS NXT Sensors Programming Palette Blocks for Sensors

Learning Tasks -1 (Touch Sensor) Learning Tasks -2 (Sound Sensor) Learning Tasks -3 (Light Sensor) Learning Tasks -4 (Ultrasonic Sensor) Learning Tasks -5 (Rotation Sensors) Learning Tasks -6 (NXT Buttons) Learning Tasks -7 (Sensor Calibration) Sensors Sensors are the robot senses which

help the robot to sense the environment Definition: Sensors could be defined as an electronic device used to measure a physical quantity such as temperature, pressure or loudness and convert it into an electronic signal. Different types of sensors

Lego Mindstorms NXT Sensors Touch Sensor. Sound Sensor. Light Sensor.

Ultrasonic Sensor. Programming palette blocks for Sensors Common Palette: wait, loop and Switch blocks could use the sensor readings. Complete Palette: it has the common palette block with the

blocks mentioned above, the flow and the Sensor blocks. Custom Palette: can create a program and save it to be used as a single block later. Sensor Block The blocks in the table above are used to adjust the sensors and view the possible readings ranges

Touch Sensor Sound Sensor Light Ultrasonic Sensor Sensor

NXT Buttons Rotation Sensors Timer Receive

message Flow Block The flow block icons are mainly conditional blocks waiting for a certain reading or input from the sensor, looping until a certain sensor reading, switch between two actions depending on a sensor reading Wait

Loop Switch Stop Touch Sensor Block: 1. NXTs port to which sensor is connected 2. This icon will show which action will send a

true signal (Bumped, Pressed, or Released). 3. Blocks data hub: A data wire must be dragged from the blocks output plug to another blocks data hub. Configuration panel Port Action Feedback box

Wait: Touch sensor Block Waits for an action or sensor reading to perform a task Port Action Configuring Wait - Touch Sensor Block

Control Sensor Port Action

Feedback Box Conditional and Unconditional Loop Repeats a code sequence without any condition (forever)

Repeats a code sequence based on certain condition Loop Touch Sensor Block Repeats a code sequence based on a condition, for example a sensor. 1. NXTs port 2. This icon will show which action will

send a true signal (Bumped, Pressed, or Released). 3. Showing an icon for the chosen sensor 1 3 2

Configuring Loop - Touch Sensor Block: If you choose Touch Sensor, the programming blocks within the loop will repeat until a touch sensor is bumped, pressed, or released 1. Port 2. Until 3. Feedback Box

4. Counter- allows you to use the number of completed loops as an input elsewhere in your program Switch Touch Sensor Block Chooses between to code sequences based on a value or a sensor. Control: Sensor. Sensor: Touch Sensor. Example

1. This icon indicates the sensor or other condition that will cause the block to choose between the two rows of programming blocks. 2. The upper blocks will run if the touch

sensor is pressed. 3. The lower block will run if the touch sensor is not being pressed. Configuring Switch - Touch Sensor Block

Choose this control property if you want the condition of a touch sensor to determine which way your program will switch. 1. Flat View 2. Port 3. Action Flat View Switch block will use a tabbed

interface to show the alternative sequences of programming blocks. Touch Sensor- Task-1 Action Pressed Released Bumped

!!Feedback box / color / reset Touch Sensor Task-2 Control a motor using a touch sensor; run the motor when the touch sensor is pressed. Sound Sensor Block: 1. NXTs ports

2. level the trigger point is set. 3. The blocks data hub will open automatically when the block is attached to a sequence beam. At least one data wire must be dragged from the blocks output plug to another blocks data hub. Configuring Sound Sensor Block:

1. Choose the port 2. Use the slider to set the trigger value or type a value directly into the input box. 3. The feedback box displays the current sound reading (0-100%). Blocks Data Hubs & Wiring: Data wires carrying input information to a block are connected to the plugs on the left side of its data hub.

Data wires carrying output information are connected to the plugs on the right side as shown in the figure below. Blocks Data Hubs & Wiring: [A] Input plug [B] Output plug [C] Number data wire (yellow) [D] Logic data wire (green) [E] Text data wire (orange)

[F] Broken data wire (gray) --error your program wont run if you have gray wires. Important Points Note: when connecting blocks hubs to each other (wiring) be aware that you connect as follows: Data plug to Data plug. A number data to a number data. Logic data to logic data

Text data to text data Otherwise youll get the gray broken wire which indicates an error, where your program will not run. Sound Sensor :Tasks-1 Compare Feedback box values Loud

> 25 <80 >50 Medium soft Sound Sensor :Tasks-2

Use wiring and switch block to do the following: If the sound detected by the sound sensor is higher than 50 the NXT brick will generate a sound saying you are good If the sound detected is less than 50 the sound

generated will be Woops Light Sensor Block: 1. NXTs ports. 2. This icon indicates at what level the trigger point is set. 3. This icon is displayed if Generated Light is turned on. 4. The blocks data hub will open

automatically when the block is placed in the work area. Configuring Light Sensor Block: Choose the port Use the slider to set the trigger value or type a value directly into the input box. If you check the Generated Light checkbox, the light sensor will turn on its own small light source

and detect this light if it is reflected back to it. feedback box displays the current light reading (0100%). Light Sensor Task-3 Without Generate Light option Feedback box values Black Green

Red Yellow With Generate Light option Feedback box values Black Green

Red Yellow Light Sensor Task-3 Color Action Forward Backward

Stop Black Green Yellow Calibration (Adjusting): Calibration is the process of

adjusting a device or a sensor knowing its standards, limits and responses. Sensor Calibration is the relationship between input and output for a given measurement. Ultrasonic Sensor This block can detect objects at a

maximum range of about 250 cm (or 100 inches). NXTs port Shows whether the ultrasonic sensor is set to detect objects nearby or farther away. The more colored bars, the farther away the detection. Data hub

Configuring Ultrasonic Sensor Block Port Radio button left radio button right radio button Select to read values in Centimeters or Inches. The feedback box

Ultrasonic Sensor: Tasks Measure the distance with the following setting and observe the reading in the feedback box Compare Feedback box values 0-2 cm

> 25 <80 >50 100 cm 200 cm 300 cm

Ultrasonic Sensor: Task-2 Create a program that does the following: Runs a motor forward duration unlimited. Using a switch block & Depending on the Ultrasonic sensor reading: Distance is almost zero (02cm)--close: Stop the motor, play a sound (file: Ouch 02) and

run backward. If distance less than 50: forward at power of 40. If more than 50 cm: forward Ultrasonic Sensor: Task-2 Distance <10 cm close to the table surface

<50 cm > 50 cm make it far Action Rotation Sensor The rotation sensor is a built in sensor inside each Motor, so it is not visible where the rotational feedback from these sensors allows the NXT to

control movements very precisely. This block counts the number of degrees (one full rotation is 360 degrees) or full rotation that your motor turns Rotation Sensor NXT port the Rotation Sensor block will be monitoring.

This icon will show whether the block is counting in rotations or degrees The blocks data hub Configuring Rotation Sensor Block Port you would like the block to monitor (A, B, or C). To read a rotation sensor's current value or to reset a sensor's value back to zero. Set the direction you want to monitor using the radio buttons: forwards or backwards.

Number of rotations or degrees. Trigger value The feedback box will show the current count in Rotation Sensor Forward (positive) direction Black-colored text for rotations or degrees; Backward (negative) direction

it will be in red-colored text rotations or degrees. Wait block: Rotation Sensor Loop Block: Rotation Sensor Switch Block: Rotation Sensor Rotation Sensor: Task

Rotate the Motor Manually forth and back and observe the readings, what kind of readings are you getting Program Build your program to do the following:

Let the motor run forward for 3 rotations. Stop the motor. Wait for 3 seconds. Reverse your motor direction for 720 degrees. NXT Buttons Block The NXT button (three: Orange (Enter Button) and the triangular buttons) can be used as sensors in your

program, for example you can stop a motor if the orange button is pressed NXT Buttons Block The icon at the bottom of the block indicates which NXT button has been selected. The blocks data hub Configuration Panel

NXT button Action The feedback box Tasks: Monitor the NXT button selected through the feedback box. Fill the following table when the button is pressed. Button/ Action Pressed Enter Right

Left Released Bumped Program Create a program that uses the Enter button (orange) to run a motor forward and backward it as follows:

Wait for the orange button to be pressed to run the motor forward for 5 seconds. Wait for the orange button to be pressed again to run it backward for two rotations. Sensor Calibration Use this block to calibrate the minimum (0%) and maximum (100%)

values detected by a sound or light sensor. Calibaration Block Data hub will open automatically when the block is placed in the work area Configuration Panel Choose the port that the sensor is connected to.

Select whether you are calibrating a Sound Sensor or a Light Sensor. With this pull-down menu, choose to either calibrate a new value or delete a previously set value. Use the radio buttons to set either the maximum or minimum value of the sensor. Tasks:

Value Minimum Maximum Result

Recently Viewed Presentations

  • Leveraging Enterprise gis for local government

    Leveraging Enterprise gis for local government

    Collector is a wonderful app for field collection, however for non-GIS folks, it can intimidating. Additionally, Collector only works with ArcGIS Online organizational accounts. Survey 123 can be used via ArcGIS Online organizational accounts or as an anonymous user (public).
  • BELL RINGER  What are some examples of Demand

    BELL RINGER What are some examples of Demand

    A complementary good is a product that is used or consumed jointly with another product; tennis rackets and tennis balls are one example. There are many other examples ofcomplementary goods. Hot dogs and hot dog buns, e.g. If you buy...
  • Session title Christopher Murray and Neil Currant, Differences

    Session title Christopher Murray and Neil Currant, Differences

    Session title Christopher Murray and Neil Currant, Differences in e-portfolio success!, Starting from scratch versus ready-made materials University of Leeds and University of Bradford
  • Chapter 1 Linear Equations and Graphs

    Chapter 1 Linear Equations and Graphs

    From this, we conclude that there are no solutions to the linear system. Matrix Representations (continued) Case 3: dependent When there are fewer non-zero rows of a system than there are variables, there will be infinitely many solutions, and therefore...
  • COACHING HD WINNING THE FOOTBALL CLASSROOM WITH TECHNOLOGY

    COACHING HD WINNING THE FOOTBALL CLASSROOM WITH TECHNOLOGY

    GAME IS CHANGING (ADAPT) -gets football coaches out of their box, speed of the game, rules, complexities. TIME LIMITATIONS - Contact with players can be maximized, get players interacting with material when they are comfortable. Repeatable process increases efficiency
  • Developments in the Global LNG Market - Would Venezuelan LNG ...

    Developments in the Global LNG Market - Would Venezuelan LNG ...

    GLOBAL DYNAMICS OF LNG BUSINESS GIE ANNUAL CONFERENCE JEAN VERMEIRE President GIIGNL GRONINGEN 6-7 MAY 2009 Presentation of GIIGNL The International Group of LNG Importers, better known by its French acronym GIIGNL, is a non-profit organisation which was established in...
  • 20th and 21st Century Classroom Management Pioneers

    20th and 21st Century Classroom Management Pioneers

    20th and 21st Century Classroom Management Pioneers By Discipline through Assertive Tactics Lee and Marlene Canter Believed teachers should be in charge of their classrooms by being "calm, insistent and consistent" in their interaction with students Developed the idea of...
  • Protocol I Timeline - Jaeb

    Protocol I Timeline - Jaeb

    Background: Protocol I. Previously reported intravitreous ranibizumab with prompt or deferred laser more effective through at least 2 years compared with laser . 3-year comparison of ranibizumab groups concluded prompt laser was no better and possibly worse than deferred laser