In this lab I apply a little bit of game theory. Students build an Arduino car using coding and wiring principles from all of the previous labs. I decided recently to add a leader board to this class as well, based upon similar success in other courses. I have students right now who are going back and completing this lab so that they can get on the leader board and take home some stickers that I created for those who get all the way to the end of the maze.
Lab 4-4 Autonomous Car
Putting it all together - Autonomous Arduino Car
If you want a chance at getting on the Bridgerland World Record Leaderboard, then here are the requirements:
Putting it all together - Autonomous Arduino Car
If you want a chance at getting on the Bridgerland World Record Leaderboard, then here are the requirements:
- You must run your car through the maze at Bridgerland, and your car must start on the Starting Yard Goat sticker.
- It must go through the maze in it's entirety. (Note, it does not have to stop on the last Yardgoat, but it does need to roll over it.)
- You can not cross walls or pipes at any time. You can hit them but can't drive over them.
- Your car must touch each Yard Goat sticker at least once.
In this lab you will learn the following:
Hints:
Running the motors for a certain amount of time: Remember, once you set an output to a certain value, it's not going to change until you change it. So you set a motor to a certain value, then do a delay for a certain amount of time. Then turn the motors off or Brake.
Detecting Walls: If you choose to navigate the maze using a sensory, you may consider the Infrared Sensor (IR). An IR sensor measures distance. You have not used an IR Sensor yet, but it's no different than using any of the other analog sensors you have used already. Reading an IR sensor is basically the same as reading any other analog sensor. You can try it out using the POT code found in Lab 1-4 analogRead POT to see the values you're reading of the the IR sensor. Once you have readings off of the sensor you can base the logic off of the numbers that you are seeing.
Lab Submission:
***Failure to complete ALL elements of the lab will result in an incomplete for the entire lab. Asking if it's "good enough" or "can't I just skip that one thing" will result in a fail for the lab. If there is a legitimate problem with the lab, contact your instructor immediately.
Videos:
- This is where we put it all together. You should have all of the things you will need to build a car that runs by itself.
- Watch the videos below and setup your board.
- Build your code based upon principles learned in other labs. For example you might want to review things you have learned in 4-2 H-Bridge lab.
- Run your car through a maze. It needs to make at least two turns accurately and can not drive over walls for full credit. Anyone who wants to bring their car to our annual tournament held in April for a chance to win big prizes is welcome to do so. (Your car will need to be able to do more than 2 turns to win however)
Hints:
Running the motors for a certain amount of time: Remember, once you set an output to a certain value, it's not going to change until you change it. So you set a motor to a certain value, then do a delay for a certain amount of time. Then turn the motors off or Brake.
Detecting Walls: If you choose to navigate the maze using a sensory, you may consider the Infrared Sensor (IR). An IR sensor measures distance. You have not used an IR Sensor yet, but it's no different than using any of the other analog sensors you have used already. Reading an IR sensor is basically the same as reading any other analog sensor. You can try it out using the POT code found in Lab 1-4 analogRead POT to see the values you're reading of the the IR sensor. Once you have readings off of the sensor you can base the logic off of the numbers that you are seeing.
Lab Submission:
- Create a video of your car running the maze and making its turns, and upload into canvas as a VIDEO SUBMISSION. You should start by talking directly into the Camera so that I can verify that it's you. Your video should take no more than 120 seconds.
- Please submit your code from this project as a TEXT ENTRY. In your own words, use comments to write your explanation for each section in your code.
***Failure to complete ALL elements of the lab will result in an incomplete for the entire lab. Asking if it's "good enough" or "can't I just skip that one thing" will result in a fail for the lab. If there is a legitimate problem with the lab, contact your instructor immediately.
Videos:
Powering Your Car
H-Bridge - Additional Explanation
IR Sensor
Bridgerland Maze: