I created this project to equipe my BMW F650 GS motorcycle with a little assitent including a digital chain oiler.
What is a chain oiler?
A chain oiler drops a little amount of oil on the heavily stressed motorcycle chain.
This way the chain lasts longer.
Why a digital chain oiler?
Regular chain oilers are often not precise, hard to adjust and finaly quite expensive.
In this project I use verily cheap components with an easy-to-use interface.
For controlling my Assistent I added a display, external chips and one button.
The program variables, log and comments are all written in english.
The user interface is designed for German users.
I could provide a interface for Englisch users if there is a need for it.
It runs on the Arduino/Genuino Nano and Arduino/Genuino Uno
- Trigger the chain oiler pump after a given periode of time for a little interval
- Display temperature
- Display battery voltage
- Display date and time (dim display accourding to the time)
- Provide a menu for the settings
- Power saving mode
- Crank assistent (shows lowest voltage and the duration)
- Arduino nano/uno (Uno for development, Nano for the actual use in my motorcycle)
- SSD1306 display
- DS18B20 temperature sensor
- DS3231 clock chip
- 2 * 4,7k, 2 * 12k Ohm Resistor
- Button
- Energy-saving voltage regulator (not compulsory, MCP1703 recomended)
- Wiring
- SPI.h (screen)
- Wire.h (screen and clock)
- Adafruit_GFX.h (screen)
- Adafruit_SSD1306.h (screen)
- OneWire.h (temperature)
- DS3231.h (clock)
- EEPROM.h (EEPROM memory)
- LowPower.h (power saving)
The chain oiler can be trimmed to your needs.
The pump duration time, the interval time and the state (if it works at all) can be easily set in the menu.
All settings are saved in the internal memory (EEPROM) and will be loaded with each power up.
The chain oiler only works if the battery voltage is above 13,2V.
This is no technical limitation, but a safety one.
On my F650 I needed to grab power from the rear lights, which means if I leave the parking lights on my bike on, the Arduino is still powered.
If the engine is running, the generator will hold the voltage at 13,5V to 14,2V -> which means the chain oiler will run if it is set active.
After a long click on the button (1 second, state 2016-05-12) the menu will open
With a short click on the button you move the cursor one step further down (on the last entry it will jump back up again).
With a long click on the button you enter submenus and select options.
As long you are in the menu the chain oiler and all other components will remain in standby.
I recommend to replace the onboard voltage regulator with one which has less quiescent current (current which the regulator needs for itself) if you are planning to use the power saving mode.
The standard one uses about 10 mA and requiers at least 7V to produce a good 5V line for the Arduino.
The MCP1703 for example uses only 0.003 mA for itself and requiers 0,1V to 0,6V extra above the 5V for the Arduino to work properly.
DC-DC converters do not really make sense here.
Although the converter would be more efficient in the normal work mode, it would be horrible in power saving mode (because it also has a fairly high quiescent current). We don't really need a high efficiency if the engine is running (about 50mA in normal mode).
To decrease the comsumption even more, you can disconnect the power LED of the Arduino.
So if you use the MCP1703 and remove the power LED from the Arduino it will be much more efficient.
The current should be under 0,01 mA. (Needs testing)
The power saving mode will kick in if the voltage is under 12V for longer then 20 seconds.
It will turn of the power of the display, clock and temperature sensor.
Every 2 seconds the Arduino will wake up for under 1 millisecond to check the voltage.
If the voltage is equal or above 12V the Arduino will wake up and return to the normal work mode.
This project does focus on the highest efficiency possible.
The Atmel328 chip (Arduino Uno, Mini,...) provides 32kb of flash memory and 2 kb of ram.
I could not always focus on best practice code, but tried to keep the work well sorted and well commented.
Flash memory and RAM efficiency was the main goal.
The code offers the possibility of logging via the serial connection of the Arduino.
Change GBL_LOGLEVEL to a value which you like. (0 verbous, 1 info, 2 warning, 3 error).
This project nearly uses the hole flash memory.
(state 2016-05-13, 27 148 Byte of the flash memory is used).
Please open a issue here before you use this Arduino project for a commercial product.