Example Code For Smart Barnyard Access Control
Automatically opens the gate when a specific target (like the farm owner) is recognized; closes the gate and triggers an alarm when a "wild beast" (like a bear) is detected.
Hardware Preparation
| Building Block Expansion Board*1 | micro:bit *1 | Boson:AI Vision Sense |
| 360° Servo*1 | WS2812 RGB Strip*1 | Building Blocks |
Software Preparation
Development tools: Makecode.
Wiring Diagram

Sample Code
Makecode Sample Program:

Result
Demo Videos:

Was this article helpful?
