DIY smart motorcycle chain oiler based on ESP8266 (Wemos D1 Mini) with web configuration and optional GPS-based speed detection.
The project was created for personal use, tested in real conditions, and is shared as open-source for anyone who wants to build their own reliable, configurable chain lubrication system. A few of these are running in the wild (I'm quite proud of that).
Project is no longer actively developed
The system is fully functional and proven in daily use, but development has stopped as I switched to a motorcycle with a shaft drive.
Bug fixes or small improvements may still happen, but no new major features are planned.
- Configurable oil pump control (relay or MOSFET)
- Adjustable oiling ON / OFF timing
- Priming mode (oil system filling)
- Cycle-based oiling logic
- Persistent configuration stored in EEPROM
- Built-in WiFi Access Point
- Static web interface for configuration
- Optional automatic WiFi shutdown after a defined time
- Custom WiFi SSID and password
- Minimal dynamic content for maximum stability
- v3 – OLED display support
- v4 – GPS module support:
- Speed-based oiling logic
- Satellite status detection
The web interface is intentionally mostly static.
Only a few values are dynamically updated on the main page:
- time to next oiling cycle, sat count, speed
- time to WiFi access point shutdown
This significantly reduces ESP8266 load and improves long-term reliability — the controller focuses on pump control, not serving HTML.
(community-tested list)
- Oil pump - DellOrto DL12306
- Sumitomo 6189-0031 pump connector
- Oil reservoir - LINK
- Oil/fuel hose (pump ↔ reservoir)
- Superseal connectors - LINK
- Fuse holder
- Wiring (0.25 mm² is sufficient)
- GPS module (e.g. NEO-6M) - LINK
- GPS antenna - LINK
- Antenna connector - LINK
- OLED display (SSD1306, 0.96 inch, IIC Serial, 4pin, 128X64)- LINK
- Custom oil nozzle / mount - LINK
flowchart LR
PWR["12V after ignition"]
PWR -->|12V| DCDC["DC/DC buck 12-24V to 5V"]
PWR -->|12V| DRV["Relay / MOSFET driver"]
DCDC -->|5V| ESP["Wemos D1 mini (ESP8266)"]
ESP -->|GPIO| DRV
DRV -->|12V| PUMP["Oil pump"]
User -->|WiFi, WEB BROWSER| ESP
ESP -->|UART| GPS["GPS module NEO-6M"]
ESP -->|I2C| OLED["OLED display (optional)"]
Default pin assignment for ESP8266 (Wemos D1 mini)
(as used in the current V4 firmware).
- D1 (GPIO5) → Relay / MOSFET (oil pump)
HIGH→ pump ONLOW→ pump OFF
- D6 (GPIO12) → GPS TX
- D5 (GPIO14) → GPS RX
- Implemented using
SoftwareSerial - Tested with NEO-6M
- Power:
- 5V
- GND
- D3 (GPIO0) → SDA
- D2 (GPIO4) → SCL
- Interface: I2C
- Supported controllers:
- SSD1306 (128×64)
- 5V → GPS / OLED
- GND → common ground
Pin assignments are defined in firmware
and can be adjusted if needed.See source code for details:
ESP8266_SmartChainOilerV4.inoNote: D3 (GPIO0) affects ESP8266 boot mode.
Make sure the OLED does not pull D3 LOW during startup.
The controller is built as a compact "pancake-style" PCB stack.
Although the oil pump is switched using a MOSFET, a relay shield PCB is still present.
The mechanical relay itself is removed. The relay PCB is reused as a carrier board for the MOSFET and power wiring. The MOSFET gate is driven through the original relay control circuitry on the shield, which is connected to the ESP8266 GPIO pin.
From the firmware perspective, nothing changes: the pump is still controlled using a single GPIO output.
This approach was chosen for practical reasons:
- the relay shield was already part of the hardware stack
- it provides a robust PCB with proper power routing
- it keeps the construction compact
Using a MOSFET directly from GPIO would also work. This design simply reuses existing hardware in a clean and mechanically stable way.
The controller was tested running continuously for several years on a few motorcycles without issues.
Timing logic, EEPROM persistence and WiFi stability proved reliable in long-term use.
- Installation photos
- Short demo videos
The firmware is built for Wemos D1 Mini (ESP8266 / Lolin compatible).
You can flash the firmware either:
- directly from Arduino IDE
- or by using the generated
.binfile withesptool.py
Below is an example command generated by Arduino IDE.
Adjust paths, COM port and usernames to your system.
python3 upload.py \
--chip esp8266 \
--port COM3 \
--baud 921600 \
erase_flash \
write_flash 0x0 ESP8266_SmartChainOiler.ino.binAfter flashing, give the device a few seconds to boot.
- SSID:
ESP-******(generated from device ID) - Password: none on first boot
The firmware uses a captive portal:
- connect to the WiFi network
- open any page or go directly to:
DNS redirection is used to speed up access to the web UI
(may not work in 100% of cases).
On first boot EEPROM is empty.
- Go to System Config → click Save
- Go to AP Settings → clear fields → Save
- Refresh page if it hangs (rare, but possible)
After that, configure values as desired.
(setting 0 does not disable AP).
- v1–v2 – Basic oiling logic + WiFi
- v3 – OLED display support
- v4 – GPS-based speed detection
None planned at the moment.
The project is published for:
- learning
- inspiration
- reuse
- modification
Feel free to fork, refactor, or modularize it.
License MIT.
Inspired by community projects and discussions on
https://africatwin.com.pl










