Skip to content
MCU Atlas

OpenBikeSensor: measure how close cars pass you

Build an open-source ESP32 sensor that ultrasonically measures how close cars pass your bike, GPS-tags every event, and uploads rides to public open-data maps.

Difficulty:IntermediateSource available

What it is

An open-source, open-data citizen-science device: an ESP32 with two ultrasonic sensors that measures how closely cars pass your bike, GPS-tags each event, and uploads rides to a public map used by city planners.

What you need

  • ESP32 DEVKIT v1 (30-pin) 30-pin variant explicitly required
  • 2× JSN-SR04T v3.0 ultrasonic sensor one left, one right; buy exactly the variant the parts list names
  • 0.96-inch OLED display on a ~2 m cable in the project's build
  • NEO-6M GPS module large-antenna variant recommended
  • SD-card module + 16/32 GB card under 100 MB/s — 120 MB/s SanDisk cards failed
  • 18650 Li-ion cell + buck-boost + USB-C charging module
  • Custom mainboard PCB v1.0.0 fabricated from the published KiCad/Gerbers
  • 3D-printed case

How hard

Intermediate: module assembly on a custom PCB, crimping, and a first flash — the project's FAQ says beginners can do it with community help. Documentation is German-language; the firmware README is English.

Key Facts

  • ESP32 DEVKIT v1 (30-pin) + two JSN-SR04T v3.0 ultrasonic sensors + GPS + SD logging; module assembly on a custom PCB in a 3D-printed case
  • Measures each passing vehicle's distance, GPS-tags it, and button-confirms real overtakes; whole rides upload to a public open-data portal over Wi-Fi
  • Firmware LGPL-3.0, newest tag v0.22.1006 (2026-11-15); browser installer at install.openbikesensor.org — no toolchain for the first flash
  • Full kit EUR 60-80 including the ~EUR 15 printed case (the project's own FAQ figure from collective-order experience; no per-line pricing published)
  • Portal live stats 2026-11-26: 433 users, 402 devices, 15,134 tracks (~172,923 km), 105,315 recorded overtaking events
  • Not a product: volunteer-run OpenBikeSensor e.V. — build it yourself or join a collective order; documentation is German-language (firmware README in English)
Data-flow diagram in four stages: MEASURE — two ultrasonic sensors, one each side of the bike, with a handlebar button to confirm real overtakes; RECORD — a GPS module tags each reading with position and time and everything writes to an SD card; UPLOAD — finished rides upload over Wi-Fi to a data portal of your choice; OPEN DATA — the portal derives an anonymized public pool that cities query, with Munich's open-data portal publishing an OpenBikeSensor-derived passing-distance dataset.
OpenBikeSensor's data path: measure (two ultrasonic sensors + confirm button), record (GPS + SD), upload (Wi-Fi to a chosen portal), open data (anonymized pool — Munich publishes an OpenBikeSensor-derived dataset). (Diagram: MCU Atlas)

About This Project

Every cyclist knows the feeling: a car passes with inches to spare, and there's nothing to show for it but adrenaline. Germany turned that into law in 2020 — a minimum passing distance of 1.5 m in town, 2 m outside town — but a rule only helps where it can be checked. OpenBikeSensor is the tool for checking it: an open-source, open-data citizen-science device you build yourself around an ESP32, which ultrasonically measures how close each vehicle passes, logs the distance with GPS coordinates, and uploads your rides to a public data portal. And the data is used: Weiterstadt sends volunteer cyclists out with these devices and feeds the findings into its cycling-infrastructure planning, and Munich's open-data portal publishes an OpenBikeSensor-derived passing-distance dataset for the same purpose.

What it is and how it works

Two ultrasonic distance sensors — one pointing left, one right — measure the gap to whatever passes you. A GPS module tags each reading with position and time; a handlebar button confirms which passes were real overtakes, so stop-and-go traffic doesn't pollute the dataset. Everything records to an SD card, and when you're home, the device uploads whole rides to a data portal over Wi-Fi. Since firmware v0.3 it can also stream live measurements over BLE in a heart-rate-style service feeding TU Berlin's SimRa safety app. Each log entry carries date/time, GPS position and accuracy, raw sensor readings, minimum distance left and right, button confirmations, battery state, and firmware version/settings.

The project offers three variants. The Classic is the proven workhorse: full functionality with no phone needed, built from off-the-shelf modules, designed since 2018 as open hardware. The Lite swaps the display for your Android phone as the interface — smaller, cheaper, minimal build effort, but still alpha-stage and "still largely untested". The Pro exists only as prototypes under test, with no public parts list or build docs yet. This page covers the Classic, the variant you can actually build today.

One thing OpenBikeSensor is not: a product. The project is volunteer-built, and it is not sold. It's run by OpenBikeSensor e.V., a registered non-profit whose stated purpose includes releasing the collected data publicly as open data. You build it yourself from the parts list, or join a community-organized collective order — cheaper and more convenient, but you still assemble it yourself.

Parts and rough cost

The Classic parts list is the table below on this page: eight line items, all off-the-shelf modules plus a custom mainboard PCB you have fabricated from the project's published KiCad/Gerbers and a 3D-printed case from its printable-case repo. From collective-order experience, the project's FAQ prices a full kit at the figure carried in the parts list below, printed case included — the project publishes no per-line pricing, and neither does this page.

The sensor choice needs one honest paragraph. The firmware supports both HC-SR04 and JSN-SR04T ultrasonic sensors, but both current parts lists specify the JSN-SR04T v3.0. The project's documentation publishes no range or waterproofing comparison between the two — so we won't quote one either. What the docs do warn about is the variant minefield: many boards are sold under the same "JSN-SR04T" name and "many do not work." The collective-order page documents AJ-SR04M, JSN-SR04T, -2.0 and -V3.0 boards differing in mode resistors, crystals and voltage ranges, and states the SR04M-2 "does not seem to work in the OpenBikeSensor distance meter". Buy exactly the variant the parts list names. (The Lite needs the on-board-transducer variant.)

The toolkit is a standard maker kit; "the most specialized tool is the crimping pliers, which your local hackspace / maker space / fab lab surely has lying around".

Firmware

The firmware is open source under LGPL-3.0 — read it, modify it, and configure the device from its on-device UI, with firmware updates over Wi-Fi. First flash is easy: a browser-based installer at install.openbikesensor.org, or PlatformIO if you prefer a toolchain. The newest tagged release is v0.22.1006, published 2026-11-15. Freshness note: development is slow but alive — the firmware's latest tags are pre-releases and commits are infrequent, but a new tag landed in November 2026, and the org's other repos — portal, website — remain active; we read that as mature firmware, not abandonment.

How hard, how long?

The project's FAQ answers the build-it-yourself question with a blunt yes — beginners can do it, with community help. The build is module assembly, not board-level electronics: the custom PCB arrives fabricated, you populate it with off-the-shelf modules, crimp connectors and fit the printed case. No official hours figure appears in the documentation. Our estimate, grounded in those documented steps: two or three relaxed sessions — one for ordering (or joining a collective order, which adds waiting time), one for assembly, one for the first flash and a shakedown ride. The two fiddly bits — sensor variant and SD-card speed — are covered above.

Where the data goes

Uploads land on a data portal whose software is itself open source (Python/Sanic, PostGIS, OpenMapTiles). The portal derives a public, anonymized open-data pool from your raw uploads; multiple portals are deliberate, so you choose an operator you trust, and some research projects run their own instances. The main portal's live public stats (retrieved 2026-11-26): 433 users, 402 devices, 15,134 tracks totaling roughly 172,923 km, and 105,315 recorded overtaking events.

This is the same playbook as airRohr (luftdaten.info, now sensor.community) — the DIY particulate-matter sensor network that proved volunteer-built open hardware feeding a shared open-data map can reach civic impact. OpenBikeSensor runs the same pattern at smaller but real scale, with documented civic uptake: Weiterstadt's infrastructure planning, Munich's open dataset, and a first-place Deutscher Fahrradpreis 2022, shared with SimRa.

MCU Atlas is not affiliated with OpenBikeSensor; this is independent maker coverage.

Where to start

The firmware lives at github.com/openbikesensor/OpenBikeSensorFirmware. The documentation at openbikesensor.org/docs carries the user guide, step-by-step build manuals, flashing per OS, and the FAQ — heads-up: the docs are in German, the firmware README is in English. For the first flash with no toolchain, install.openbikesensor.org is the browser installer. The recording-format spec is github.com/openbikesensor/proto (Protocol Buffers; the repo warns it's a draft that "might still change, and quickly"). Your uploads land on the data portal at portal.openbikesensor.org. The community gathers on forum.openbikesensor.org (Discourse), in a Matrix space, and in weekly open video meetings, usually Mondays.

License and sources

OpenBikeSensor firmware is licensed under the GNU LGPL-3.0; the 3D-printable case, PCB design files and portal software are LGPL-3.0 as well. The recording-format spec repo carries no license and is explicitly draft-status.

OpenBikeSensor: measure how close cars pass you

Illustration

Bill of Materials

Parts list

8 parts · 1 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

1× ESP32 DEVKIT v1, 30-pin

No verified link — check the original project

2× JSN-SR04T v3.0 ultrasonic sensor

No verified link — check the original project

1× 0.96-inch OLED display

the catalog module is the same 0.96-in SSD1306 panel; the project's build expects the display on a ~2 m cable for handlebar mounting

1× NEO-6M GPS module

No verified link — check the original project

1× SD-card module + 16/32 GB card

card speed matters: under 100 MB/s — 120 MB/s SanDisk cards failed in the project's builds

No verified link — check the original project

1× 18650 Li-ion cell + buck-boost + USB-C charging module

buy a reputable-brand 18650 cell; the buck-boost and USB-C charging modules ride the same line in the project's parts list

No verified link — check the original project

1× Custom mainboard PCB v1.0.0

No verified link — check the original project

1× 3D-printed case

No verified link — check the original project

Not included: Crimping pliers — the one specialized tool; any hackspace, maker space or fab lab has them lying around, A computer and Wi-Fi — for the first flash (or the browser installer) and the ride uploads

Download CSV

Related Projects

airRohr: citizen-science particulate matter air sensor
Illustration
ESP32ESP8266
A DIY outdoor air-quality station for Sensor.Community: an ESP8266, SDS011 fine-dust sensor and BME280 in a weatherproof pipe.
Beginner·Code
5 parts listed
Smart beehive scale: weigh your hive with an ESP32, HX711 and a load cell
Illustration
ESP32
An ESP32, an HX711 amplifier and a bar-type load cell turn a hive stand into a telemetry station: weight every day, temperature beside the brood, and a graph on your phone — so you watch the nectar flow come in and catch the swarm sign from your kitchen, without opening the hive once.
Beginner·Code
9 parts listed
whisli sense: ESP32 mmWave presence sensor with climate and light
Illustration
ESP32ESP32-C3
A local presence sensor on a Waveshare ESP32-C3-Zero: an HMMD mmWave radar spots even a person sitting still, plus temperature, humidity and light over MQTT.
Intermediate
6 parts listed