keyestudio
Share your creative ideas with us here
By ran | 23 July 2024 | 0 Comments

HOW to Use Knock Sensor with Microbit

Overview

Sensors can be used to detect various common data in life, such as light, temperature, humidity, sound, vibration and so on. We can use sensors to sense external signals and then control other devices. Thus, we can do various interesting experiments.
In the experiment, we connect the knock sensor and the LED module to the micro bit control board. Control the external LED to turn on and off by knock sensor.

Components Needed

  • Micro: bit motherboard * 1

  • Keyestudio Micro bit sensor V2 expansion board * 1

  • USB cable * 1

  • Keyestudio Knock Sensor Module

  • Keyestudio Digital White LED Module * 1

  • Dupont jumper wire*6

  • Premium Battery Holder 6-cell AA*1

  • 1.5V AA Battery*6

Connection Diagram

45

Test Code

Img

Test Results

Wire according to connection diagram, plug in external power and upload code to micro:bit,When the white sensor senses the knock signal, the LED on the external module lights up for 500ms, otherwise the LED turns off.

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code