Skip to content
Stage 2 — Batcave V1

Stage 2 — Batcave V1

From Prototype to Product

With the remote signal decoded in Stage 1, the V1 integrates a GPS module and packages everything into a printable enclosure that lives on the dashboard.

Components

PartSource
Wemos D1 Mini (ESP8266)Amazon
433 MHz TransmitterAukru TX module
GPS TTL Module (VK2828U7G5LF)Amazon
3D-Printed CaseThingiverse #3721793

The Circuit

V1 Schematic
Batcave V1 breadboard layout

The RF transmitter connects to D0, GND, and VCC (3.3 V). The GPS module is wired via SoftwareSerial:

GPS PinColorESP8266 Pin
ENYellowVCC (3.3 V)
VCCRedVCC (3.3 V)
GNDBlackGND
RXGreenD6 (SW Serial TX)
TXBlueD7 (SW Serial RX)

The Firmware

Source: git repository

Finite-State Machine

The firmware is modelled as a state machine using the arduino-fsm library. Transitions are defined as (current state, next state, signal) triples — clean, predictable, easy to extend:

main.cpp
fsm.add_transition(&state_initial,     &state_send_signal, SEND_SIGNAL_EVENT, NULL);
fsm.add_transition(&state_initial,     &state_got_gps,     GOT_GPS_EVENT,     NULL);

Timed transitions handle timeout cases automatically without additional polling code.

Main Workflow

Batcave State Machine
State machine diagram — main workflow

Persistent State (EEPROM)

A key requirement is the morning-leave scenario: the device needs to know it is parked inside the garage after the engine is turned off so it can open the door on next startup.

Whenever the GPS fix changes or the car crosses the geofence perimeter, the following flags are written to EEPROM:

  • at_home — whether the car is currently within the home geofence
  • gps_lost — whether GPS fix was lost (i.e., inside an enclosed space)

On boot: at_home == true && gps_lost == true → car is in the garage → send open signal immediately.

The Enclosure

Designed in Fusion 360 and printed in transparent PLA so the indicator LEDs glow through the shell.

Transparent PLA looks great during the day but the LEDs are very visible at night. An opaque colour is probably a better choice for V2.

Batcave case open
Case open — all components installed

Batcave case top
Case top with GPS antenna window

STL files are published on Thingiverse: thing:3721793

Future Plans

The GPS module in the car opens up a range of follow-on ideas:

  • Cloud telemetry — stream GPS tracks to a backend for storage and visualisation
  • Electronic driver’s log — auto-generate mileage records from trip data
  • LoRaWAN gateway — install a gateway on the rooftop and transmit via The Things Network instead of WiFi
The library branch that refactors the firmware into a proper Batcave library is partially done but blocked on a SoftwareSerial issue. Contributions welcome — reach out or open a PR on Azure DevOps.
Last updated on