

The Pmod BTN is a versatile input module manufactured by Digilent, featuring four user pushbuttons. This module allows users to interact with electronic circuits by pressing the buttons, making it ideal for applications requiring manual input. The Pmod BTN is commonly used in prototyping, educational projects, and embedded systems to provide a simple and reliable way to capture user input.








The Pmod BTN is designed to interface seamlessly with microcontrollers and FPGAs. Below are its key technical details:
The Pmod BTN uses a 6-pin header for connection. The pinout is as follows:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | BTN1 | Output signal for Button 1 |
| 2 | BTN2 | Output signal for Button 2 |
| 3 | BTN3 | Output signal for Button 3 |
| 4 | BTN4 | Output signal for Button 4 |
| 5 | GND | Ground |
| 6 | VCC | Power supply (3.3V or 5V) |
The Pmod BTN is straightforward to use in a circuit. Follow the steps below to integrate it into your project:
Each button on the Pmod BTN outputs a digital signal:
Below is an example of how to use the Pmod BTN with an Arduino UNO to read button states and print them to the Serial Monitor.
// Define the pins connected to the Pmod BTN
const int btn1Pin = 2; // Button 1 connected to digital pin 2
const int btn2Pin = 3; // Button 2 connected to digital pin 3
const int btn3Pin = 4; // Button 3 connected to digital pin 4
const int btn4Pin = 5; // Button 4 connected to digital pin 5
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Set button pins as inputs with pull-up resistors
pinMode(btn1Pin, INPUT_PULLUP);
pinMode(btn2Pin, INPUT_PULLUP);
pinMode(btn3Pin, INPUT_PULLUP);
pinMode(btn4Pin, INPUT_PULLUP);
}
void loop() {
// Read the state of each button
int btn1State = digitalRead(btn1Pin);
int btn2State = digitalRead(btn2Pin);
int btn3State = digitalRead(btn3Pin);
int btn4State = digitalRead(btn4Pin);
// Print button states to the Serial Monitor
Serial.print("BTN1: ");
Serial.print(btn1State == LOW ? "Pressed" : "Released");
Serial.print(" | BTN2: ");
Serial.print(btn2State == LOW ? "Pressed" : "Released");
Serial.print(" | BTN3: ");
Serial.print(btn3State == LOW ? "Pressed" : "Released");
Serial.print(" | BTN4: ");
Serial.println(btn4State == LOW ? "Pressed" : "Released");
// Add a small delay to avoid spamming the Serial Monitor
delay(200);
}
No Response from Buttons
Button States Fluctuate Rapidly
Incorrect Voltage Levels
Q: Can I use the Pmod BTN with a Raspberry Pi?
A: Yes, the Pmod BTN can be used with a Raspberry Pi. Connect the button output pins to GPIO pins on the Raspberry Pi and use pull-up resistors (internal or external) to read the button states.
Q: Do I need external pull-up resistors?
A: If your microcontroller does not have internal pull-up resistors, you will need to add external pull-up resistors (e.g., 10kΩ) to each button output pin.
Q: Can I use fewer than 4 buttons?
A: Yes, you can use only the buttons you need. Leave the unused button output pins unconnected.
By following this documentation, you can effectively integrate the Pmod BTN into your projects and troubleshoot any issues that arise.