U5·03

Smart Parking System

ESP32 NEXT.JS REDIS IoT

A complete full-stack IoT parking solution featuring an ESP32 hardware controller, a Next.js web application for real-time monitoring, and a serverless Upstash Redis database for shared state. It includes dynamic pricing logic and a simulated test-mode payment gateway for card and UPI checkouts.

Download Documentation PDF ↓

Architecture Overview

The system is built on a modern serverless architecture. The ESP32 Device reads ultrasonic occupancy sensors to determine slot availability and calculates pricing based on parking duration. It also controls the physical gate and an LCD display.

The Next.js Website serves as the frontend, providing a public status page for drivers to view live availability and pay their dues. It also includes an owner dashboard for managing pricing and viewing payment history. The state is synchronized across the device and website using an Upstash Redis database.

System Components

ESP32 Microcontroller

The core hardware unit. It polls ultrasonic sensors, computes prices, POSTs status to the API every 2 seconds, and controls the servo gate and LCD display.

Next.js API & Frontend

Provides serverless API routes (`/api/report`, `/api/status`, `/api/pay`) that act as a bridge between the hardware and the Redis database. Hosts the public payment UI and admin portal.

Upstash Redis

Holds the shared state: slot status, current pricing rates, pending payment confirmations, and order history.

Simulated Payment Gateway

A realistic test-mode checkout flow that supports simulated Card and UPI transactions. It mirrors a real 2-step gateway (create order -> confirm order) with an ~80% approval rate.

Ultrasonic Sensors (HC-SR04)

Used to detect the presence of vehicles in the parking slots.

Hardware & Prototype Gallery

Photos of the breadboard prototype showing the ESP32, HC-SR04 sensors, LCD, and servo motor setup.

Video Demonstration