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

Arduino UNO Keypad-Controlled LED and Buzzer System with RTC and Bluetooth

View and Edit Project In Cirkit DesignerImage of Arduino UNO Keypad-Controlled LED and Buzzer System with RTC and Bluetooth

Circuit Documentation

Summary

This circuit is designed to interface a 4x4 membrane matrix keypad with an Arduino UNO. The circuit also includes a red and green LED, a buzzer, an RTC-DS1302 module, an HC-05 Bluetooth module, and an NPN transistor. The Arduino UNO reads the key pressed on the keypad and prints it to the serial monitor. The LEDs and buzzer provide visual and auditory feedback, respectively.

Component List

  1. LED: Two Pin (red)

    • Description: A red LED with two pins: cathode and anode.
    • Purpose: Provides visual feedback.
  2. 4X4 Membrane Matrix Keypad

    • Description: A 4x4 matrix keypad with 8 pins: R1, R2, R3, R4, C1, C2, C3, C4.
    • Purpose: Allows user input.
  3. Arduino UNO

    • Description: A microcontroller board with multiple digital and analog I/O pins.
    • Purpose: Central control unit for the circuit.
  4. LED: Two Pin (green)

    • Description: A green LED with two pins: cathode and anode.
    • Purpose: Provides visual feedback.
  5. Resistor (200 Ohms)

    • Description: A resistor with a resistance of 200 Ohms.
    • Purpose: Limits current to the LEDs.
  6. Resistor (2000 Ohms)

    • Description: A resistor with a resistance of 2000 Ohms.
    • Purpose: Limits current in the transistor circuit.
  7. Buzzer

    • Description: A buzzer with two pins: PIN and GND.
    • Purpose: Provides auditory feedback.
  8. NPN-Transistor

    • Description: An NPN transistor with three pins: E (Emitter), C (Collector), B (Base).
    • Purpose: Controls the buzzer.
  9. RTC-DS1302

    • Description: A real-time clock module with five pins: Vcc, GND, CLK, DAT, RST.
    • Purpose: Keeps track of time.
  10. HC-05

    • Description: A Bluetooth module with six pins: STATE, RXD, TXD, GND, VCC, EN.
    • Purpose: Enables Bluetooth communication.

Wiring Details

LED: Two Pin (red)

4X4 Membrane Matrix Keypad

Arduino UNO

LED: Two Pin (green)

Buzzer

NPN-Transistor

RTC-DS1302

HC-05

Code Documentation

/*
 * This Arduino sketch interfaces with a 4x4 membrane matrix keypad.
 * The rows of the keypad are connected to digital pins 9, 8, 7, and 6.
 * The columns of the keypad are connected to digital pins 5, 4, 3, and 2.
 * The code reads the key pressed on the keypad and prints it to the serial monitor.
 */

#include <Keypad.h>

const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns

// Define the keymap
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = {9, 8, 7, 6};
// Connect keypad COL0, COL1, COL2 and COL3 to these Arduino pins.
byte colPins[COLS] = {5, 4, 3, 2};

// Create the Keypad
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void setup() {
  Serial.begin(9600);
}

void loop() {
  char key = keypad.getKey();
  if (key) {
    Serial.println(key);
  }
}

This code initializes the keypad and sets up the serial communication. In the loop function, it continuously checks for key presses and prints the pressed key to the serial monitor.