Your shopping cart is empty!
![Build Auto Barrier Gate with Microbit Build Auto Barrier Gate with Microbit](https://static.cytron.io/image/tutorial/build-auto-barrier-gate-with-microbit/Thumbnail-2.png)
Build Auto Barrier Gate with Microbit
- Abdulrahman Alhamed
- 17 Aug 2022
- 1962
Automatic barriers are a common sight at the entrance of car parks and restricted areas. They control the flow of traffic, keep track of vehicles entering a property, and prevent unwarranted access to private properties.
In this tutorial, we will learn how to build an auto barrier gate using microbit with REKA:BIT.
Video Tutorial
Components Required
Connection
![circuit diagram65](https://static.cytron.io/image/tutorial/build-auto-barrier-gate-with-microbit/Circuit_Diagram65.jpg)
By following the diagram above:
- Connect the servo motor to the first port
- Connect Ultrasonic sensor to the first grove port in REKA:BIT (P1 to Trig, P0 to Echo)
Code
![microbit screenshot 50](https://static.cytron.io/image/tutorial/build-auto-barrier-gate-with-microbit/microbit-screenshot_50-868x1024.png)
Connect your REKA:BIT to your computer and open MakeCode editor to start programming.
- Add (REKA:BIT), and (makerbit-ultrasonic) extensions and follow the code block in the picture above
- After completing the code, download it on microbit
You can also view and edit the code by clicking here!
Project Complete
![project complete](https://static.cytron.io/image/tutorial/build-auto-barrier-gate-with-microbit/Project-Complete.png)
Upon completing the project successfully, the barrier gate will open once the car passes near the ultrasonic sensor.
Related Products
SG90 Micro Servo
S$2.90 S$2.90
x 1 unit(s)
3V-5.5V SR04P Ultrasonic Ranging Module
S$2.50 S$2.50
x 1 unit(s)
REKA:BIT (with micro:bit V2 included) - Simplif...
S$50.71 S$56.07 S$50.71
x 1 unit(s)
3V-5.5V SR04P Ultrasonic Ranging Module
Not Available
x 1 unit(s)
SG90 Micro Servo
Not Available
x 1 unit(s)