← Back to Unit 2

Week 3: Sensors, Decisions, and Treasure Hunting

YEAR 9 DIGITAL TECHNOLOGIES • WEEK 3

Sensors, Decisions, and Treasure Hunting

This week your robot begins to react to the world around it. You will use the Optical Sensor so your Simple Clawbot can detect cube colour, make decisions, and collect only the red Treasure Cube.

Used each lesson: Simple Clawbot with Optical Sensor, battery, controller, device with VEXcode IQ, field tiles, IQ cubes, and your engineering notebook.

💻 VEXCODE HELP

If you need help installing VEXcode, connecting your robot, configuring devices, downloading a project, configuring the Optical Sensor, or finding the Help tools inside VEXcode, use the internal VEXcode reference page first.

Open the VEXcode setup and help page
🎯 THIS WEEK
  • add and configure the Optical Sensor
  • use intermediate blocks such as [If then] and [Repeat]
  • make the robot decide what to do based on cube colour
  • complete the Eye Spy Treasure practice activity
  • attempt the Treasure Mover Challenge
  • use Python as an extension pathway after your block logic is working
📘 ENGINEERING NOTEBOOK

Your engineering notebook is required in every lesson.

  • record sensor setup, path plans, tests, fixes, and results
  • show how your robot used colour information to make decisions
  • keep adding to your table of useful robot commands
✅ BY THE END OF WEEK 3
  • your robot should be able to use Optical Sensor feedback
  • your code should include decision logic, not only fixed movement
  • your notebook should show testing with different cube positions
  • you should be able to explain how a block decision connects to Python if logic
📌 IMPORTANT
  • Do not test the full challenge before the sensor test works.
  • Do not change cube position, speed, path, and claw timing all at once.
  • Start the robot from the same position every time when testing.
  • Make sure the Optical Sensor is configured before using sensor blocks.
🐍 PYTHON EXTENSION PATHWAY

Most students will complete the main tasks using intermediate blocks. If your block project is working reliably, you may move into Python as an extension.

Your Python goal is not to start again from zero. Your goal is to translate a working block decision into Python and explain how the logic matches.

Lesson 1: Learn the Optical Sensor
📝 TODAY'S RECORDING

Record what the Optical Sensor can detect, how it is configured, and one example of how sensor information can control a robot decision.

🔧 WHAT TO DO
  1. Open the Lesson 3 Introduction so you understand this week’s Treasure Hunt problem.
  2. Open the Optical Sensor Overview and identify the three things the sensor can report.
  3. Add the Optical Sensor to your Simple Clawbot if it is not already attached.
  4. Open the correct Simple Clawbot template in VEXcode IQ.
  5. Configure the Optical Sensor in the correct port.
  6. Use the Brain Dashboard or VEXcode tools to check whether the sensor can detect a cube.
  7. Test the sensor with a red cube and with a non-red cube.
  8. Open the [If then] block resource and identify what happens when a condition is TRUE or FALSE.
  9. Open the [Repeat] block resource and identify how repeated actions can make code more efficient.
  10. Complete the Learn Check Your Understanding questions if your teacher asks you to.
✍️ WHAT TO WRITE IN YOUR ENGINEERING NOTEBOOK
  1. Write the date and lesson title: Lesson 1 - Learn the Optical Sensor.
  2. Write what the Optical Sensor can detect.
  3. Record the port used for the Optical Sensor.
  4. Record what happened when the sensor checked a red cube.
  5. Record what happened when the sensor checked a non-red cube.
  6. Write one sentence explaining how a sensor condition works like an if statement.
  7. Add Optical Sensor, [If then], and [Repeat] entries to your Robot commands this week table.
✅ WHAT COUNTS AS FINISHED
  • Optical Sensor attached and configured
  • sensor detects cube colour
  • you can explain TRUE and FALSE
  • notebook entry complete
  • teacher check of robot and notebook
🛟 IF YOU GET STUCK
  • Check the Optical Sensor is plugged into the expected port.
  • Check that the Optical Sensor is configured in VEXcode IQ.
  • Make sure the cube is close enough for the sensor to detect.
  • Check the lighting if colour detection seems unreliable.
🚀 IF YOU FINISH EARLY
  • compare red, green, and blue cube readings
  • look at the Python Optical Sensor summary
  • write the Python-style version of one sensor decision
  • add Python command notes to your Robot commands table
Lesson 2: Eye Spy Treasure practice
📝 TODAY'S RECORDING

Record your field setup, your planned path to each cube, the condition your code checks, and what happened when the cube positions changed.

🔧 WHAT TO DO
  1. Open the Eye Spy Treasure Practice Activity.
  2. Set up the field exactly as shown in the activity.
  3. Place two cubes on the first two lines on the left side of the field. One must be red.
  4. Start the Simple Clawbot in the required starting position.
  5. Before coding, sketch the field and draw the planned path in your notebook.
  6. Create a movement-only test so the robot can drive to the first cube position.
  7. Add the Optical Sensor decision: if the cube is red, the robot should collect it.
  8. Test whether the robot can detect the colour correctly before trying the full routine.
  9. Complete a full Eye Spy Treasure attempt.
  10. Reset the field, swap the cube positions, and test again.
  11. Change one thing at a time until the robot is more reliable.
✍️ WHAT TO WRITE IN YOUR ENGINEERING NOTEBOOK
  1. Write the date and lesson title: Lesson 2 - Eye Spy Treasure practice.
  2. Sketch the field setup with the red cube and non-red cube.
  3. Draw the robot’s planned path.
  4. Write the condition your code checks.
  5. Record what happened when the red cube was first.
  6. Record what happened when the red cube was second.
  7. Write one change you made to improve the project.
  8. Add any new blocks or Python-style commands to your Robot commands this week table.
✅ WHAT COUNTS AS FINISHED
  • field setup correct
  • robot checks cube colour
  • robot attempts to collect the red cube
  • two cube positions tested
  • notebook shows testing and improvement
  • teacher check of robot and notebook
🛟 IF YOU GET STUCK
  • Check the movement path before checking the claw.
  • Check the sensor reading before testing the full routine.
  • Keep the robot start position the same every time.
  • If the robot collects the wrong cube, check the condition inside your [If then] block.
  • If the robot misses the cube, fix the driving distance before changing the sensor logic.
🚀 IF YOU FINISH EARLY
  • make the robot succeed two times in a row
  • reduce wasted movement
  • use [Repeat] to make repeated movement more efficient
  • translate one working block decision into Python
  • explain how your Python condition matches the block condition
Lesson 3: Treasure Mover Challenge
🧰 USE THESE RESOURCES
  • Treasure Hunt Lesson 3: Compete
  • Treasure Mover Challenge Activity
  • Lesson 3 Challenge Check Your Understanding
  • [Repeat] block
  • Optical Sensor - VEXcode IQ Python (extension)
🎯 TODAY'S CHALLENGE

Today your robot must check five cubes, identify the red Treasure Cube, and move only the red cube into the Home Zone as fast as possible.

🔧 WHAT TO DO
  1. Open the Treasure Mover Challenge Activity.
  2. Set up the field exactly as shown in the challenge resource.
  3. Place five cubes in random order along the left wall. One cube must be red.
  4. Before coding, plan how the robot will check each cube.
  5. Start from your best Eye Spy Treasure project if it is working.
  6. Modify your code so the robot can check more than two cube positions.
  7. Use repeated movement patterns where this makes your code clearer or more efficient.
  8. Run one timed attempt.
  9. Record the result in your notebook.
  10. Make one improvement to the code, path, speed, or claw timing.
  11. Run the challenge again and compare the new result.
  12. Complete the Challenge Check Your Understanding questions if your teacher tells you to.
✍️ WHAT TO WRITE IN YOUR ENGINEERING NOTEBOOK
  1. Write the date and lesson title: Lesson 3 - Treasure Mover Challenge.
  2. Sketch the five-cube field setup.
  3. Draw or write the algorithm your robot will follow.
  4. Record your first timed result.
  5. Record whether the robot checked all five cubes.
  6. Record whether the robot moved only the red cube to the Home Zone.
  7. Write one change you made between runs.
  8. Write whether that change helped.
  9. Add useful sensor, decision, repeat, and Python-style commands to your Robot commands this week table.
✅ WHAT COUNTS AS FINISHED
  • challenge attempted seriously
  • robot checks multiple cube positions
  • at least two runs completed
  • notebook includes evidence from multiple runs
  • teacher sign-off complete
🛟 IF YOU GET STUCK
  • Go back to the last Eye Spy Treasure version that worked.
  • Check one cube position before checking all five.
  • Check whether the problem is path, sensor detection, claw timing, or speed.
  • Do not optimise speed until the robot is accurate.
  • Keep your starting position and field setup consistent while troubleshooting.
🚀 IF YOU FINISH EARLY
  • optimise for speed without losing accuracy
  • compare two different checking patterns
  • use velocity blocks carefully and test whether speed helps or hurts
  • translate your sensor decision logic into Python
  • explain the block and Python versions side by side

📍 Looking ahead

Next week we move into Loop, There It Is!. You will use the completed Clawbot IQ build and focus more strongly on loops, repeated behaviour, and making robot actions efficient.

Keep your robot working, your best Week 3 code saved properly, and your notebook up to date. The sensor decisions and repeated actions from this week will help you when we start building stronger loop-based programs.