Troubleshooting VEX 123 Sensors

When your robot is not behaving as intended while using sensor feedback, you can follow a step-by-step troubleshooting procedure to find and fix your issues. This article will explain the steps in a troubleshooting process, and provide tips for how to use these steps. 

The steps of this process are:

  1. Identify the problem
  2. Check hardware
  3. Check software
  4. Analyze and apply data

Identify the Problem

The first step to troubleshooting your sensor is to identify if the sensor is causing the problem. Compare the observed robot behavior with the intended robot behavior. Is the problematic behavior caused by a sensor? If you need more information to determine if a sensor may be the problem, read the article(s) below related to the sensors on your robot.

VEX 123 Sensors:

Once you have identified which sensor is causing the unintended behavior, you can move forward in the process.


Check Hardware

The second step is to check the hardware on the robot to be sure that the sensor can function as intended. Each of the following hardware considerations could be affecting the functionality of your sensor.

Check that the sensor is not blocked

Copy_of_eye-sensor-callout.png

Begin by looking at where the sensor is located on your robot. Is the sensor being blocked by anything, like the Art Ring? Ensure that the sensor has the space needed to operate as intended.

As shown here, the Eye Sensor has a clear line of vision to the object it is meant to detect.


Check Sensor Connection 

IMG_5ED5FE396E1F-1_copy.jpeg

Test the sensor’s functionality by looking at the data reported in the VEX Classroom App. Once you have selected the 123 Robot you are troubleshooting, select 'Show Device Info' to view the data for sensors connected to that Brain. This can help you validate that the sensor is working.

To learn more about the device info shown in the VEX Classroom App view this article.

You can also try swapping out the 123 Robot you are using with another to see if that resolves your issue.

If you changed something to unblock the sensor or adjust a Coder card, test your project again to see if this resolved the issue. If your 123 Robot or Coder cards did not change, move onto the next step to continue the troubleshooting process.


Check Software

Once you have identified that the sensor is not blocked and is reporting data successfully, you can look to your Coder or VEXcode 123 project next. Iterating on a project can help you to ensure that the data from the sensor is being used effectively in your project. The following strategies can help you with coding your sensor.

If you apply any of these strategies to your project, test your project again to see if this resolved the issue. 

Check Firmware

Robot_firmware_updating_VEXcode.PNG

Begin by ensuring that your 123 Robot’s firmware is up to date.

The robot will automatically update when connected to VEXcode 123, as shown in this image.

IMG_713D70AB55D1-1.jpeg

If you are using the Coder, be sure both the robot and Coder firmware are up to date. You can check and update both your 123 Robot and Coder firmware using the VEX Classroom App. (The Coder firmware can only be updated with the Classroom App.)

View this article to learn more about updating the 123 Robot with the VEX Classroom App.

View this article to learn more about updating the Coder with the VEX Classroom App.

Check Coder cards

IMG_5C7BB182B32F-1_copy.jpeg

You can check that the Coder cards are being read accurately, and are not damaged. To view Coder card data in the Classroom App, select 'Show Device Info' for the Coder you are troubleshooting.

The Coder card project that is in the Coder at the time of connection to the Classroom App will be shown. You may need to scroll to see the entire project. If the Coder project is changed, select ‘Update Cards’ to update the data in the Classroom App.

If a Coder card shown does not match the Coder card in the Coder, you may have a damaged Coder card in the project. View this article to learn more about using the Classroom App with your Coder.

To learn more about Coder card commands individually, view this article. 

Run an Example Project in VEXcode 123

Screenshot_2023-04-20_at_2.02.44_PM.png

Open an Example Project that uses the sensor you are troubleshooting. Select 'File' then 'Open Examples' to view the Example Projects in VEXcode 123.

Screenshot_2023-04-20_at_2.00.54_PM.png

Open an Example Project that uses the sensor you are troubleshooting. You can select the ‘Sensing’ category to filter example projects.

Screenshot_2023-04-20_at_2.05.11_PM.png

Once open, read the Note to determine if the functionality in the example project aligns with what you are trying to do with the sensor.

In the example project shown here, the note indicates that the Eye Sensor is being used to detect an object so that the robot can stop driving and turn when an obstacle is detected.

Run the example project and observe the robot behavior. Then look at the project to see how the sensor data is being used in order to cause the observed behaviors. You may want to run the example project multiple times to help with this.

You may also want to try to create your own simplified project to apply what you have learned from the example project to your task.

Use Other VEXcode 123 Tools

There are also tools and strategies that you can use to help you as you learn more about coding your sensor in VEXcode 123. You can learn about the blocks or commands in the Toolbox individually by using the Help. You can also view sensor data as a project is running to learn more about what the sensor is reporting.

The Help

Screenshot_2023-04-20_at_2.11.34_PM.png

Read the Help for the blocks or commands in the example project, or in your project to learn about the data that is used, what values the command will report and how to view those values, and examples of how to use the command in a project.

View this article to learn more about accessing Help in VEXcode 123.

Monitoring and Printing Data

You can also view data from the sensor as the example project or your project is running, to help you better understand what the sensor is reporting in real time. This can help you determine what reported values from the sensor to use as parameters in your project. 

123 Left Button Pressed Monitor.png

Viewing sensor data in the Monitor Console is helpful when you want to see the values changing as a VEXcode 123 project is running. This can help you determine what reported values from the sensor to use as parameters in your project. Blocks in the Sensing category of the Toolbox can be added to the Monitor Console by selecting and dragging the block to the Monitor Console icon in the Workspace.

View this article to learn more about viewing sensor values in the Monitor Console in VEXcode 123.

123 Print Console.png

Printing to the Print Console in VEXcode 123 be used to display information as a project is running, to help provide visual cues to help see what is happening in a VEXcode 123 project at a specific moment in a project. This can help make the visual connection between the project and the actions of the 123 Robot easier to see.

In the image shown here, data about the robot's heading at various times while the project is run is being printed. Blocks from the 'Looks' category of the Toolbox are used to print to the Print Console in VEXcode 123.  

View this article for more information about using the Print Console in VEXcode 123.


Analyze and Apply Data

Next, use what you have learned in the previous steps to adjust your original project. You can continue to use tools like the Help and monitoring or printing data to enable you to use the sensor effectively to accomplish your goal.

You can also ask questions about your project to help you move forward. Think about things like:

  • Are your 123 Robot and Coder connected? Be sure your robot and Coder are paired together, and are staying paired as the project is being run. View this article to be reminded of the pairing process.
  • Did you try using the Step button on the Coder? Use the 'Step' button to run your project one Coder card at a time. This can slow down the project execution to make it easier to see where your project is having a problem, or where issues with the project flow might be. View this article to learn more about how to step through a Coder project.
  • Are you checking the conditions more than once in your Coder project? Try adding a 'Go to start' card at the end of your project to cause it to return to the start and continue running. The 'Go to start' card creates a Forever loop to your project, so that the condition is checked repeatedly when the project is run.
  • Are your environmental conditions influencing the sensor? Is it too bright or too dark? Are there objects or people in the way? Try running your project in a different location to see if that helps.
  • Is your whole stack attached to the {When started} hat block in your VEXcode 123 project? Blocks will only run when they are connected. You can listen for a click sound when you drag blocks and connect them together.
  • Did you try stepping through your project in VEXcode 123? Use the 'Step' button to run your project one block at a time. This can slow down the project execution to make it easier to see where your project is having a problem, or where issues with the project flow might be. View this article to learn more about how to step through a VEXcode GO project.
  • Is your VEXcode 123 project getting stuck? Are your conditions set correctly? If you are using nested loops, try simplifying your project to isolate individual behaviors.
  • Are your block parameters correct? Are you using the data from the sensor to set your parameters? Did you choose the dropdown option that you need?
  • Are you using greater than < or less than > in your project? Is the symbol facing the right direction? If you are using equal to = try replacing it with a greater than or less than, to use a range of values.
  • Are you checking the conditions in your VEXcode 123 project more than once? Try adding a Forever loop to your project, so that the condition is checked repeatedly when the project is run.
  • Are you detecting the correct color? Is the sensor reporting a different color than the one you have in your project? Try changing the color parameter, or using a range of hue values, to see if that helps. If using the Coder, try changing the 'If' card to a different color and see if that helps.
  • Are you detecting an object within the sensor’s field of view? Remember that the field of view moves in conjunction with the movement of the robot.
  • Are you using a waiting block while checking a condition? Be sure to use non-waiting blocks in a project when checking for a condition. View this article to learn more about waiting vs. non-waiting blocks in VEXcode IQ.

As you answer these questions, be sure to change one thing in your project at a time, test it, then evaluate whether that change was effective. Testing your project frequently can help you to more easily see how your code is connected to the robot’s behaviors.  You may need to repeat steps in the troubleshooting process multiple times to solve your problem, and that is ok. Each iteration will help you learn more about how to code your 123 Robot.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: