STEAM DISCOVERY LAB
  • About
  • Tools
  • Projects
  • Resources
  • About
  • Tools
  • Projects
  • Resources
Search

EV3 Race Car

Picture

​Lesson Objectives:
  1. Students will build a controllable robotic car.
  2. Students will use Python to program the car movement.

​Materials:
  • 1 ultrasonic sensor
  • 2 touch sensor
  • 1 color sensor
  • 2 large motors
  • 1 medium motor
  • EV3 brick with Wifi dongle and SD card (you should have access to the EV3 IDE)
  • Any other LEGO parts you need to build the car
Click here for the build instructions
Let's Get Started!

​Note: This requires a lot of parts!
Click on the link above and follow the detailed instructions to build the race car.

Once the hot rod racer is complete, we can begin programming how to make it move. In this particular example, the movement is controlled via an activation key and 2 touch sensors that move the car left and right. The activation key is is composed of an orange colored lego brick and a color sensor. If the color sensor is reading the orange brick the car moves, if not then it stops. This allows for easy stop and play functionality. 

First, define all sensors and motors. Then program the EV3 to move forward while the color sensor is reading the orange brick. In the same while loop program the EV3 to move left if one of the touch sensors is pressed and right for the other. Explore the snippets on the right side of the IDE to come up with this code.

Given below is an example program. When touch sensor 1 is pressed motor A rotates clockwise, when touch sensor 2 is pressed motor A rotates counter clockwise! Try changing which touch sensor makes the car go left and which one make the car go right!

    
Here is a cool video of how the car works using the code above.
Picture
200 Boston Ave, Medford, MA 02155
steamdiscoverylab@gmail.com
Center for Engineering Education and Outreach
​Tufts University
About
Tools
Projects
Resources
​
Contact
LEGO®, the LEGO® logo, the Brick, MINDSTORMS®, and the Minifigure are trademarks of ©The LEGO® Group. On some parts of this site  you will get access to so-called “developer software”, which offers documentation on different ways to operate the LEGO® Education SPIKE™ Prime Hub and technology. Whatever use you make of the developer software, bear in mind that the results are not experiences that the LEGO Group endorses, is with or will be liable for. No rights in or to trademarks of the LEGO Group are implied or given, and you may not apply to or register any protection anywhere in the world for intellectual property or industrial rights or similar in respect of any developer software, derivative or other result achieved through its use. The developer software is made available “as is” and, to the extent possible, no warranties or representations are implied or given in relation to it by the LEGO Group. It’s your responsibility to ensure all uses that you make and enable others to make comply with all applicable laws and best practices. By accessing the developer software, you acknowledge that the terms and conditions set out above and in LEGO Education’s terms of use for SPIKE Prime apply.
  • About
  • Tools
  • Projects
  • Resources