Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Key Fob

GitHub: Carputer-project/esp32_keyfob

2-button ESP-NOW key fob for carputer remote keyless entry. ~3-year battery life on CR2032.

Hardware

Component Cost
ESP32 DevKit (or ESP32-C3 for lower power) ~$3-5
2× momentary push buttons ~$1
CR2032 battery holder ~$1
Total ~$5-7

Buttons

Button GPIO Function
BTN1 GPIO 0 Lock / Unlock (toggle)
BTN2 GPIO 2 Remote start (hold 2s)

Protocol

Uses ESP-NOW (no WiFi router needed) — direct peer-to-peer communication with the body controller.

Action Button Payload
Lock/Unlock BTN1 (press) {"cmd":"lock","hmac":"..."}
Remote Start BTN2 (hold 2s) {"cmd":"rstart","hmac":"..."}

Authentication

HMAC-SHA256 challenge-response:

  • Key derived from VIN + module secret (set at bind time)
  • Nonce included to prevent replay attacks
  • Body controller validates HMAC before executing commands

Build & Flash

cd esp32_keyfob
pio run              # Build
pio run --target upload  # Flash

Configuration

Edit platformio.ini to set:

  • WIFI_CHANNEL — ESP-NOW channel (must match body controller)
  • Button GPIO pins in build_flags

Dependencies

  • ESP32 Arduino core (built-in ESP-NOW support)
  • ArduinoJson — JSON serialization (v7)

Battery Life

Deep sleep between button presses. Wake on GPIO interrupt. Estimated ~3 years on CR2032 with typical use (10 presses/day).

About

ESP32 key fob — ESP-NOW 2-button remote for carputer remote keyless

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages