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
Bear Card Card Stand*1

Software Preparation

Development tools: Makecode and Bosonkit library

Wiring Diagram

Sample Code

Makecode Sample Program:

microbit-Smart-Barnyard-Access-Control.zip

Result

Demo Videos:

Was this article helpful?

TOP