Circuit Documentation
Summary
This circuit integrates an Arduino UNO microcontroller with an RFID-RC522 module, a GPS NEO 6M module, a 5V relay, and a SIM900A module. The Arduino UNO serves as the central controller, interfacing with the RFID module for scanning RFID tags, the GPS module for location data, the relay for switching operations, and the SIM900A for GSM communication.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
RFID-RC522
- Description: A low-cost RFID module that uses SPI communication.
- Pins: SDA, SCK, MOSI, MISO, IRQ, GND, RST, 3.3V
GPS NEO 6M
- Description: A GPS module for obtaining location data.
- Pins: VCC, RX, TX, GND
5V Relay
- Description: A relay module for switching high voltage devices.
- Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
SIM900A
- Description: A GSM module for communication over cellular networks.
- Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
Wiring Details
Arduino UNO
- D10 connected to RFID-RC522 SDA
- D13 connected to RFID-RC522 SCK
- D11 connected to RFID-RC522 MOSI
- D12 connected to RFID-RC522 MISO
- GND connected to GPS NEO 6M GND, RFID-RC522 GND, 5V Relay GND, SIM900A GND
- D9 connected to RFID-RC522 RST
- 3.3V connected to RFID-RC522 3.3V
- 5V connected to GPS NEO 6M VCC, 5V Relay VCC, SIM900A 5V
- D8 connected to 5V Relay In
- D7 connected to GPS NEO 6M TX
- D6 connected to GPS NEO 6M RX
- D3 connected to SIM900A DB9-2 (TXD)
- D2 connected to SIM900A DB9-3 (RXD)
RFID-RC522
- SDA connected to Arduino UNO D10
- SCK connected to Arduino UNO D13
- MOSI connected to Arduino UNO D11
- MISO connected to Arduino UNO D12
- GND connected to Arduino UNO GND
- RST connected to Arduino UNO D9
- 3.3V connected to Arduino UNO 3.3V
GPS NEO 6M
- VCC connected to Arduino UNO 5V
- RX connected to Arduino UNO D6
- TX connected to Arduino UNO D7
- GND connected to Arduino UNO GND
5V Relay
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- In connected to Arduino UNO D8
SIM900A
- 5V connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- DB9-2 (TXD) connected to Arduino UNO D3
- DB9-3 (RXD) connected to Arduino UNO D2
Code Documentation
/* RFID tag scan code
* https://srituhobby.com
*/
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 9
#define SS_PIN 10
byte readCard[4];
byte a = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
MFRC522 mfrc522(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
while (!Serial);
SPI.begin();
mfrc522.PCD_Init();
delay(4);
mfrc522.PCD_DumpVersionToSerial();
lcd.setCursor(2, 0);
lcd.print("Put your card");
}
void loop() {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return 0;
}
if ( ! mfrc522.PICC_ReadCardSerial()) {
return 0;
}
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Scanned UID");
a = 0;
Serial.println(F("Scanned PICC's UID:"));
for ( uint8_t i = 0; i < 4; i++) { //
readCard[i] = mfrc522.uid.uidByte[i];
Serial.print(readCard[i], HEX);
Serial.print(" ");
lcd.setCursor(a, 1);
lcd.print(readCard[i], HEX);
lcd.print(" ");
delay(500);
a += 3;
}
Serial.println("");
mfrc522.PICC_HaltA();
return 1;
}
This code initializes the RFID-RC522 module and an LCD display. It continuously checks for new RFID cards and displays the UID of the scanned card on both the serial monitor and the LCD.
