Skip to content

Nauman3S/SmartSocket

Repository files navigation

Project logo

SmartSocket

Status


SmartSocket

📝 Table of Contents

📜 About

This repo contains

  • Backend
  • Firmware
  • Detailed instructions



Smart Socket

Getting Started

These instructions will get you a copy of the project up and running on your system.

Prerequisites

Things you need to install the FW.

- Arduino IDE

Installing

A step by step series that tell you how to get the Firmware and Backend running

ESP32 Configuration(Frequency Counter)

You should have Arduino IDE Installed

  1. Add ESP32 Board to your Arduino IDE

  2. In your Arduino IDE, go to File> Preferences Installing ESP32 Add-on in Arduino IDE Windows, Mac OS X, Linux open preferences

  3. Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” field then, click the “OK” button: Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma(each board will go to neaw line) as follows: https://dl.espressif.com/dl/package_esp32_index.json,\n http://arduino.esp8266.com/stable/package_esp8266com_index.json

  4. Open the Boards Manager. Go to Tools > Board > Boards Manager…

  5. Search for ESP32 and press install button for the ESP32 by Espressif Systems“:

  6. That’s it. It should be installed after a few seconds.

  7. In your Arduino sketchbook directory, create tools directory if it doesn't exist yet.

  8. Unpack the tool into tools directory(present in libs/ESP32FS-1.0.zip) (the path will look like <home_dir>/Arduino/tools/ESP32FS/tool/esp32fs.jar).

  9. Close and re-open the Arduino IDE.

  10. Now copy the contents of the libs folder to the libraries directory of your Arduino

    1. If you are using windows, the libraries directory will be Documents/Arduino/libraries
ESP32 Node FW Uploading
  1. Select ESP32 Dev Module from Tools->Board->ESP32
  2. Select the correct port from Tools->Port
  3. Then open FSP32_FW.ino file from Firmware/FreqMonitor/ESP32_FW folder.
  4. Select Tools > ESP32 Sketch Data Upload menu item. This should start uploading the files into ESP32 flash file system.
  5. Now Upload the Code to your ESP32 Dev Module.
  6. Your ESP32 is now ready to be used.

🔌Circuit

ESP32 LILYGO®TTGO T-PCIE Module Pinout

Follow the pinout diagram given below to connect different components to your ESP32 LILYGO®TTGO T-PCIE Module board.

Pinout

Complete Circuit Diagram

Here's the complete circuit diagram of the system.

CircuitDiagram

Other Components

Other components pin connection details

Smart Socket Circuit

Different Components connected to Arduino Pro Mini for Frequency Measurements

ESP32 LILYGO®TTGO T-PCIE Connections

Arduino Pro Mini Connected with ESP32

Relay ESP32
CH1 12
DC+ 5V
DC- GND
  • CH1 pin is connected via Logic Level Shifter

LED

LED Connected with ESP32

LED Pins ESP32
Pin 1(Long Pin) 36
Pin 2 GND

💻WebApp

WebApp can be accessed from the link below

TO BE ADDED

Data

Data published from the device would be in the JSON format given below:

{
  "macAddress": "",
  "Name": "",
  "Address": "",
  "RSSI": ""
}

MQTT Topics

MQTT Topic Details

  • As seen from ESP32
Topic Type Details
SmartSocket/device/data PUBLISH Publishes the socket state string

FrontEnd

  • The WebApp is developed using NodeJS, ReactJS and MongoDB.

TO BE ADDED

Database

You can access the database from the link below

TO BE ADDED

Usage

  1. Upload the code to your Arduino Pro Mini
  2. Upload the code to your ESP32
  3. Make the circuit
  4. Power on your ESP32, it will present you with an AP named SmartEFM-abcd (while SmartEFM can be changed in the portal and abcd is a unique id for each esp32)
  5. Default captive portal password 123456789AP which can be changed in captive portal.
  6. Connect to the ESP32 access point and open the web-browser and navigate to the link http://esp32.local/_ac. This link will work on most of the operating systems but if your operating system is not allowing to open it, you may want to check the captive portal IP Address from the serial monitor and can use that IP address inplace of the above mentioned URL.
  7. The default access IP Address is http://192.168.4.1/_ac
  8. You will be presented with a main dashboard as shown below(based on your device) SCR1
    • You can also open http://esp32.local/ to access the CaptivePortal. SCR1
  9. You can connect to WiFi, from "Connect to WiFi" menu SCR1
  10. Once connected to a WiFi network, you can again access the captive portal using same URL or the IP Address from the Serial monitor.
  11. You can open settings page with following default credentials
  12. User: AP Name (SmartEFM)
  13. Password: admin

In settings page, you can configure your device. You can set network type (WiFi/GPRS) and you can set network APN details as well. SCR1

  1. Open the test dashboard to see the live data



PCB

TO BE ADDED

Casing

CAEFM CAEFMTOP



List of Components

Following components are used to make this project

  1. Microcontrollers

  2. Power Circuit

  3. Misc

⛏️ Built Using <>

  • Arduino - Embedded Framework and IDE - For Sensor Node Design

✍️ Authors

About

SmartSocket Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published