+21622886281
HC-SR04 Micro:bit Project Servo motor

Realization of an automatic parking barrier with Micro:bit

Purpose of this project:

In this project we will simulate an automated parking barrier with Micro:bit.

This model resumes the general operation of automated systems that allow access to public parks that can be found in stations, airports, cinemas, supermarkets, etc.

Our barrier opens with a servo motor when the HC-sound sensorSR04 detects a vehicle and closes automatically if not.

Required components

  • a Micro:bit board a GPIO board
  • two HC-SR04 sensors
  • connecting wires
  • a test plate
  • a RGB LED modul
  • e a barrier in the form of a pen
  • a servomotor

Mounting the Parking

To complete the mounting, you can connect

For the first HC-SR04 sensor:

  • the VCC pin to the 3.3V pin of the Micro:bit
  • the Trig pin to the P8 pin of the Micro:bit
  • the ECHO pin to the P9 pin of the Micro:bit
  • the GND pin to the GND pin of the Micro:bit

For the second HC-SR04 sensor:

  • the VCC pin to the 3.3V pin of the Micro:bit
  • the Trig pin to the P4 pin of the Micro:bit
  • the ECHO pin to the P13 pin of the Micro:bit
  • the GND pin to the GND pin of the Micro:bit

For the motor servo:

  • red wire: power wire to be connected to the terminal(+) of the 4 batteries
  • brown wire: wire to be connected to the GND pin of the Micro:bit
  • Yellow: positioning signal wire connected to the pin P1 of the Micro:bit

For RGB LED module:

  • pin Po from micro:bit to pin (R) for the red color of the RGB LED module
  • pin P2 from micro:bit to pin (G) for the green color of the RGB LED module
  • pin GND from micro:bit to pin (GND) of the RGB LED module

Mounting 1

Mounting 2

Makecode Program

Here is the Makecode program for the automated parking system:




0 commentaire


Leave a comment

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

Scroll to Top