yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Tiny:bit Robot Car📖
1.First Trial
  • 1.1 First Trial
  • 1.2 Bluetooth APP manual matching tutorial
2.Preparation before programming
About Graphical
  • 1.Online programming
  • 2.Offline programming
About Python
  • 1.Python Programming
  • 2.Import Tiny:bit library
  • 3.Tiny:bit MicroPython API
Download program
  • How to download program
3.Lighting with Tiny bit
  • 3.1 LED light
  • 3.2 RGB Searching light
  • 3.3 RGB light exchange lighting
  • 3.4 LED light exchange lighting
  • 3.5 Breathing light
4.Singing withTiny bit
  • 4.1 Playing internal music
  • 4.2 Play Merry Christma with lights
5.Running with Tiny bit
  • 5.1 Advance
  • 5.2 CarRun
  • 5.3 Control speed
  • 5.4 Dancer
  • 5.5 Route plan
6.Playing with Tiny bit
  • 6.1 Measuring worker
  • 6.2 Distance control light
  • 6.3 Ultrasonic obstacle avoidance
  • 6.4 Magic hand
  • 6.6 Playing black paino
  • 6.7 Tracking
  • 6.8 Voice control light
  • 6.9 Coward
  • 6.10 Musical rhythm
  • 6.11 Listener
  • 6.12 Wobble when touch
  • 6.13 Spinning top
  • 6.14 Frog beating
  • 6.15 Adventure car
7.Interacting with Tiny bit
  • 7.1 IR Control
  • 7.2 Android bluetooth APP control
  • 7.3 iOS bluetooth APP control
  • 7.4 Handle remote control
  • 7.5 WiFi camera control(Tinybit Plus)
8.Charging and battery
  • Charging and Battery
9.Python course
Basic course
  • 1.Hello,World
  • 2.Display built-in image
  • 3.Display custom image
  • 4.Display custom animation
  • 5.Button game
  • 6.Play built-in music
  • 7.Car Headlights
  • 8.Drive Motor
  • 9.Tracking
  • 10.Sound sensor
  • 11.Ultrasonic
  • 12.IR control
  • 13.LED light
Robot course
  • 1.Advance
  • 2.CarRun
  • 3.Control speed
  • 4.Route plan
  • 5.Distance control light
  • 6.Ultrasonic avoid
  • 7.Tracking
  • 8.Voice control light
  • 9.Listener
  • 10.IR control
  • 11.Handle control(option)
10.AI vision course(For Tiny:bit Plus)new
  • 1. Cat(dog) detection
  • 2. Color recognition
  • 3. QR code instructions
  • 4. Person Recognition
  • 5. Face Detection
  • 6. Color Follows
  • 7. Face following
Download
  • APP(iOS_Android)
  • Instruction_Manual
  • Code
  • Makecode offline software
  • Bluetooth Remote Control with ultrasonic V2.hex
  • Bluetooth Remote ControlV1.5.hex
  • Bluetooth Remote Control with ultrasonicV1.5.hex
  • IR control V2.hex
  • IR control V1.5.hex
  • Tiny:bit V1 MicroPython Library
  • Tiny:bit V2 MicroPython Library
  • Tiny:bit MicroPython API
  • Bluetooth communication protocol
Download ZIP
FAQ
  • 1、Can't open MakeCode software normally.
  • 2、Tiny:bit Expansion pack infrared cannot switch French

Welcome to Tiny:bit Robot Car repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

6.3 Ultrasonic obstacle avoidance


1.Preparation

1-1.The position of the Ultrasonic module on the robot car

1-2.Learn about the principle of Ultrasonic module

Programming method:

Mode 1 online programming: First, we need to connect the micro:bit to the computer by USB cable. The computer will pop up a USB flash drive and click on the URL in the USB flash drive: http://microbit.org/ to enter the programming interface. Add the Yahboom package: https://github.com/YahboomTechnology/Tiny-bitLib to program.

Mode 2 offline programming: We need to open the offline programming software. After the installation is complete, enter the programming interface, click【New Project】, add Yahboom package: https://github.com/YahboomTechnology/Tiny-bitLib, you can program.

In the picture shown below, the ultrasonic module with red wire frame.

image.png

Ultrasonic ranging principle:

The ultrasonic wave has two ultrasonic probes, which are used for transmitting and receiving ultrasonic waves, respectively, and the measurement range is about 3-450 cm. First, input a 15us high level signal to the SCL (TRIG) pin to start the ranging function of module.

After the ranging function is started, the module will automatically send out 8 40 kHz ultrasonic pulses and automatically detect whether there is a signal return. This step is automatically done internally by the module. When the echo signal is detected, the echo terminal SDA (ECHO) pin will output a high level.

The high level duration is the time from the transmission to the return of the ultrasonic wave. We can calculate the current distance by the high level duration.

Formula: Distance = High Time * Sound Speed (340M/S)/2

2.Learning goal

2-1. Learn how to use ultrasonic return distance graphically program building blocks

2-2.In this lesson, we will learn how to realize automatic obstacle avoidance

3.Search for block

The following is the location of the building blocks required for this programming.

image.png

image.png

image.png

image.png

4.Combine block

The summary program is shown below:

image.png

Note: The speed and time parameters in the program can be adjusted according to the actual situation.

5.Experimental phenomena

After the prgram is downloaded, the robot will realize  automatic obstacle avoidance.

image.png


Distance control light
Magic hand

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文