Car Micro:bit Project

Obstacle avoiding robot using Micro:bit

A robot car, also known as an autonomous car or self-driving car, is a vehicle that is capable of sensing its environment and moving with little or no human input. The technology behind a robot car involves a combination of sensors, cameras, GPS, and artificial intelligence algorithms that enable the vehicle to navigate roads, avoid obstacles, and make decisions in real-time. The goal of a robot car is to provide a safer, more efficient, and more convenient form of transportation. However, there are still many technical and ethical challenges that must be overcome before robot cars become a widespread reality.

An obstacle avoiding robot is a type of robot that is designed to navigate its environment and avoid colliding with obstacles. These robots use sensors such as sonar, lidar, or infrared to detect obstacles in their path and then make decisions about how to avoid them. The sensors provide the robot with information about the distance and location of obstacles, which the robot then uses to determine the best path to take. The decision-making process can be controlled by a microcontroller or by more advanced artificial intelligence algorithms.

Obstacle avoiding robots can be used in a variety of applications, including industrial automation, search and rescue missions, and even in toy form for educational purposes. They are particularly useful in environments where it may be dangerous or difficult for humans to navigate, such as in hazardous industrial settings or in disaster zones. The goal of an obstacle avoiding robot is to increase efficiency and safety, by allowing the robot to navigate autonomously and avoid obstacles that may impede its progress.

Presentation of obstacle avoiding robot using Micro:bit:

An obstacle avoiding robot using a Micro:bit is a type of robot that uses a Micro:bit microcontroller to control its movements and detect obstacles. The Micro:bit is a compact and versatile device that is well-suited for educational projects and hobbyist projects, including the development of obstacle avoiding robots.

To build an obstacle avoiding robot using a Micro:bit, one can attach ultrasonic sensors or infrared sensors to the device to detect obstacles. The sensors can be connected to the Micro:bit‘s input pins, and the Micro:bit can then use its built-in processor to read the sensor data and determine the distance to obstacles. The Micro:bit can also control the movement of the robot using its output pins, which can be connected to motor drivers or actuators.

Once the sensors and motors are connected, the Micro:bit can be programmed to control the movement of the robot and avoid obstacles. This can be done using the Micro:bit‘s built-in programming environment or by using an external programming language such as Python or C++.

Building an obstacle avoiding robot using a Micro:bit is a great way to learn about robotics, programming, and electronics. The compact size and low cost of the Micro:bit make it an accessible and educational platform for students and hobbyists to experiment with and learn from.

Obstacle avoiding robot operation :

The operation of an obstacle avoiding robot using a Micro:bit involves several steps, including sensing the environment, making decisions about how to avoid obstacles, and controlling the robot‘s movements. Here is a general overview of how the robot works:

  1. Sensing the environment: The robot uses HC-SR04 sensor to detect obstacles in its path. The sensors send out pulses of sound or light and measure the time it takes for the reflections to return. Based on the time it takes for the reflections to return, the robot can determine the distance to an obstacle.
  2. Making decisions: The Micro:bit processes the sensor data and makes decisions about how to avoid obstacles. This can be done using simple if-then statements in the Micro:bit‘s programming environment or using more advanced artificial intelligence algorithms. The goal is to choose a path that will allow the robot to avoid obstacles while still moving towards its destination.
  3. Controlling movements: Based on the decisions made in step 2, the Micro:bit controls the movement of the robot. This can be done by sending signals to motor drivers or actuators, which control the movement of the wheels or other parts of the robot. The robot‘s movements should be coordinated to avoid obstacles and move towards its destination.
  4. Repeating the process: The robot continues to sense its environment and make decisions about how to avoid obstacles until it reaches its destination or encounters a situation it cannot handle. The Micro:bit will continuously repeat the process of sensing, deciding, and controlling movements to ensure that the robot avoids obstacles and moves safely.

The necessary components

Micro:bit card

The Micro:bit is a small, low-cost computer designed for educational purposes, especially for teaching coding and electronics to students. It was developed by the BBC and a number of partners with the aim of making computing accessible and fun for children.

The Micro:bit is equipped with a number of sensors, including an accelerometer, magnetometer, and temperature sensor, and has a simple 5×5 LED matrix display, two programmable buttons, and a USB port for power and data transfer. It is programmed using a block-based coding environment, which makes it accessible for beginners, but it can also be programmed using more advanced text-based languages like Python.

The Micro:bit can be used in a wide range of projects and activities, from simple games and animations to more complex projects like weather stations, robots, and wearable electronics. With its small size and low cost, the Micro:bit is an accessible and powerful tool for learning about computing and electronics, and has been used by many schools and educational organizations around the world.


The micro:bit has a number of expansion boards and accessories available, which are designed to extend its capabilities and make it easier to use in a variety of projects and activities. Some of the most common expansion boards for the micro:bit include: Motor drivers: These boards allow you to control motors and other devices that require more power than the micro:bit can provide on its own.

HC-SR04 sensor

The HC-SR04 is a low-cost, ultra-sonic distance sensor commonly used in various electronics projects. It consists of an ultrasonic transmitter and receiver that work together to measure the distance of an object. The sensor sends out an ultrasonic signal and measures the time it takes for the signal to bounce back after hitting an object. This time can be used to calculate the distance of the object.

The HC-SR04 can be easily interfaced with microcontrollers like the Arduino, Raspberry Pi, and other platforms. It is often used in obstacle avoidance robots, distance measurement systems, and many other applications where reliable and accurate distance measurements are required.

The sensor has a range of 2 cm to 400 cm and is capable of measuring distances with a resolution of 3 mm. It operates at a frequency of 40 kHz and requires a voltage supply of 5 V DC.

An obstacle avoiding robot using the HC-SR04 sensor is a type of autonomous robot that can navigate around obstacles in its path. The robot uses the HC-SR04 sensor to measure the distance between itself and the obstacles, and then makes decisions on how to navigate around them.

The basic idea is that the robot moves forward until it detects an obstacle in front of it using the HC-SR04 sensor. When an obstacle is detected, the robot stops and the sensor measures the distance to the obstacle. Based on the distance measurement, the robot can then make a decision on how to avoid the obstacle. For example, it may turn to the left or right to go around the obstacle, or it may back up and turn in a different direction.

To implement an obstacle avoiding robot using the HC-SR04 sensor, you will need a microcontroller such as a Micro:bit card, a motor driver to control the motors, and a power source such as a battery. You will also need to write a program for the microcontroller that controls the robot’s movement and makes decisions based on the distance readings from the HC-SR04 sensor.

Servo motor

A servo motor is a type of motor that is specifically designed to control angular position, velocity, and acceleration. It is widely used in a variety of applications, including robotics, remote control systems, and automated manufacturing systems.

A servo motor consists of a DC motor, a gear system, a position feedback sensor (such as a potentiometer), and an control circuit. The control circuit uses the feedback from the sensor to determine the position of the motor and adjust the drive to the motor to maintain the desired position. This allows the servo motor to rotate to a specific angle and hold that position accurately and consistently, even under load.

One of the main advantages of using a servo motor is its ability to provide precise control over position and movement. Servo motors can be positioned accurately to within a few degrees, making them ideal for applications that require precise control, such as robotic arms or grippers.

Servo motors come in various sizes and styles, with different torque and speed specifications to suit different applications. They are typically controlled by sending pulses of a specific duration and frequency to the servomotor‘s control input. The duration and frequency of these pulses determine the position of the servomotor, with longer pulses causing the motor to rotate to a greater angle.

5V DC motor

A 5V DC motor is a type of direct current (DC) motor that operates on a voltage of 5 volts. DC motors are widely used in a variety of applications, including toys, small appliances, and hobby projects.

DC motors work by converting electrical energy into mechanical energy. They consist of a rotor (the rotating part) and a stator (the stationary part), and use magnetic fields to generate torque and rotation. When a voltage is applied to the terminals of a DC motor, a magnetic field is generated in the stator, which interacts with the magnetic field of the rotor to produce rotation.

The speed and direction of rotation of a DC motor are determined by the voltage applied to its terminals. By controlling the voltage, you can control the speed and direction of the motor. To change the direction of rotation, you simply need to reverse the polarity of the voltage applied to the motor.

5V DC motors are relatively small and simple in design, making them easy to use and cost-effective for low-power applications. They are often used in hobby projects, educational projects, and small consumer electronics. They can be easily controlled with microcontrollers such as an Arduino or Micro:bit, and can be driven directly from a battery or power supply.

9V Battery

A 9V battery is a type of rectangular, cylindrical battery that is commonly used in a variety of portable devices and electronics. It is commonly referred to as a “transistor battery” because it was originally designed for use in transistor radios.

9V batteries have a nominal voltage of 9 volts and are made up of six individual 1.5V cells connected in series. They are often used in devices that require a compact and portable power source, such as smoke detectors, portable radios, and handheld games.

Fils de connexion

Connecting wires are electrical wires used to connect various electrical components in a circuit. They are an essential component of any electrical or electronic system, as they are used to transfer electrical energy and signals between the different parts of the circuit.

2 wheel car robot kit

A 2 wheel car robot kit is a kit designed to help you build a small, two-wheeled robot. The kit typically includes all of the components you need to assemble the robot, such as wheels, motors, a microcontroller, a battery, and a set of sensors and actuators.

These kits are often used for educational purposes, to teach individuals about robotics and electronics. They can also be used for hobby projects and as a platform for experimentation and innovation.

The exact components included in a 2 wheel car robot kit can vary, but they typically include a microcontroller or single-board computer, such as an Arduino or Raspberry Pi, a pair of DC motors, wheels, and a battery for power. The kit may also include additional components such as sensors, such as infrared or ultrasonic sensors, and actuators, such as LEDs or buzzers.

To build the robot, you typically need to follow a set of instructions and assemble the components according to the design provided. Once the robot is assembled, you can program it to perform a variety of tasks, such as following a line, avoiding obstacles, or responding to signals from a remote control.

Overall, 2 wheel car robot kits are a fun and educational way to learn about robotics and electronics. Whether you are a beginner or an experienced hobbyist, these kits can provide you with a fun and engaging platform for exploring the world of robotics.

Pour assembler les composants du kit robot, vous pouvez voir cette vidéo.

Montage du robot

1-For the HC-SR04 sensor we connect :

  • The GND terminal of the sensor to the GND pin of the Micro:bit

  • The VCC terminal of the sensor to the 3.3V pin of the Micro:bit

  • The ECHO terminal of the sensor to pin P1 of the Micro:bit

  • The TRIG terminal of the sensor to the P0 pin of the Micro:bit

2- We connect the servomotor to pins S1 of the DRIVER EXPANSION board

3- Connect the two motors of two wheels to the two connectors M3 and M4 of the DRIVER EXPANSION Board .

Makecode program

Here is the Makecode program for the Micro:bit robot which detects and avoids obstacles using an ultrasonic distance sensor:

Download program

8 commentaires

bellevue Long Distance Movers 24-09-2323

Does your blog have a contact page? I'm having trouble locating it but, I'd like to send you an email. I've got some suggestions for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it improve over time.

Gutter Installation Elmwood Park 21-09-2323

Does your website have a contact page? I'm having trouble locating it but, I'd like to send you an email. I've got some recommendations for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it develop over time.

Fairfield lender 17-09-2323

Attractive component of content. I just stumbled upon your blog and in accession capital to assert that I acquire actually loved account your blog posts. Anyway I'll be subscribing on your augment or even I fulfillment you get entry to constantly quickly.

fire damage restoration 05-09-2323

My family members always say that I am wasting my time here at net, however I know I am getting experience everyday by reading such good articles or reviews.

web app development Davie FL 26-08-2323

Everyone loves it when folks get together and share views. Great website, keep it up!

Construction equipment supplier Chantilly 21-08-2323

I've been surfing online more than 2 hours today, yet I never found any interesting article like yours. It's pretty worth enough for me. In my view, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.

bathroom remodeling Santa Barbara CA 17-08-2323

fantastic points altogether, you just won a brand new reader. What would you recommend in regards to your put up that you just made some days ago? Any positive?

polished concrete flooring supplies Chantilly VA 15-08-2323

Good day! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a marvellous job!

Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top