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.
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 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.
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 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.
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:
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.
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.
To make the assembly we can connect:
For the HC-SR04 sound sensor:
For LED RGB module:
The mounting methods are numerous and here are some examples:
Here is the smart traffic light program controlled by Micro:bit:
Here is the program of the robot Maqueen controlled by Micro:bit: