Lego Mindstorms EV3 Essentials

5 (1 reviews total)
By Abid H. Mujtaba
  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Introducing EV3

About this book

Building robots from scratch can be a tough task, but the Lego Mindstorms EV3 robotics kit makes it easy to create them in minutes. Far more than a toy, the programming brick allows you to create functional robots while its open source and hackable nature will allow you to use the powerful LeJOS framework to create projects of increasing complexity.

This book provides a rapid and practical guide to building with EV3. Get up and running and swiftly learn how to construct and program automated robots using the EV3's brick, motors, and sensors. Next, you'll construct an obstacle-avoiding robot and learn how to program the EV3 brick before moving on to the advanced possibilities of the LeJOS framework. You will also learn how to install LeJOS, link your computer to EV3, and how to use it to program your Lego robots in Java. You will then quickly get to grips with using LeJOS by constructing an autonomous line-tracking robot. By the end of this book, you will be able to unleash the full creative power of Lego Mindstorms EV3.

Publication date:
October 2014


Chapter 1. Introducing EV3

EV3 is the third generation of the Lego Mindstorms robotic series. It consists of a programmable brick, a wide assortment of blocks from the Lego Technic line, and an impressive array of sensors and motors. Put together and programmed correctly, these result in a stunning variety of robots whose function and complexity is limited only by your imagination.

EV3 provides a smooth entry into the fascinating world of robotics. By providing motors and sensors that are guaranteed to work and Technic pieces that enable flexibility in construction, it allows you to focus on the core of robotics: building and programming.

In this chapter, we will cover the following topics:

  • Components of EV3

  • Differences between the Home and Education sets

  • An overview of the brick

  • Menu navigation

By the end of this chapter, you will be familiar with the components of EV3—in particular, the brick that acts as the brain of your robot. You will have turned it on and navigated its menus, taking your first steps along the path to robotic mastery.


Presenting EV3

In 1998, Lego, already a household name thanks to their sets of build-it-yourself toys, took the world by storm when they launched the Robotic Invention System: a set consisting of a programmable brick that can be connected to a small collection of sensors and motors. It was programmed using a simple visual programming language in which you connect a series of icons to control the flow of logic and consequently, the behavior of the robot.

Faced with the continual and overwhelming popularity of the customizable and programmable robot, Lego has kept releasing new generations of the robotics kit under the name Mindstorms, each one with better brick hardware, streamlined software, and an increased number of sensors and motors.

The Mindstorms series has been unique in the interest it has engendered in robotics enthusiasts. They have taken a child's toy and made it their own, and in the process, they have created an awe-inspiring collection of robots that even Lego could not have imagined.

EV3 was designed with this fact in mind. It is intended as both a toy for children and a robotics set for serious roboticists. It is the first release to run Linux and have its code released as open source ( Lego built EV3 to be truly hackable, and they have not disappointed. Its open nature has allowed enthusiasts to create their own firmware and toolsets, allowing it to be programmed using a variety of languages (C, Java, Lua, and so on). In the latter half of the book, we will cover one such toolset and use it to create robots of considerable complexity.


Introducing the EV3 components

The parts that come in an EV3 package (Home or Education) can be broadly classified into four categories: brick, motors, sensors, and Technic pieces.


The brick is both the power source and the control center of the robot. All of the motors and sensors are attached directly to the brick and are controlled by it. The brick is described in greater detail in the An overview of the brick section of this chapter and is illustrated in the following image:


EV3 comes with one medium and two large (high-torque and high-precision) motors. The motors can be operated in two modes: they can be run at a constant speed or rotated through a fixed angle. In both modes, the motors can be queried for their current angular position, which enables motors to function as both input and output devices. Motors are described in greater detail in Chapter 2, Sensors and Motors. In the following figure, the large motor is on the left and the medium motor is on the right:


EV3 comes with a variety of sensors that provide the robot with information about its environment. The sensors that are common to the Home and Education sets are:

  • Touch sensor

  • Infrared sensor

  • Color sensor

The Education set additionally comes with ultrasonic and gyroscopic sensors. These sensors are described in detail in Chapter 2, Sensors and Motors.

Technic pieces

Technic is a Lego series primarily consisting of slotted beams and pins designed for 3D construction with particular emphasis on allowing rotation. Technic pieces are the most numerous component of the EV3 package and bear primary responsibility for the actual construction of a robot.

Along with a variety of slotted beams and pins, the EV3 package contains axles, gears, crossbars, wheels, tracks, and a number of decorative pieces among others, as shown in the following image:

The EV3 brick has been designed with slots built into three of its sides (the bottom, left, and right faces), which allow it to be attached directly to other Technic pieces and thus incorporated into the body of the robot.

The construction of a robot consists of situating the brick, using Technic pieces to build the body around it, and then attaching motors and sensors at strategic locations. It brings back the sheer childhood joy of playing with Lego.


Differentiating between the Home and Education sets

EV3 comes in two versions/sets: Home (for children and enthusiasts) and Education (for teachers and students). There are very minor differences between the two sets, as detailed in the following table:

Home set

Education set

Requires 6 AA batteries

Has a rechargeable battery pack

IR remote controller


1 touch sensor

2 touch sensors


1 ultrasonic sensor


1 gyroscopic sensor

There is also a minor difference when it comes to software, both internal and external. The two sets come with slightly different firmware, with a few components missing from one or the other.

Lego intends the stock EV3 to be programmed using a visual programming language running on either a Windows machine or a Mac. This programming suite does not run on Linux. The latter half of this book is dedicated to ways for overcoming this shortcoming with a much more powerful substitute.

All in all, there is not much that separates the two sets. Additional components can be purchased online to achieve parity between the two. Either set can be used to construct a stunning variety of robots.


An overview of the brick

The EV3 brick is basically a standalone computer (an embedded system) running Linux. It contains a 300 MHz ARM9 processor, 64 MB of RAM, 16 MB of internal flash memory, and an SD card slot that supports up to 32 GB of external memory. These hardware specifications paired with the Linux OS are a powerful mix, allowing unparalleled hackability.

Let's review the external features of the EV3 brick.

The front face

The front face (shown in the following image) consists of a 178 x 128 pixel LCD screen, six buttons, and a set of LEDs. Four buttons are set in the familiar diamond pattern and are used for navigating the menu. The center button is basically the Enter key, used for selecting a menu item, while the key in the top-left is the Back (or Escape) button. In addition to their use in menu navigation, these keys can be programmed to become inputs for a constructed robot.

Similarly, the LEDs, primarily used to indicate the state of EV3, can be programmed and used as an output. The components of the front face are illustrated in the following image:

The back face

The back face gives access to the batteries (in the Home set) or the rechargeable battery pack (in the Education set). It also features 12 slots to which Technic pieces can be attached using Technic pins, as shown in the following image:

The top face

The top face of the brick has four ports, dedicated to motors. Motor ports are labeled using the letters A through D. Each motor is attached to the brick using an RJ12 connector cable (similar to the ones used for telephones and modems, but with six pins). EV3 comes with a selection of such cables of varying lengths. In addition, the top face houses the micro-USB port that is used to connect EV3 to a computer. It is used to access EV3 and transfer programs to it as well as connect up to four EV3 devices together to work in concert, a process known as daisy chaining. The four motor ports and the micro-USB port are shown in the following image:

The bottom face

The bottom face has four ports, dedicated to sensors. Sensor ports are labeled using numbers 1 through 4. RJ12 connectors are used to connect the sensors to the EV3 brick, as shown in the following image:

The left face

The left face houses a USB port, an SD card slot, and 10 Technic slots, as shown in the following image:

The USB port is used to connect various USB devices, such as USB drives and Wi-Fi dongles, to EV3. Additionally, the USB port can be used to connect multiple EV3 bricks together (the USB port of one EV3 is connected via a cable to the mini-USB port of the next) to form a daisy chain. Up to four EV3 bricks can be chained in this fashion and can be made to function as a whole.

The SD card slot is used to extend the memory of the brick. EV3 supports SDHC microSD cards up to 32 GB in size. EV3 SD card support is an extremely useful feature since it allows us to run custom firmware on EV3 without having to modify its internals.

The right face

The right face contains 10 Technic slots and a speaker, as shown in the following image. EV3 comes with a number of built-in sounds that can be accessed programmatically and incorporated into the functionality of a robot. In addition, EV3 can play custom audio files that are placed in it by connecting to a computer:


Navigating the menu

To turn on EV3, insert the batteries (or the battery pack in the case of the Education set) and then simply press the Enter (center) button. The LEDs light up red, and the LCD displays MINDSTORMS Starting.... Once EV3 has finished booting up (which can take up to 30 seconds), the LEDs turn green, a small welcome sound is played, and the top-level menu is displayed.

EV3's menu consists of a top bar and a larger bottom section. The top bar displays information about the EV3 and is visible in all the menus. It displays the connection status of the device (USB, Bluetooth, and/or Wi-Fi) and the charge remaining in the battery.

The top-level menu has four tabs. You can navigate between them using the Right and Left buttons. The Up and Down buttons help you to move between items in the current tab. Press Enter to choose an item and press Back to go back one level in the menu hierarchy. The four tabs are discussed in the following sections.

The Recent Programs tab

The Recent Programs tab shows a list of the recently executed programs, as shown in the following figure. To run a program, simply navigate to it using the Up and Down buttons and press Enter. Pressing Back exits the program:

The File Browser tab

The File Browser tab shows the directory structure of the brick. Use the Enter key to expand a folder and show its contents. Audio files can be played and programs can be executed by navigating to them and pressing the Enter key. If the EV3 is connected to a computer, it will ask you whether a program should be executed or copied to the computer. The following figure shows the File Browser tab selected and displaying the contents of the brick:

The Apps tab

The Apps tab shows a list of the applications currently installed on the EV3. The following image is of a Home set and contains an IR Control application that is used to interface with the IR remote controller.

The Port View application allows you to view data from sensors in real time. The Motor Control application can be used to control motors directly, and the Brick Program application can be used to program your robot on the brick itself.

These applications are an excellent means of learning about EV3 and its components. We will cover them in greater detail in Chapter 2, Sensors and Motors, and Chapter 3, EV3 Brick Programming.

The Settings tab

The last tab is Settings. You can use it to change the speaker volume, the length of time that has to elapse before the EV3 turns itself off (to conserve battery power), to enable/disable Bluetooth and Wi-Fi, and to get information about the brick, such as hardware, OS versions, and the amount of free memory remaining, as shown in the following screenshot:

Turning off EV3

To turn off EV3, press the Back button repeatedly until you arrive at the first tab of the top-level menu. Pressing Back once again will display a prompt, asking the user whether they want to power off the device. Select the tick icon for yes and EV3 will shut down. Similar to any computer, it will take a few seconds to do so.



In this chapter, we got acquainted with EV3, including its brick, motors, sensors, and Technic pieces, and learned about the minor differences between the Home and Education sets. We successfully turned the brick on, navigated the top-level menus, and shut it down.

These tentative first steps are the precursors to a greater understanding that leads to the construction of fully functioning robots.

In the next chapter, we move closer to this goal by learning about the sensors and motors that come with EV3.

About the Author

  • Abid H. Mujtaba

    Abid H. Mujtaba is an electrical engineer and a theoretical physicist by training, and an Android developer by profession. He spends most of his working and free time tinkering around with Linux, electronics, and various programming languages.

    Browse publications by this author

Latest Reviews

(1 reviews total)
útil y práctico para ir un paso mas adelante con EV3
Book Title
Access this book, plus 7,500 other titles for FREE
Access now