You don't need experience with electronics to follow this. Each step is self-contained — just do one at a time.
- All the parts from hardware/bom.md
- A computer (Windows, Mac, or Linux)
- A USB cable that fits your ESP32
- About 30 minutes per step
You need a free program to write code to the ESP32.
- Download Arduino IDE — it's free
- Open it
- Go to File → Preferences
- In the "Additional boards manager URLs" field, paste this:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Go to Tools → Board → Boards Manager
- Search for "esp32" and install it
That's it — your computer can now talk to the ESP32.
"Flashing" just means sending code to the ESP32.
- Connect the ESP32 to your computer with a USB cable
- Open Arduino IDE
- Go to Tools → Board and select "ESP32 Dev Module"
- Go to Tools → Port and select the port that appeared when you plugged in the ESP32
- On Windows it looks like:
COM3orCOM4 - On Mac it looks like:
/dev/cu.usbserial-...
- On Windows it looks like:
- Open the file
firmware/src/main.ino - Click the Upload button (→ arrow)
- Open Tools → Serial Monitor, set baud rate to
115200 - You should see:
OpenBikeRadar starting...
If you see that message — the ESP32 works. Good.
The LD2410 is the radar sensor. It sends data to the ESP32 over a connection called "serial" — basically the sensor talks and the ESP32 listens.
How to connect (use the wiring diagram: hardware/wiring/wiring.md):
| LD2410 pin | Where it goes on ESP32 |
|---|---|
| VCC | 3.3V pin |
| GND | GND pin |
| TX | GPIO16 |
| RX | GPIO17 |
Important: Use the 3.3V pin, not 5V. The sensor will break if you use 5V.
Power on. Wave your hand in front of the sensor. You should see numbers change in the Serial Monitor.
The sensor sends numbers. Here's what they mean:
- Moving target distance — how far away a moving thing is (in cm)
- Signal strength — how confident the sensor is (higher = more confident)
- Stationary target — something that isn't moving
At this point just watch the numbers and get a feel for them. Walk toward the sensor, walk away. See what changes.
The sensor picks up a lot of noise — reflections off walls, wind, random interference. Without filtering, it will give false alarms constantly.
Add these two rules in your code:
- Ignore short detections — only count something if it's detected for at least 500ms in a row
- Require consistency — only trigger if you get 3 positive readings in a row
This alone removes most false alarms.
Now you turn raw numbers into something meaningful:
No object detected → CLEAR
Object detected → OBJECT DETECTED
Object getting closer → APPROACHING
How do you know if something is "getting closer"? Compare the distance now to the distance a moment ago. If it's smaller — it's approaching.
Instead of just "detected" or "not detected", we use three levels:
| Level | When | What it means |
|---|---|---|
| LOW | Object far away, not moving fast | Keep an eye on it |
| MED | Object getting closer | Pay attention |
| HIGH | Object close and fast | Move over |
You set the distance thresholds based on your field testing — everyone's situation is different.
The OLED screen shows you the current status.
Wiring:
| OLED pin | ESP32 pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO21 |
| SCL | GPIO22 |
Install the library: In Arduino IDE, go to Tools → Manage Libraries, search for "SSD1306" by Adafruit, install it.
The screen should now show: CLEAR, OBJECT DETECTED, or APPROACHING.
Before adding more features, test what you have in the real world.
Mount everything temporarily with tape or cable ties. Stand with the bike on a quiet street. Have someone walk or cycle behind you from about 50 meters away.
Write down:
- At what distance does it detect them?
- Does it give false alarms?
- How does it handle a car passing vs a cyclist?
Use what you learn to adjust your thresholds from Step 7.
The buzzer makes a sound so you don't have to stare at the screen.
| Buzzer pin | ESP32 pin |
|---|---|
| + | GPIO25 |
| - | GND |
Different patterns for different risk levels:
- LOW → no sound
- MED → one short beep every 2 seconds
- HIGH → rapid beeping
See the CAD files in cad/ for a 3D-printable enclosure.
If you don't have a 3D printer: Use a small plastic project box from a hardware store. Cut holes for the screen, sensor, and charging cable with a hobby knife. It works just as well for testing.
Mount the sensor pointing backward at a slight downward angle (about 20–30 degrees).
No data from sensor Check that TX and RX are not swapped. The sensor's TX goes to the ESP32's RX (GPIO16), and vice versa.
Constant false alarms Lower the signal strength threshold in your code, or increase the debounce time beyond 500ms.
Screen not working Confirm it's an I2C screen (not SPI — they look similar). Check SDA is on GPIO21 and SCL is on GPIO22.
Upload fails Hold the BOOT button on the ESP32 while clicking Upload, then release it once the upload starts.