Your shopping cart is empty!
Build Auto Barrier Gate with Microbit
- Abdulrahman Alhamed
- 17 Aug 2022
- 1950
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
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
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
Upon completing the project successfully, the barrier gate will open once the car passes near the ultrasonic sensor.