Seven Segment IR Receiver Home Alarm System

by ishreetgrewal1 in Circuits > Arduino

472 Views, 0 Favorites, 0 Comments

Seven Segment IR Receiver Home Alarm System

F2BD9A56-4373-46C1-BAD7-891515B41E44.jpeg

This is the perfect project to start if you want to learn how to use the 4 digit 7 segment display as well as create something cool that can actually be implemented around your house. You don't have to use a 4 digit 7 segment display you can definitely use a single-digit display and it should work fine. Hope you guys like this project!

Before you get started make sure you connect 5V to the power to the power rail on the breadboard and connect GND pin to ground on the breadboard.

Supplies

  • 4 digit 7 segment display
  • Red and Green LED
  • Ultrasonic Sensor
  • IR Receiver
  • Buzzer
  • Jumper Wires (a lot of them)
  • Breadboard
  • Arduino UNO

Step 1: Setting Up 7 Segment Display

Arduino-7-Segment-Tutorial-4-Digit-Display-Pin-Diagram.png

The first thing you want to do is set up your seven-segment display.

  1. Connect Pin 'E' to pin 2 on the Arduino
  2. Connect Pin 'D' to pin 3 on the Arduino
  3. Connect Pin 'C' to pin 4 on the Arduino
  4. Connect Pin 'G' to pin 5 on the Arduino
  5. Connect Pin 'D' to pin 6 on the Arduino
  6. Connect Pin 'D4' to pin 7 on the Arduino
  7. Connect Pin 'A' to pin 8 on the Arduino
  8. Connect Pin 'F' to pin 9 on the Arduino
  9. Connect Pin 'D3' to pin 10 on the Arduino
  10. Connect Pin 'D2' to pin 11 on the Arduino
  11. Connect Pin 'B' to pin 12 on the Arduino

Please refer to the picture above for the names of each pin on the 7 segment display.

Step 2: Setup IR Receiver

IR reciver.jpeg

There are 3 legs on the IR receiver. The leg on the far right is VCC (power), the leg on the far left if OUT (connect to a pin), and the middle leg is for GND.

  • Connect the VCC to the power rail on the breadboard
  • Connect the OUT pin to A2 on the Arduino
  • Connect the GND pin to the ground rail on the breadboard

Step 3: Setup Ultrasonic Sensor and Buzzer

buzzer.jpg
Ultrasonic-sensor-pinout.png

Ultrasonic Sensor

  • Connect GND to ground rail on the breadboard
  • Connect Echo pin to pin A1 on the Arduino
  • Connect Trig pin to pin A0 on the Arduino
  • Connect VCC to the power rail on the breadboard

Buzzer

  • Connect the short leg of the active buzzer to GND
  • Connect the long leg of the active buzzer to pin 13 on the Arduino

Step 4: Setup LEDs

led_AOuhtzYEQe.png
  • Connect both short legs of the LEDs to GND rail on the breadboard
  • Connect the red LED's long leg to pin A4 on the Arduino
  • Connect the green LED's long leg to pin A5 on the Arduino

Step 5: Receive HEX Codes From Remote

code.jpeg

Before you get started on the code be sure to get a TV remote and get decode the HEX codes for your remote. You would need to decode 3 numbers for this project (for the password to your 'house'). Don't forget to download the IR remote library.

To do this use this code:

#include <IRremote.h>

void setup()

{

Serial.begin(9600);

irReceiver.enableIRIn();

}

void loop() {

if (irReceiver.decode(&result)) {

irReceiver.resume();

Serial.println(result.value, HEX);

} }

Step 6: Final Code

The Link is above. If you have any questions about the code let me know.