Distance Measurement HC-SR04 ultrasonic sensors connected to ESP32
Inspired by the Berlin project Radmesser. This version uses a simple bush button to confirm distances measures were actually overtaking vehicles. It has its own GPS and SD card for logging, so it does not require additional hardware like a smartphone.
The prototype by Zweirat used the following:
- ESP32
- HC-SR04P
- 5-pin XS9 Aviation Connector
- 12mm Push Button
- 0.96 inch OLED Display
- USB-C Charging Module
- GPS Module
- Plenty of wires (0.25mm^2) and heat-shrink tubing
To power the sensor you have a choice of Lithium-Iron or Lithium-Ion batteries
- Automatic Buck-Boost Step Up Down Module for LiPo usage
- LiIon battery or
- Battery-Protection-Board
- LiFePo charging module
- LiFePo-Battery
Li-Ion batteries are usually cheaper and have higher capacity at the same size. Lithiom-Iron batteries are considered quite safe.
Screws and nuts:
You can consider getting slotted-head screws for the M2 ones if you are worried about damaging the tiny Allen screws.
- ESP32 device driver
- Arduino IDE
- TM1637 Library - installed through Arduino library manager
- SSD1306 Library - installed through Arduino library manager
- TinyGPSPlus Library
- clone or download repository
- open in Arduino IDE
- compile and upload to ESP32
- Connect sensor
- power up device
- push the button each time there is a value shown in the display and you want to confirm it was a vehicle overtaking you
- power down
Most of the configuration is a stub and needs further development. But uploading new firmware works. You can enter the configuration mode by pushing the button while turning the device on. Then it will open a unique WiFi including the devices Macadress named "OpenBikeSensor-xxxxxxxxxxxx". Initial password is "12345678". The configuration page can be found on "http://openbikesensor.local" or "172.20.0.1". You can directly upload a precompiled binary.
Inspiration, code snippets, etc.