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

ESP8266 Multi-Tool with RFID, IR, RF, and Wi-Fi Control

View and Edit Project In Cirkit DesignerImage of ESP8266 Multi-Tool with RFID, IR, RF, and Wi-Fi Control

Circuit Documentation

Summary

This circuit is a multi-functional tool based on the ESP-8266 microcontroller. It integrates various modules including an RFID reader, an IR transmitter and receiver, an RF module, an SD card module, and an I2C LCD display. The circuit also includes multiple pushbuttons for user interaction. The ESP-8266 handles Wi-Fi connectivity and serves a web interface for controlling and monitoring the different modules.

Component List

  1. ESP-8266 Controller

    • Description: A Wi-Fi enabled microcontroller used to control the entire circuit.
    • Pins: A0, RSV, SD3, SD5, SD1, CMD, D0, D1, D2, D3, D4, 3V3, GND, D5, D6, SD0, CLK, RST, EN, D7, D8, RX, TX, Vin, 5V
  2. CC1101

    • Description: An RF transceiver module used for wireless communication.
    • Pins: VCC, GND, GDO0, SCLK, SO, GDO2, SI, CSN
  3. RFID-RC522

    • Description: An RFID reader module used for reading RFID tags.
    • Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
  4. SD Card Module

    • Description: A module for interfacing with SD cards.
    • Pins: CS, SCK, MOSI, MISO, VCC, GND
  5. 16x2 I2C LCD

    • Description: An I2C-based LCD display for showing information.
    • Pins: GND, VCC, SDA, SCL
  6. Pushbutton

    • Description: A simple pushbutton used for user input.
    • Pins: Pin 2, Pin 1, Pin 3, Pin 4
  7. VS1838B IR Receiver

    • Description: An IR receiver module used for receiving IR signals.
    • Pins: OUT, GND, VCC
  8. IR Transmitter

    • Description: An IR LED used for transmitting IR signals.
    • Pins: DAT, VCC, GND

Wiring Details

ESP-8266 Controller

CC1101

RFID-RC522

SD Card Module

16x2 I2C LCD

Pushbutton

VS1838B IR Receiver

IR Transmitter

Code Documentation

Main Code

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <MFRC522.h>
#include <ELECHOUSE_CC1101.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <IRrecv.h>
#include <IRutils.h>
#include <SD.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Wi-Fi credentials
const char* ssid = "Your_WiFi_SSID";
const char* password = "Your_WiFi_PASSWORD";

// Web server on port 80
ESP8266WebServer server(80);

// RFID Setup
#define RST_PIN D3
#define SDA_PIN D4
MFRC522 rfid(SDA_PIN, RST_PIN);

// CC1101 Setup
#define CC1101_CS_PIN D2

// IR Setup
#define IR_LED_PIN D1
IRsend irsend(IR_LED_PIN);
IRrecv irrecv(D5);
decode_results results;

// SD Card Setup
#define SD_CS_PIN D8

// LCD Setup
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Button Setup
#define BTN_UP D6
#define BTN_DOWN D7
#define BTN_LEFT D9
#define BTN_RIGHT D10
#define BTN_SELECT D0

// Navigation variables
int currentMenu = 0;
const char* menus[] = {"RFID", "IR", "RF", "Wi-Fi Scan", "Files"};
const int numMenus = sizeof(menus) / sizeof(menus[0]);

// Function prototypes
void handleRoot();
void handleRFID();
void handleIR();
void handleRF();
void handleWiFiScan();
void handleFileList();
void updateLCD();
void handleButtonPress();

void setup() {
  Serial.begin(115200);

  // Wi-Fi Setup
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to Wi-Fi...");
  }
  Serial.println("Wi-Fi connected. IP address: " + WiFi.localIP().toString());

  // Web Server Setup
  server.on("/", handleRoot);
  server.on("/rfid", handleRFID);
  server.on("/ir", handleIR);
  server.on("/rf", handleRF);
  server.on("/wifi_scan", handleWiFiScan);
  server.on("/files", handleFileList);
  server.begin();

  // RFID Setup
  SPI.begin();
  rfid.PCD_Init();

  // CC1101 Setup
  ELECHOUSE_cc1101.setCS(CC1101_CS_PIN);
  ELECHOUSE_cc1101.Init();

  // IR