Introduction: DIY Magnetic Reed Switch Door Monitoring System Using ESP32 and VVAC Cloud Dashboard
In this simple yet powerful IoT project, you will learn how to use a Magnetic Reed Switch with an ESP32 to build your own Smart Door Monitoring System, complete with real-time status updates on the VVAC IoT Dashboard.
A Reed Switch is a small, low-cost magnetic sensor commonly used for:
- Home & office security systems
- Door/Window monitoring
- Smart cabinets
- Attendance/entry logging
- Intrusion detection
- Industrial automation
This project is beginner-friendly, affordable, and perfect for IoT beginners who want a full security-based cloud project.
Supplies
- ESP32 Dev Board
- Magnetic Reed Switch
- Jumper wires
- Breadboard
- A Wi-Fi connection
- V-VAC Account
Step 1: Wiring the Magnetic Reed Switch
Connect the Esp32 and Sensor according to the connection Diagram.
polarity doesn't matter.
Step 2: Installing Libraries
Open the Arduino IDE, navigate to the Library Manager, and install the required libraries listed below.
- WiFi by Arduino // This library is usually built-in, but verify that it is installed.
- PubSubClient by Nick O'Leary
Step 3: VVAC Cloud Setup
Steps to Connect V-VAC :
- Log in to your V-VAC account. (Create a new account if not signed up already.)
- In the Devices section add a new device.
- Select common device and enter the details of the device.
- Copy the Device Token and paste it in the MQTT section of the code.
- Copy the username and password from the setup in devices section and paste it in the MQTT section of the code.
For further details check out (How to connect to V-VAC).
Step 4: Upload the Code
Step 5: View Live Data in V-VAC
- In Dashboard section you can configure widgets for your required data.
- Click “Create Dashboard”.
- Give your dashboard a name (e.g., Door Status Dashboard).
- Click the 3rd icon in the dashboard to open the dashboard.
- Inside the dashboard editor, click “Edit” and click "Add Widget" to add new widgets.
- In the selection menu choose the required widget.
- Link widget to a Device telemetry key (the data your device sends).
- After customizing your widget, click the Show on Dashboard button to display it on the dashboard.
- To save your changes, click the Save button at the top-right corner of the dashboard.
- You can now remotely see the Door status from anywhere around the world.
For more IoT projects and tutorials, visit the official V-VAC Platform - V-VAC.





