Thursday, September 24, 2020

RFID based home automation with door lock

 

RFID-Based Home Automation Using Arduino: A Step-by-Step Guide

The advent of IoT has paved the way for smarter and more secure home automation systems. RFID (Radio Frequency Identification) technology, paired with Arduino, offers a simple yet effective solution for automated access control. In this blog, we’ll create an RFID-based home automation system that allows you to control appliances or secure access through RFID tags.


Overview of the System

This project leverages an RFID reader to identify unique RFID tags. Once a tag is detected, the Arduino processes the tag's ID and performs actions like turning appliances on/off, unlocking doors, or activating devices based on predefined logic.


Components Required

  1. Arduino Board (e.g., Uno, Mega)
  2. RC522 RFID Module
  3. RFID Tags
  4. Relay Module (for controlling appliances)
  5. 12V DC Power Supply (optional for external devices)
  6. LEDs (for status indication)
  7. Buzzer (optional for feedback)
  8. Connecting Wires and Breadboard
  9. Home Appliances (like a light bulb or fan)

Circuit Diagram

The setup involves connecting the RC522 RFID module, relay module, and any additional indicators like LEDs or buzzers to the Arduino.

Connections for RC522 RFID Module:

Pin Name RC522 Pin Arduino Pin
VCC 3.3V 3.3V
RST RST Pin 9
GND GND GND
IRQ Not Used -
MISO MISO Pin 12
MOSI MOSI Pin 11
SCK SCK Pin 13
SDA SDA Pin 10

Relay Module:

  • Connect the relay input to a digital pin on the Arduino (e.g., Pin 8).
  • The relay output connects to the appliance's power line.

Software Setup

Required Libraries

  • Install the MFRC522 library for the RFID module.
    1. Open Arduino IDE.
    2. Go to Sketch > Include Library > Manage Libraries.
    3. Search for MFRC522 and install it.

Arduino Code

Here’s a basic code example to read an RFID tag and control a relay:

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 9
#define SS_PIN 10
#define RELAY_PIN 8

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(9600);
  SPI.begin();
  mfrc522.PCD_Init();
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, LOW); // Ensure the relay is off initially
  Serial.println("Place your RFID tag near the reader...");
}

void loop() {
  // Look for new RFID cards
  if (!mfrc522.PICC_IsNewCardPresent()) return;
  if (!mfrc522.PICC_ReadCardSerial()) return;

  // Read RFID tag UID
  String tagID = "";
  for (byte i = 0; i < mfrc522.uid.size; i++) {
    tagID += String(mfrc522.uid.uidByte[i], HEX);
  }

  Serial.println("Tag ID: " + tagID);

  // Verify if tag ID matches the predefined ID
  if (tagID == "a1b2c3d4") { // Replace with your RFID tag's unique ID
    Serial.println("Access Granted! Activating Relay...");
    digitalWrite(RELAY_PIN, HIGH); // Turn ON appliance
    delay(5000); // Keep it on for 5 seconds
    digitalWrite(RELAY_PIN, LOW);  // Turn OFF appliance
  } else {
    Serial.println("Access Denied!");
  }

  mfrc522.PICC_HaltA();
}


Working Video





    How It Works

    1. Tag Scanning: When an RFID tag is brought near the RC522 module, the Arduino reads its unique ID.
    2. Authentication: The Arduino compares the tag ID with predefined IDs stored in the code.
    3. Action Trigger: If the tag ID matches, the Arduino activates the relay to turn on an appliance or unlock a door.

    Applications

    1. Home Automation: Control lights, fans, or other appliances using authorized RFID tags.
    2. Access Control: Secure doors by integrating a motorized lock with the relay.
    3. Office Management: Restrict access to specific areas for authorized personnel.

    Enhancements

    • Database Integration: Use an SD card module or IoT platform to dynamically update authorized RFID tags.
    • Mobile App Control: Combine RFID with a Wi-Fi module (e.g., ESP8266) for app-based monitoring and control.
    • Multiple Appliances: Use multiple relays to control various devices.

    Conclusion

    An RFID-based home automation system is an efficient way to enhance security and convenience in modern homes. With Arduino as the backbone, the system is both affordable and customizable. Dive into this project to explore the endless possibilities of RFID technology in IoT applications.



    Wednesday, September 2, 2020

    PCB designing using circuit maker

     CIRCUIT MAKER

    INTRODUCTION

    PCB is a acronym of Printed Circuit Board that helps in connecting the electronics components with pads, tracks and lines incorporated on a laminated copper sheet.In order to get rid of end to end wiring and make the circuit design hassle free, first PCB was developed by Australian Engineer Paul Eisler.PCB designing is very useful for both electronics engineers and for  hobbyist. PCB designing is very long process it can take more then  2 days,because choosing or finding  components is very long process . PCBs come in different layers and multiple designs. PCBs used in simple electronics are composed of single layer  Most compact and advanced hardware like graphics card and motherboard are composed of multi layers PCBs.

    Why CIRCUIT MAKER 

    There are many pcb designing software for example :
    •  Eagle 
    •  KI-cad
    •  altium 
    •  proteus 
    • and many more 
    Above mentioned software's are paid software expect Ki-cad but ki-cad interference is not that much impressive.
    But circuit maker is free to use software with huge community and linked with huge  electronics supplier octopart ,which make PCB designing easy,Circuit maker is also connected to cloud so all design will stay with software which make Circuit maker more  portable 

    HOW TO USE CIRCUIT MAKER

    • Visit https://circuitmaker.com and download the software by creating new id 
    • after that install the circuit maker on the computer 
    • open the circuit maker 
    • Then go to my project and add new project
    • now name your project and there you will see two options  
            1. public 
            2. sandbox
    • public as name suggest it will make design public and sandbox means private 
    • now name your project and save that and then open that project by clicking on it 

    • now right click on the for blog(name of your file )
    • then add new project and pcb add both of them and name them if you want otherwise just click on ok 
    • now you will see both pcb and sheet opened 
    • now add components by clicking c 
    • now click on choose and then make sure you set libraries to octopart 
    • now any component can be added for better searching use digikey.com and find components there and believe me its the hardest part in the pcb designing which circuit maker made easy, because many components are already added to the circuit maker only worry about the footprint and the symbol 
    • here i will design the simple 555  astable mutivibrator which just flash the led

     
     

    • Now toughest part choosing components so first decide what components you need smd or through hole , for simplicity i go with through hole and choose what resistor you want so i want 1/8 watt resistors and capacitor value of 10uf  remember if you some how not able to find your desired component just replace that with any for example i want 10k resistor but i am not able to find its footprint (which is important ) ,but 100k one is available so what i will do is simple wasting my time in making footprints i just use 100k  because there size and lead spacing are same 

        
    • i  found this on digikey (296-NE555P-ND )and luckily it has 3d footprint some components dont have 3d footprints (because nobody made that ) to move or rotate it hold ctrl+shift+rightmouse and then move mouse to rotate the 3d footprint down yellow one is 2d print which is real footprint 
    • To show that you can replace any resistance here i have example found on digi key so first image is of 100 ohm resistance and second one is 10k resistance 





                                                                          100 ohm resistance see size and dimension 
                                                            



                                                                     10k ohm resistance see its size and dimension 
    • so its proved that i can use any component but always take look at spacing while choosing components  



    • our circuit is completed and you can see the red lines and question-mark sign in front of components and thats because they are not named properly and to name them there is two way first is by clicking on every components and naming them second is easy and very useful for big circuits for that go to tools >Annotate >annotate quietly  
    • now ctrl+S to save and go to project and then click on commit project
    • now open pcb there only pcb is available but not component  for that go to project and click on import project and then click on validate changes and then execute changes now you will see all components are available there
    • now make board small by going to board shape>edit board shape 
    • now place components click 3 on computer keyboard 





    • now we make pour which means every single ground will get connected 
    • down there you can switch from boards too see the layers its 2 layer  board so it only contains top and bottom layer
    • now click  2 on your keyboard now go to polygen pour

    • this menu will popup now connect to net means which net wanted to be pour its very samll board so this contains few nets and select ground and layer means which layer you want so first we do  for the top and then for bottom 
    • select all the parameters and then click ok 


    • now click on edges to make pour 

    • this is how it look after doing pour on both edges now same for bottom layer 
    • after completing this steps zoom in and see the changes the ground pins are now connected together 




    • this how ground will look like now click on r to route because this is very small circuit we can use auto router go to tools click on auto route>all
    • after auto routing this is how it gonna look like 



    • this is the 3D look of pcb 

    Conclusion 

    this was just the overview of the circuit maker there are so many thing i cant explain in this small projects like ports, netlabel  routing methods, via's ,routing size and many more.but by this blog anyone who is interested in designing pcb can start their journey and explore things by them self or with the help of  circuit maker community 
    components list i used in this project from digikey 
    1. UVR1V100MDD (capacitor  

      )
    2. PPTC031LFBN-RC ( female header)
    3. CF18JT10K0 (Resistor)
    4. 296-NE555P-ND (555 ic)


    Electronic Dice With 7 – Segment Display

    Aim The Aim of this project is to learn, study and create different ICs in digital logic and designing and create a unique project. This pro...