Introduction
The self-locking switch is a commonly-used button switch that outputs digital signal. When pressed down once, its circuit is connected, keeping in self-locking mode; when pressed again, the button switch is disconnected and ejected. It works well with maincontrollers such as micro:bit and Arduino, and can be used for not only Mind+ and makecode graphical programming but also non-programming projects. Connect this module to other output ones in parallel to realize all kinds of functions now!
Specification
- Power Supply: 3.0-5.5V
- Current Consumption: not more than 5mA@5V
- Interface Type: PH2.0
- Dimension: 26mm×39mm/1.02×1.54"
- Signal Type: digital signal (0 or 1)
Pinout
Num | Label | Description |
---|---|---|
1 | GND | Power - |
2 | VCC | Power + |
3 | SIGNAL | Digital Signal Line |
Usage Description
The self-locking switch can output and stay at a high/Low level. It can recognize the movement of pressing button and output the corresponding signal.
Press first time, the module is pressed and output "ON" or "1" Press the second time, the module is ejected and output "OFF" or "0".
Working Principle
Self-locking switch generally refers to the switch with mechanical locking function. Press down, and the switch has connectivity and outputs high, at this time the button will not be ejected after we release it, keeping in lock mode; press again, it's diconnected and output low, and the button is ejected.
Application
1.Turn on Fan
Description:
Turn on and off the fan with the self-locking switch. Press the switch once, the fan starts to rotate; press again, it stops rotating.
Components:
BOS0003 Self Locking Switch | BOS0021 Fan module | BOS0035 Mainboard-3IO |
MBT0039 Micro:bit | BOS0040 Micro:bit BOSON Expansion Board |
Tips: micro:bit and Micro:bit BOSON expansion boards are used in the programming example.
Non-programming Sample
Connection Diagram:
Programming Sample
Connection Diagram:
Flow Chart:
Mind+ Sample Program:
Makecode Sample Program:
Demo Videos:
Non-programming | Programming |
---|---|
2.Repeat Alarm
Description:
Control the buzzer to buzz with self-locking switch. Press the switch once, and the buzzer starts to buzz; press again, and it stops buzzing.
Components:
BOS0003 Self Locking Switch | BOS0020 Buzzer Module | BOS0035 Mainboard-3IO |
MBT0039 Micro:bit | BOS0040 Micro:bit BOSON Expansion Board |
Tips: micro:bit and Micro:bit BOSON expansion boards are used in the programming example.
Non-programming Sample
Connection Diagram:
Programming Sample
Connection Diagram:
Flow Chart:
Mind+ Sample Program:
Makecode Sample Program:
3.Control Servo
Description:
Control the servo to rotate with self-locking switch. Press the switch once, and the servo rotates to a designated angle; press again, and it rotates back to the initial angle.
Components:
BOS0003 Self Locking Switch | SER0045 9g Metal Servo Module | BOS0035 Mainboard-3IO |
BOS0040 Micro:bit BOSON Expansion Board | MBT0039 Micro:bit | BOS0025 Servo Controller Module |
Tips: micro:bit and Micro:bit BOSON expansion boards are used in the programming example.
Non-programming Sample
Connection Diagram:
Programming Sample
Connection Diagram:
Flow Chart:
Mind+ Sample Program:
Makecode Sample Program:
Demo Videos:
Non-programming | Programming |
---|---|
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum
Turn to the Boson Kit Page