Traffic Safety Needs Mutual Humility | BOSON AI Starter kit for microbit:bit
On today's busy streets, traffic safety is more important than ever. With more cars, bicycles, and pedestrians sharing the road, following traffic rules and respecting others can effectively prevent accidents. However, reckless driving, ignoring traffic signals, and failing to yield to pedestrians often lead to dangerous situations.
"Safe Traffic, Mutual Courtesy" promotes the development of good habits of patience and responsibility on the road. By following signals, slowing down to yield to pedestrians, and avoiding aggressive driving, we can create a safer and friendlier travel environment together. Let’s work hand in hand to make our roads better!
Learning Objectives
Learn how a Infrared Proximity detects crosswalks.
Understand what autonomous Vehicle technology is.
Preparation

Learning Content
Introduction to Autonomous Vehicle Technology
Autonomous vehicles represent the future of automotive development, integrating various cutting-edge technologies into an intelligent system. However, considering the current state of development, several key technological breakthroughs are still required.
Environmental Perception and Accurate Recognition
Autonomous vehicles rely on sensors such as cameras, LiDAR, and millimeter-wave radar to perceive their surroundings. However, in complex weather conditions (e.g., heavy fog, heavy rain, snow) or special scenarios (e.g., intense sunlight, obstructed views), the accuracy and stability of these sensors still need improvement. Enhancing sensor performance is crucial to ensure precise recognition of roads, pedestrians, and other traffic elements.
High-Precision Mapping and Real-Time Positioning
Current autonomous driving systems depend on high-precision maps for navigation. However, challenges remain in terms of the update frequency, accuracy, and alignment of these maps with actual road conditions. Additionally, in environments where GPS signals are weak or unavailable (e.g., tunnels, underground parking lots, densely built urban areas), further advancements are needed to enhance the vehicle’s real-time positioning capabilities.
AI Decision-Making and Complex Road Condition Handling
Handling unexpected situations—such as pedestrians suddenly crossing, detours due to construction, or sudden accidents—remains a significant challenge for autonomous vehicles. Existing algorithms must improve their ability to respond to complex traffic conditions while prioritizing safety. The goal is to make autonomous vehicles as adaptable as human drivers in various driving scenarios.
Vehicle-to-Everything Communication and Data Security
Autonomous vehicles need to interact with cloud systems, high-precision maps, traffic signals, and other vehicles to optimize driving routes and enhance safety. However, this also introduces cybersecurity risks, including potential hacker attacks and data breaches. Therefore, V2X communication technology must strengthen encryption and privacy protection measures to ensure the security and reliability of autonomous driving systems.
Infrared Proximity Mode Switching Operation Demonstration
Mode Switching: Analog Mode
Connect the Infrared Proximity to the P0 pin of the expansion board and provide power to the expansion board.

After supplying power, gently press the button on the module to switch the operating mode.

So, how can you determine the current operating mode? You can confirm it through the indicator light on the module:
Digital Mode: When the probe is not obstructed, the indicator light is at its brightest, indicating the sensor is in digital mode.
Analog Mode: When the probe is not obstructed, the indicator light is dimmer, indicating the sensor is in analog mode.

Project Practice
his project simulates real-world traffic scenarios by using sensors to detect environmental changes. Combined with the NeurOne Module for learning, the system can recognize different zebra crossings and use sound detection to determine whether pedestrians are requesting to cross. The goal is to promote safe travel and mutual courtesy.
Task 1:Vehicle Zebra Crossing Detection System
During vehicle movement, the Infrared Proximity detects whether the vehicle has entered a zebra crossing area. If a zebra crossing is detected, the vehicle slows down and turns on a yellow light to alert pedestrians and other vehicles.
Task 2:Pedestrian Priority Reminder System
The sound sensor on the micro:bit detects whether a pedestrian is making a crossing request (e.g., clapping or speaking). If a request is detected, the system turns on a green light to signal safe passage for pedestrians while reminding vehicles to yield.
Task 1:Vehicle Zebra Crossing Detection System
Hardware Connection
Program Design
Function Description:
In analog mode, when the Infrared Proximity detects a zebra crossing, the RGB light turns yellow; otherwise, the RGB light turns off.
Operation Demonstration
Learning Phase
Press the learning button on the NeurOne Module and point the Infrared Proximity probe at the zebra crossing. Move it along the zebra crossing to record the collected analog values.
Note: Learn only a short section of the zebra crossing, and minimize the shadows cast on the sensor as much as possible.
Special Note: During actual operation, to improve recognition accuracy, it is best to keep the height of the Infrared Proximity stable. The reference structure diagram is as follows:
Recognition Test
Move the Infrared Proximity along the zebra crossing in the same way as during the learning phase and check whether the output indicator light turns on. If it lights up, the recognition is successful.If recognition repeatedly fails, you can try adjusting the precision of the NeurOne Module.
Program Flowchart:
Program Example
Operating Effect
When the Infrared Proximity detects a zebra crossing, the RGB light turns yellow to remind pedestrians to slow down. If no zebra crossing is detected, the RGB light turns off.
Task 2:Pedestrian Priority Reminder System
Hardware Connection
Program Design
Function Description:
If the detected sound is greater than 150, it indicates that a pedestrian has made a request to cross the zebra crossing. The system will turn on the green light for 20 seconds, allowing the pedestrian to pass. After 20 seconds, the red light will turn on, prohibiting the pedestrian from crossing.
Program Flowchart:
Program Example
Operating Effect
The RGB light is normally red. When the detected sound exceeds 150 (indicating a crossing request), the RGB light will turn green for 20 seconds.

Project Development
Have any attentive students noticed an issue in the Project Practice? Currently, our Vehicle Zebra Crossing Detection System and Pedestrian Priority Reminder System are two independently operating projects. Although they each accomplish their designated tasks, there is no direct connection between them.
So, how can we optimize the program to allow the two systems to work independently while also coordinating with each other? For example, during peak hours when many students are crossing the zebra crossing, the Vehicle Zebra Crossing Detection System should detect the zebra crossing and work in coordination with the Pedestrian Priority Reminder System. If a pedestrian makes a crossing request, the system should instruct vehicles to slow down or stop, allowing pedestrians to pass first, thus achieving safer and more efficient traffic interaction.
This optimization not only enhances the intelligence level of the system but also better serves real-world application scenarios, improving safety and user experience. Students can think about which technical methods we could use to implement this improvement.
