Skip to content

stelian42/HarleyDroid

Repository files navigation

HarleyDroid: Harley Davidson J1850 Data Analyser for Android.

Introduction:
-------------

This Android application captures, decodes and analysed the J1850
stream coming from the data bus of a Harley Davidson bike.

Some of the decoded information (RPM, speed, odometer etc) is
shown on the screen and can be saved on the external storage (SDcard)
for later usage.

Hardware requirements:
----------------------

To use this application you will need:
- a Bluetooth ELM327 module (you can choose between the real one or
  a cheap Chinese clone - you can buy them at $25 on ebay)
- a custom cable interfacing the ELM327 module to the 3 pin
  data/diagnostic port on your bike (the port uses a 4 pin Deutsch
  connector and is placed near the battery on my Sportster):

  	Harley data port	  16 pin J1979 connector (ELM327)
	---------------------------------------------------------
	(x)	1
	(brown)	2 -------------	ground	-------	 4 and 5 (ground)
	(green)	3 -------------	data ----------  2 	 (J1850+)
	(white)	4 -------------	+12V ---------- 16	 (+12V)

Harley J1850 protocol:
----------------------

The J1850 stream contains the following commands (found by trial and error,
no official Harley Davidson documentation was used):

	28 1b 10 02 xx xx : rpm, xxxx = rotations/minute * 4
	48 29 10 02 xx xx : speed, xxxx = km/h * 128
	48 3b 40 xx       : gear in neutral if (xx & 0x20),
	                  : clutch engaged if (xx & 0x80)
	48 da 40 39 xx    : turn signals, xx = 1,2,3 for left/right/both
	68 88 10 03       : check engine indicator off
	68 88 10 83       : check engine indicator on
	a8 3b 10 03 xx    : current gear, xx = 1,3,7,15,31,63 for gears 1-6
	a8 49 10 10 xx    : engine temperature, xx = degrees Fahrenheit
	a8 69 10 06 xx xx : odometer, xxxx = ticks, each tick = 0.4 meters
	a8 69 10 86 xx xx : same as above, but a wraparound occured
	a8 83 10 0a xx xx : fuel consumption, xxxx = ticks, each tick = 0.000040 liters
	a8 83 10 8a xx xx : same as above, but a wraparound occured
	a8 83 61 12 dx    : fuel gauge, x = level (0-15)

	... any several unknown ones

Contributions to the above are welcomed !

HarleyDroid log format:
-----------------------

The logs generated by HarleyDroid are in CSV format:

	timestamp,type,value,longitude,latitude,altitude,date

The timestamp format is YYYYMMDDhhmmss.

The different type/value combination are (depending on the metric/imperial
HarleyDroid settings):

	RPM,xxx : rpm in rotations/minute
	SPD,xxx : speed in mph or km/h
	GER,xxx : 1 - 6 (current gear)
	NTR,xxx : 0 (not in neutral) - 1 (in neutral)
	CLU,xxx : 0 (released) - 1 (engaged)
	TRN,xxx : L (left), R (right), W (both)
	CHK,xxx : 0 (going off) - 1 (going on)
	ETP,xxx : engine temperature in C or F
	ODO,xxx : current trip odometer, in miles or km * 100
	FUL,xxx : current fuel consumption, in ml or fl oz
	FGE,xxx : fuel gauge 0 (empty) - 6 (full)
	CRC,xxx : bad J1850 message
	UNK,xxx : unknown J1850 message

-- 
Stelian Pop <stelian@popies.net>