Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use button sensor module: Examples, Pinouts, and Specs

Image of button sensor moduleDesign with button sensor module in Cirkit Designer

Introduction

The Keyestudio Button Sensor Module is a simple yet versatile device designed to detect the presence or absence of a button press. It features a push button switch and additional circuitry to provide a clean digital output signal when the button is activated. This module is widely used in projects requiring user input, such as triggering events, controlling devices, or navigating menus in embedded systems.

Explore Projects Built with button sensor module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of MakerEdu Creator with Bluetooth, IR Sensors, LCD Display, and Push Button Interaction: A project utilizing button sensor module in a practical application
MakerEdu Creator with Bluetooth, IR Sensors, LCD Display, and Push Button Interaction

This circuit features a MakerEdu Creator microcontroller board interfaced with two MKE-S11 IR Infrared Obstacle Avoidance Sensors, a MKE-M02 Push Button Tact Switch, a MKE-M15 Bluetooth module, and a MKE-M08 LCD2004 I2C display module. The push button is connected to a digital input for user interaction, while the IR sensors are likely used for detecting obstacles. The Bluetooth module enables wireless communication, and the LCD display provides a user interface for displaying information or statuses.

Open Project in Cirkit Designer
Image of ESP32 and ESP8266 Wi-Fi Controlled Sensor Hub with Battery Backup: A project utilizing button sensor module in a practical application
ESP32 and ESP8266 Wi-Fi Controlled Sensor Hub with Battery Backup

This circuit is a sensor monitoring and data transmission system powered by a Li-ion battery and a 12V adapter. It includes various sensors (tilt, optical encoder, force sensing resistors, and air pressure) connected to an ESP32 microcontroller, which reads sensor data and transmits it via a WiFi module (ESP8266-01). The system is designed to provide real-time sensor data over a WiFi network.

Open Project in Cirkit Designer
Image of Arduino UNO-Based Security System with PIR Motion Detection and Bluetooth Connectivity: A project utilizing button sensor module in a practical application
Arduino UNO-Based Security System with PIR Motion Detection and Bluetooth Connectivity

This circuit features an Arduino UNO microcontroller interfaced with a PIR motion sensor (HC-SR501), a Bluetooth module (HC-06), a buzzer (FIT0449), and a soil moisture sensor (SEN040129). The Arduino is programmed to interact with these sensors and actuators, likely to monitor environmental conditions and provide alerts or communication via Bluetooth. Additionally, there are two LED components (JLED-START and JLED-ARROW-9) daisy-chained together, which could be used for visual signaling or status indication.

Open Project in Cirkit Designer
Image of ESP32-Based Safety and Tracking System with GSM and GPS: A project utilizing button sensor module in a practical application
ESP32-Based Safety and Tracking System with GSM and GPS

This circuit features an ESP32 microcontroller interfaced with various sensors, modules, and a relay. The MQ-3 gas sensor and LDR (light-dependent resistor) provide environmental input to the ESP32, which can trigger a buzzer and control a relay based on predefined conditions. Additional components include a step-down module to regulate power, an LCD display for user interface, a SIM800L module for cellular connectivity, a GPS module for location tracking, and an ESP32-CAM for image capture, all integrated into a cohesive system possibly for a security or monitoring application.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The Keyestudio Button Sensor Module is designed for ease of use and compatibility with a wide range of microcontrollers, including Arduino boards.

Key Technical Details

Pin Configuration and Descriptions

The module has a 3-pin interface for easy connection to microcontrollers. Below is the pinout:

Pin Label Description
1 GND Ground connection
2 VCC Power supply (3.3V to 5V)
3 SIG Digital signal output (HIGH/LOW)

Usage Instructions

The Keyestudio Button Sensor Module is straightforward to use in any circuit. Follow the steps below to integrate it into your project:

Connecting the Module

  1. Power the Module: Connect the VCC pin to the 3.3V or 5V pin of your microcontroller and the GND pin to the ground.
  2. Signal Output: Connect the SIG pin to a digital input pin on your microcontroller.

Example Circuit

Arduino Code Example

Below is an example Arduino sketch to read the button state and control the onboard LED:

// Define the pin connected to the button sensor module
const int buttonPin = 2; // SIG pin connected to digital pin 2
const int ledPin = 13;   // Onboard LED pin on Arduino UNO

void setup() {
  pinMode(buttonPin, INPUT); // Set button pin as input
  pinMode(ledPin, OUTPUT);  // Set LED pin as output
  Serial.begin(9600);       // Initialize serial communication
}

void loop() {
  int buttonState = digitalRead(buttonPin); // Read the button state

  if (buttonState == HIGH) {
    // If button is pressed, turn on the LED
    digitalWrite(ledPin, HIGH);
    Serial.println("Button Pressed");
  } else {
    // If button is not pressed, turn off the LED
    digitalWrite(ledPin, LOW);
    Serial.println("Button Released");
  }

  delay(100); // Small delay to debounce the button
}

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Response from the Button:

    • Ensure the module is properly powered (check VCC and GND connections).
    • Verify the SIG pin is connected to the correct digital input pin on the microcontroller.
  2. Button Press Not Detected Consistently:

    • Add a small delay in the code to debounce the button.
    • Check for loose or faulty connections.
  3. Onboard LED Does Not Light Up:

    • Confirm the button is being pressed fully.
    • Ensure the module is receiving the correct operating voltage.

FAQs

Q: Can I use this module with a Raspberry Pi?
A: Yes, the module is compatible with Raspberry Pi. Connect the SIG pin to a GPIO pin configured as an input, and ensure the operating voltage is 3.3V to avoid damaging the Raspberry Pi.

Q: Does the module work with 3.3V microcontrollers?
A: Yes, the module operates at both 3.3V and 5V, making it compatible with a wide range of microcontrollers.

Q: How do I extend the button's functionality?
A: You can use the button to trigger interrupts, control relays, or navigate menus in your project. Modify the code to suit your specific application.

By following this documentation, you can effectively integrate the Keyestudio Button Sensor Module into your projects and troubleshoot any issues that arise.