Skip to content
Maurício Gedrat
← All work

Carrinho Web Bluetooth

A website that drives an ESP32 car over Bluetooth, with no app to install

  • Embedded
  • Software
  • Electronics
Year
2026
Context
Electronics Technician program project — Fundação Liberato
Team
Maurício Gedrat, Matheus Bizarro

Illustrative background photo: Juanjo Jaramillo / Unsplash

Overview

ESP32 firmware plus a Next.js site that controls the car straight from the browser through the Web Bluetooth API.

Records

Wiring diagram: browser over BLE to the ESP32, which drives the L298N, both motors and the LEDs
Wiring, with the pins taken from the firmware. Power is not shown.
Control site on a computer: forward, reverse, left and right buttons around the car drawing
The site on a computer, in demo mode: driving at speed 2 with the headlight on.
Control site on a phone, with the car seen from above and the buttons below
The same screen on a phone.

The problem

The car was driven by old Android apps. The goal was to drive it from a browser, on a phone or a PC, with nothing to install — without breaking the apps that already worked.

The approach

  1. 01Web Bluetooth only speaks BLE, so the firmware runs both radios at once: BLE for the site and classic Bluetooth for the old apps.
  2. 02A one-letter-per-command protocol over the Nordic UART service: F, B, S for drive; L, R, C for steering; 1, 2, 3 for speed; H for the headlight.
  3. 03The ESP32 replies with its state in 4 letters (e.g. F2C1), and the car drawn on screen lights the same lamps as the real one.

How the system works

  1. 01

    Browser

    Next.js + Web Bluetooth

  2. 02

    BLE · Nordic UART

    1-letter commands

  3. 03

    ESP32

    BLE + classic Bluetooth

  4. 04

    L298N H-bridge

    drive and steering PWM

  5. 05

    Motors and lights

    headlight, indicators, brake

Implementation

  • Hold to drive, release to stop. On a computer: arrow keys or W A S D, keys 1, 2, 3 for speed and H for the headlight.
  • Two layers of safety: if the tab loses focus the site sends a stop, and if Bluetooth drops the ESP32 itself cuts the motors.
  • Indicators and brake lights blink with millis(), not delay, so the loop never blocks while commands arrive.

Result

Works in Chrome and Edge on Android and desktop. It doesn't work on iPhone or Firefox, which don't support Web Bluetooth, and it requires HTTPS.

Technologies

  • Next.js
  • TypeScript
  • Tailwind CSS
  • Web Bluetooth API
  • ESP32
  • Arduino (C++)
  • L298N

Sources and links