Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoStelle

Real time parking occupancy monitoring and RFID gate access, built on an ESP32 and Firebase, with a static web dashboard.

License: AGPL v3 Platform: ESP32 Backend: Firebase RTDB

Contents

Overview

AutoStelle monitors a small car park and controls a barrier at its reserved bays. Ultrasonic sensors report whether each slot is occupied, an RFID reader decides who may pass, and a browser dashboard shows the current state to anyone who opens it.

Capability Description
Occupancy monitoring One ultrasonic sensor per slot; state changes are pushed to the database and appear in the dashboard within about a second
Access control Tag UIDs are checked against the database on every tap; unknown tags are refused
Tag enrolment Admins register a tag from the browser through a scan handshake, with no reflashing
Register management Search, sort, delete and bulk delete of registered tags
Access model Occupancy is world readable, everything else requires a signed in account
Credential handling Firmware credentials live in an untracked arduino_secrets.h

The reference build uses six slots, three normal and three reserved. The slot count is set by the pin arrays in the firmware, and by the slot markup and slot map in the web app; see Configuration.

How it works

flowchart LR
  subgraph Site
    US[Ultrasonic sensors] --> ESP[ESP32]
    RF[MFRC522 reader] --> ESP
    ESP --> SV[Gate servo]
  end

  ESP <-->|sign in + read/write| FB[(Firebase Realtime Database)]

  subgraph Browser
    MON[Monitor page]
    ADM[Admin panel]
  end

  FB -->|live listeners| MON
  FB <-->|sign in + writes| ADM
Loading

The database is the only channel between the device and the browser. Neither side talks to the other directly, so the dashboard works from any network.

The firmware uses both ESP32 cores. Core 1 runs a task that sweeps the sensors and writes occupancy; core 0 runs the Arduino loop(), which reads tags and drives the servo. Each has its own Firebase connection object.

Full data model and the enrolment sequence: docs/FIREBASE.md.

Requirements

Category Requirement
Hardware ESP32 development board, one HC-SR04 per slot, MFRC522 reader and tags, hobby servo, 5 V supply. Details in docs/HARDWARE.md
Firmware toolchain Arduino IDE 2.x with the ESP32 board package, or PlatformIO
Backend A Firebase project with Realtime Database and Email/Password authentication, on the free plan
Web Any static file server for local use; a modern browser with ES module support

Repository layout

AutoStelle/
|-- web/                      static dashboard, no build step
|   |-- index.html            monitor page and admin panel
|   |-- login.html            admin sign in
|   |-- assets/css/style.css
|   `-- src/
|       |-- config.js         Firebase project config and database paths
|       |-- firebase.js       app, auth and database handles
|       |-- login.js          sign in flow
|       |-- monitor.js        live slots, enrolment, register
|       `-- ui.js             modals and password toggle
|
|-- firmware/
|   |-- AutoStelle/
|   |   |-- AutoStelle.ino              sketch
|   |   |-- config.h                    pins, thresholds, database paths
|   |   `-- arduino_secrets.example.h   credential template
|   |-- platformio.ini                  optional PlatformIO build
|   `-- README.md                       libraries, board settings, upload
|
|-- database/rules.json       Realtime Database security rules
|-- docs/                     setup, hardware, Firebase, configuration
`-- .github/workflows/        Pages deploy, firmware compile check

Installation

Summary; the step by step guide is docs/SETUP.md.

git clone https://github.com/EagleStelle/AutoStelle.git
cd AutoStelle
  1. Backend. Create a Firebase project, enable Realtime Database and Email/Password sign in, create an admin user and a device user, then apply database/rules.json. See docs/FIREBASE.md.

  2. Web app. Put your own Firebase project values in web/src/config.js, then serve the web folder. ES modules do not load over file://:

    cd web
    python -m http.server 5500     # then open http://localhost:5500
  3. Firmware. Create the credentials file, fill it in, and upload:

    cp firmware/AutoStelle/arduino_secrets.example.h firmware/AutoStelle/arduino_secrets.h

    Open firmware/AutoStelle/AutoStelle.ino in the Arduino IDE, select ESP32 Dev Module, and upload. Library list and board setup are in firmware/README.md.

Configuration

Three files hold all configuration. Nothing else needs editing to run the project against your own Firebase project and wiring.

File Tracked in git Holds
firmware/AutoStelle/arduino_secrets.h No, ignored Wi-Fi credentials, Firebase API key, database URL, device account
firmware/AutoStelle/config.h Yes Sensor and servo pins, occupancy threshold, timings, database paths
web/src/config.js Yes Firebase web config and database paths

The secrets file is created by copying arduino_secrets.example.h. The sketch will not compile without it:

error: Missing arduino_secrets.h - copy arduino_secrets.example.h to
arduino_secrets.h and fill in your credentials.

In the Arduino IDE the file appears as its own tab beside the sketch, which is where Arduino projects conventionally keep credentials.

The values in web/src/config.js are public Firebase identifiers rather than secrets, since any visitor can read them from the browser. What protects the data is database/rules.json. Every option is described in docs/CONFIGURATION.md.

Usage

  1. Open the dashboard. Occupied slots are highlighted as sensors detect a vehicle.
  2. Double click the AutoStelle branding in the footer to reach the sign in page. "Continue as User" returns to the read only view.
  3. After signing in, the gear button in the footer switches between the monitor and the register.
  4. Choose Reserve, enter a name and plate number, then tap a tag at the reader to register it.
  5. Tapping a registered tag opens the gate for three seconds. Unregistered tags are logged as denied on the serial monitor.

Deployment

The web app is plain static files, so any host will serve it. The included workflow publishes web/ to GitHub Pages on every push to main; enable it once under Settings > Pages > Build and deployment > Source > GitHub Actions.

When serving from a custom domain, add that domain under Firebase console > Authentication > Settings > Authorized domains, or sign in will be rejected.

Documentation

Document Contents
docs/SETUP.md Step by step setup, verification, troubleshooting
docs/HARDWARE.md Bill of materials, pin map, wiring notes, calibration
docs/FIREBASE.md Accounts, security rules, data model, enrolment flow
docs/CONFIGURATION.md Reference for every configuration option
firmware/README.md Libraries, board settings, upload, PlatformIO

License

AGPL-3.0. Copyright (c) 2025 EagleStelle.

About

Real time parking occupancy monitoring and RFID gate access, built on an ESP32 and Firebase, with a static web dashboard

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages