INTRODUCTION

The OSOYOO Robot Car for Micro Bit comes with two infrared obstacle detector sensors. It is actually designed for infrared obstacle avoidance robot.
The infrared obstacle detector sensor has a pair of infrared transmitting and receiving tubes.

The transmitter emits an infrared rays of a certain frequency. When the detection direction encounters an obstacle (reflecting surface), the infrared rays are reflected back, and receiving tube will receive it.At this time, the indicator (LED_L/LED_R) lights up. After processed by the circuit, the signal output terminal will output Digital signal.

You can rotate the potentiometer on the shield to adjust the detection distance. It is better to adjust the potentiometer to make the LED_L/LED_R in a state between on and off. The detection distance is the best, almost 30cm.

we use an infrared obstacle detector module and motor driving circuit on theOSOYOO Robot to build an infrared obstacle avoiding car.

How does it work?
We have introduced the principle of infrared obstacle detector module before. We can make use of two infrared obstacle detector modules integrated on the car shield to detect whether have obstacles on the both sides of micro:bit car. Thus control the car’s running state according to the testing interface.

PREPARATION

Hardware:

● 1 X USB cable

● 1 X micro:bit robot

CODE PROGRAM

Then the micro:bit is connected to the computer through USB, and the computer will pop up a U disk and click the URL in the U disk to enter the programming interface. Input this URL https://github.com/osoyoo/OSOYOO-MICRO-BIT-CAR to get the package.

RUNNING RESULT

Note:

This experiment must be carried out indoors to reduce interference from sunlight to infrared receiver.

If the robot tracking is not normal, you can adjust its speed and running time through makecode, and you can also change the sensitivity of the infrared obstacle avoidance sensor by adjusting the potentiometer