Smart Car Phiro

Create an obstacle detection & avoidance system in the Pocket Code environment for Phiro to move, detect and avoid obstacles.

Objective

By the end of this lesson, learners will

  • Identify and understand Phiro's sensors
  • Understand and use the computational concept of Control to create a program
  • Create a program to control sensors
  • Connect the physical and digital worlds
  • Develop greater fluency of sequence and debugging
  • Practice experimenting & iterating
  • Express their creativity by programming a robotic obstacle avoidance system
Subjects

Pocket Code, Steam, Robotics, Coding, Binary, Sensors

Age

9 & above

Duration

40 min

Robot & Accessories Needed

Phiro Pro robot

  • step1
  • step2
  • step3
  • step4
  • step5
  • step6
STEP 1

Ask

How does a self-driving car work to avoid crashing into other cars?

What do robots do when there is an obstacle in front of it?

How would a robot detect and avoid obstacles while it moves around?

How can you make Phiro into a smart car to detect obstacles and avoid them?

STEP 2

Imagine

Imagine what Phiro would need to do if it encounters an obstacle. What would you need to solve this challenge?

1. Detect obstacle: If obstacle detected, stop.

2. Avoid obstacle: If obstacle detected, stop, otherwise continue moving

STEP 3

Plan

Decide on a path that Phiro should follow and where the obstacles will be placed.

Explore Phiro's 6 sensors. Figure out which sensors on Phiro will encounter these obstacles.

Plan your coding for

1. Obstacle Detection - Phiro keeps moving forward but stops when it detect an obstacles in front.

2. Obstacle avoidance - Phiro detects obstacles and moves away from obstacle on the right or left.

STEP 4

Create

Sample Script to detect value of front sensor, when it detects object or obstacle.

Note: Sensor value will vary according to environment.

We got value of less than 500 ( < 500 ) for both front sensor when object or obstacle is detected.

Please check the value and use it in Obstacle detection and Obstacle avoidance program.

Obstacle Detection: Create a program in Pocket Code for PHIRO to detect obstacle and Stop.


Obstacle Avoidance: Create a program in Pocket Code for PHIRO to detect obstacle and avoids and moves forward.

STEP 5

Remix

Remix your code by using Phiro's Side or Bottom Sensors also to avoid obstacles along with front obstacle avoidance.

STEP 6

Share

Share your Phiro obstacle detection and avoidance system using #MyPhiro and we will share it with the world.