LED Micro:bit Project

Intelligent Traffic Light with Micro:bit

Presentation of Intelligent Traffic Light

An Intelligent Traffic Light is a type of traffic signal system that uses advanced technology to optimize traffic flow and improve safety. These systems typically use sensors, cameras, and other devices to gather real-time data on traffic conditions and adjust the signal timings accordingly.

Intelligent traffic light systems can be used to achieve a variety of goals, such as reducing congestion, improving pedestrian safety, and reducing air pollution. Some of the features of intelligent traffic lights include:

  • Real-time traffic monitoring: Sensors and cameras are used to gather data on traffic flow, vehicle speeds, and pedestrian movements.
  • Adaptive signal control: Signal timings are adjusted in real-time based on the traffic data, with the goal of optimizing traffic flow and reducing congestion.
  • Priority for emergency vehicles: Intelligent traffic lights can be configured to give priority to emergency vehicles, such as ambulances and fire trucks, by changing the signal timing to allow them to pass through intersections more quickly.
  • Pedestrian safety: Intelligent traffic lights can be configured to improve pedestrian safety by increasing the amount of time allocated for pedestrians to cross the street, or by providing special signals for pedestrians.
  • Communicating with connected vehicles: As the number of connected vehicles grows, the intelligent traffic lights can communicate with the vehicles to provide the driver with real-time information about the traffic situation and optimize the traffic flow.

Intelligent traffic light systems can improve traffic flow, reduce congestion, and improve safety, but they are not yet widely adopted. Some of the factors that limit their deployment are the cost, lack of standardization and lack of sufficient data for the system to make accurate decisions.

Objective of this project:

The objective of this project is to achieve an intelligent traffic light controlled by Micro:bit.

This system uses two Micro:bit cards to create an automatic driving system that can detect changes in a traffic light and use them to start and stop our Line Plotter Maqueen robot.

  • If the LED lights up in red and the sound sensor HC-SR04 detects the presence of the robot, the Micro:bit board of the traffic light sends by radio the word ‘stop’ to that of the Maqueen robot to stop it.
  • If the LED lights up green, the Maqueen robot starts rolling.

necessary components

2 Micro:bit board

Micro:bit is a small, programmable computer developed by the BBC in the United Kingdom. It is designed to be easy to use and accessible to students and beginners, and can be used to learn coding and computer science concepts. The device features a 5×5 LED matrix, two programmable buttons, a built-in accelerometer and magnetometer, and a variety of input/output (I/O) pins for connecting sensors and actuators.

The Micro:bit can be programmed using a variety of programming languages including Python, JavaScript, and Microsoft Block Editor. It also has a built-in Bluetooth module, which can be used to connect to other devices such as smartphones or other Micro:bits for wireless communication.

The Micro:bit is widely used in educational settings as a tool for teaching coding and computer science, but it can also be used for a variety of projects and applications such as building robots, creating interactive games, and controlling devices via Bluetooth.

Maqueen robot

The Micro:bit Maqueen robot is a small, programmable robot that is designed for use with the Micro:bit microcontroller. The robot is powered by the Micro:bit and features a variety of sensors and actuators, such as wheels and motors, that can be controlled using the Micro:bit‘s I/O pins. It also features an Infrared sensor, which can detect obstacles in front of it and can be used for line-following.

The Maqueen robot can be programmed using a variety of programming languages, such as Python, JavaScript and Microsoft Block Editor. It can be used to teach students about robotics, coding, and programming in a hands-on, interactive way.

The Maqueen robot can be used for a variety of projects, such as line-following, obstacle avoidance, and remote control. The robot can be programmed to perform specific tasks, such as moving in a certain pattern or avoiding obstacles. It can also be used to create interactive games and other interactive applications.

The Maqueen robot is a useful tool for teaching coding, robotics, and engineering concepts in a fun and engaging way. It can be used by students of all ages and can help to foster creativity, problem-solving, and critical thinking skills.

HC-SR04 sensor

The HC-SR04 ultrasonic sensor is a distance sensor that can be used to detect the presence of vehicles. It works by emitting a high-frequency sound wave and measuring the time it takes for the sound wave to bounce back. The distance to the object can be calculated using the speed of sound and the time it takes for the sound wave to return.

To use the HC-SR04 sensor to detect vehicles, it would need to be placed at a location where it can detect the presence of a vehicle. This could be at the side of the road, or on a bridge over a road.

Once the sensor is in place, it can be connected to a microcontroller such as a Micro:bit. The microcontroller can then be programmed to read the sensor’s output and determine the distance to any object in front of it. If the sensor detects an object within a certain distance, it can be programmed to trigger an action such as turning on a traffic light or sending an alert to a control center.

It is important to note that the HC-SR04 sensor has a limited detection range, typically around 4 meters, and it may not be able to detect all vehicles or may not detect them accurately. Other factors such as weather and lighting conditions can also affect the sensor’s performance.

RGB LED module

An RGB LED module can be used to create a traffic light system that uses different colors to indicate different traffic conditions. RGB LEDs are special types of LEDs that can emit light in different colors by adjusting the intensity of their red, green and blue components.

To create a traffic light system using an RGB LED module, the module would need to be connected to a microcontroller such as a Micro:bit. The microcontroller can then be programmed to control the color of the LED based on the traffic conditions. For example, the LED could be set to green when the traffic light is indicating that it is safe to proceed, yellow when the light is about to change, and red when the light indicates that traffic should stop.

RGB LED modules can be purchased online, they typically have 4 pins, VCC, GND, R, G and B. The VCC and GND pins are used to provide power to the module, while the R, G and B pins are used to control the intensity of the red, green and blue components, respectively.

Micro:bit GPIO board

A Micro:bit GPIO (General Purpose Input/Output) Expansion Board is an accessory that can be used to extend the capabilities of a Micro:bit by providing additional input/output (I/O) pins. These pins can be used to connect sensors and actuators, such as LEDs, buttons, motors, and other electronic components.

The expansion board typically connects to the Micro:bit using a standard edge connector and provides a set of male headers that can be used to connect external components.

The Micro:bit GPIO Expansion Board can provide additional functionality to the Micro:bit such as:

  • More pins to connect sensors or actuators
  • Additional power supply options
  • Additional communication interfaces such as I2C or SPI
  • Protection to the Micro:bit and the connected components

connecting wires

Connecting wires are used to connect various components in an electronic circuit. They allow for the transfer of electricity, data, or signals between different devices and components.

When connecting wires to an Arduino or other microcontroller, it is important to pay attention to the correct pinout. The pinout refers to the arrangement of pins on the microcontroller and the corresponding function of each pin. The Arduino pinout can be found in the documentation provided by the manufacturer, or in various resources available online.

test plate

A test plate, also known as a test jig, is a device used to test electronic circuits and components. It is a board or plate that has been designed to hold and connect various components and devices in a specific configuration, allowing for the easy testing and measurement of their performance.

A test plate can be used to test various types of electronic circuits and components, such as microcontrollers, sensors, and actuators. It typically includes connectors and sockets for connecting wires, power supply and measurement devices such as multimeters, oscilloscopes, and power supplies.

Mounting the traffic light

To make the assembly we can connect:

For the HC-SR04 sound sensor:

  • VCC pin to  3.3V pin of Micro:bit
  • Trig pin tp P2 pin of Micro:bit
  • Echo pin to P1 pin of Micro:bit
  • GND pin to GND pin of Microbit

For LED RGB module:

  • GND pin to GND pin of Microbit
  • R pin to P0 pin of Micro:bit
  • G pin to pin P8  of Micro:bit

The mounting methods are numerous and here are some examples:

Mounting (1)

Mounting (2)

Makecode program

Here is the smart traffic light program controlled by Micro:bit:

Maqueen program

Here is the program of the robot Maqueen controlled by Micro:bit:

0 commentaire

Leave a comment

Votre adresse e-mail ne sera pas publiée.

Scroll to Top