Hardware

Introduction

Learn how to use the various motors, sensors and other hardware.

Brick Sound

  1. The first block is a 'start' block.
  2. The next block plays the 'Fanfare' sound at maximum volume (100) until it completes.
  3. Then a 440 Hz tone is played for 1 second at full volume until it completes.
  4. Then a 'Boing' sound is set to play in a loop at full volumes.
  5. A timer makes the program wait for 3 seconds.
  6. Then the sound is stopped.

Brick Status Light

  1. The first block is a 'start' block.
  2. Then a timer makes the program pause for 2 seconds.
  3. The status light is turned on red and NOT blinking.
  4. A timer makes the program pause for 2 seconds.
  5. The status light is turned on orange and blinking.
  6. A timer makes the program pause for 2 seconds.

Brick Display

  1. The first block is a 'start' block.
  2. The 'Thumbs up' image is displayed with its top-left corner at position (0, 0) (the top left of the screen) after clearing the screen.
  3. A timer makes the program pause for 2 seconds.
  4. The text string 'EV3' is displayed at position (8, 5) on the text grid in black in the larger font after clearing the screen.
  5. A timer makes the program pause for 2 seconds.

Brick Buttons

  1. The first block is a 'start' block.
  2. A 'wait' block in mode 'Brick buttons - compare' waits until the EV3's 'Down' button has been pressed. The 'Button ID' parameter is not used.
  3. The 'Sad' image is displayed at position (0, 0) after clearing the screen.
  4. A 'wait' block waits until the EV3's 'Enter' button has been pressed. The 'Button ID' parameter is not used.
  5. The 'Sick' image is displayed at position (0, 0) after clearing the screen.
  6. A 'wait' block waits until the EV3's 'Up' button has been pressed. The 'Button ID' parameter is not used.
  7. The 'Smile' image is displayed at position (0, 0) after clearing the screen.
  8. A timer makes the program pause for 2 seconds.

Motors:

Large Motor

  1. The first block is a 'start' block.
  2. A large motor on port D is made to turn through one rotation at 50% power with the brake applied once the movement is complete.
  3. A timer makes the program pause for 1 second.
  4. The large motor on port D is made to turn through 360° (one rotation) at -50% power so it will turn backwards. The brake is applied once the movement has completed.
  5. A timer makes the program pause for 1 second.
  6. The large motor on port D is made to turn for 1 second at 18% power. The brake is applied once the movement has completed.

Medium Motor

  1. The first block is a 'start' block.
  2. The medium motor on port A is turned on at 12% power.
  3. A timer makes the program pause for 1 second.
  4. The medium motor on port A is turned off.
  5. A timer makes the program pause for 1 second.
  6. The medium motor is made to turn through 360° (one rotation) at 50% power. The brake is applied once the movement has completed.

Sensors:

It's a good idea to adhere to the convention that sensors should be connected to the numbered ports as follows:

1= touch 2 = gyro 3 = color 4 = ultrasound or infrared

Touch Sensor

  1. The first block is a 'start' block.
  2. A wait block in mode 'Touch Sensor - Compare - State' waits for a press of the touch sensor. The 'measured value' parameter is not used.
  3. The 'Ouch' sound is played at full volume until it completes.

Gyro Sensor

The gyro sensor is not included in the 'home' version of the EV3 kit, but is available for purchase as an optional extra.

Important: Keep the gyro sensor and EV3 very still when connecting the cable and during start-up of the EV3, otherwise the gyro sensor reading will wander away from the correct reading.

  1. The first block is a 'start' block.
  2. A wait block in mode 'Gyro Sensor - Change - Angle' waits for the angle to increase by 10° (clockwise). The 'Angle' parameter is not used.
  3. The 'Laser' sound is played at full volume until it completes.

Color Sensor: Color

When in color recognition mode the sensor is very fussy about colors - 'official Lego colors' (i.e. Lego brick colors) work best.

  1. The first block is a 'start' block.
  2. A wait block will work with a sensor on port 3. The color sensor in mode 'Color - Compare - Color' waits for the detected color to be equal to blue. The numeric 'Color' output parameter is not used.
  3. The 'Blue' sound is played at full volume until it completes.
  4. A wait block in mode 'Color - Compare - Color' waits for the detected color to be equal to red or yellow. The numeric 'Color' output parameter is not used.
  5. The 'Yes' sound is played at full volume until it completes.
  6. A wait block in mode 'Color - Compare - Color' waits for the detected color to be equal to 'No Color'. The numeric 'Color' output parameter is not used.
  7. The 'Thank you' sound is played at full volume until it completes.

Color Sensor: Light

  1. The first block is a 'start' block.
  2. A wait block in mode 'Color Sensor - Compare - Angle' waits for the angle to increase by 10° (clockwise).
  3. The status light is turned on orange and blinking .
  4. A timer makes the program pause for 3 seconds.
  5. The status light is 'reset' to its standard green blinking state that indicates that a program is running.

Ultrasonic Sensor

The ultrasonic sensor is included in the 'education' version of the EV3 kit but not in the 'home' version. The home version contains instead an infrared sensor which can be used to measure distance ('proximity') VERY approximately and it can therefore be used in place of the ultrasound sensor - see the next exercise.

  1. The first block is a 'start' block.
  2. A wait block in mode 'Ultrasonic Sensor - Compare - Distance Centimeters' makes the program wait until the ultrasonic sensor on port 4 returns a distance in centimeters less than 8.
  3. The 'Stop 1' image is displayed at position (0, 0) after clearing the screen.
  4. A timer makes the program pause for 2 seconds.

Infrared Sensor

The education version of the EV3 kit does not contain an IR sensor and therefore there are no exercises in the education version that use the IR sensor. This exercise, then, is for those of you that DO own the IR sensor (because you bought the home edition). This exercise is identical to the previous exercise except for the different sensor.

  1. The first block is a 'start' block.
  2. A wait block in mode 'Infrared Sensor - Compare - Proximity' makes the program wait until the IR sensor on port 4 returns a 'proximity' value less than 8. This is VERY ROUGHLY equivalent to a distance of 8cm.
  3. The 'Stop 1' image is displayed at position (0, 0) after clearing the screen.
  4. A timer makes the program pause for 2 seconds.