SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By beast
#88261
Perfect, that's what I wanted to hear. You are a veritable font of information.
Thanks!

-Bob
By salsipius
#91016
Hi TZ, first let me say awesome project...

I have been wanting to do something very similar for my 07 nightster, I bought an arduino and a chip called the elm322 which is supposed to interpret the J1850 codes but I have yet to get it to work, I am more of a programmer than an engineer...

Anyway if you don't mind I have a few questions.

1. When you say AVR are you referring to the Arduino or another AVR chip?
2. If it is another AVR I assume this is where your C code goes, or is the C code on the arduino, I thought the Arduino had it's own Processing language?
3. Could you post any schematics or a tutorial of how you actually interface with the J1850 data (I don't want to blow up my Arduino)

Anyway, I plan on building a nice Information center using a color LCD to display Tach, Fuel and Gear info for my nightster but have been stuck a little on the hardware.

I actually have a nice working "Model" written in Processing that runs on my PC which simulates the data and works quite well, now all I need to to write it out to the LCD and get actual data from my Bike.

If I can get some help on the Hardware I will happily share what I have done with the UI although you look like you have a good thing going with the Nokia model, very cool.

Thanks

J
By tz
#91107
I have been wanting to do something very similar for my 07 nightster, I bought an arduino and a chip called the elm322 which is supposed to interpret the J1850 codes but I have yet to get it to work, I am more of a programmer than an engineer...

obdpros.com has complete modules and their chips have a few more modes. It is what I used before I went J1850 direct.

1. When you say AVR are you referring to the Arduino or another AVR chip?
2. If it is another AVR I assume this is where your C code goes, or is the C code on the arduino, I thought the Arduino had it's own Processing language?


Arduino, but I do C language directly.


3. Could you post any schematics or a tutorial of how you actually interface with the J1850 data (I don't want to blow up my Arduino)


I post things occasionally on my dev blog - among others:

http://harleyhacking.blogspot.com/2009/ ... -more.html

J1850 connects to ICP1 which is port D8 in Arduino terms through a 5k resistor (4.7k, 5.1k, somewhere around there - it doesn't have to be exact). You need a common ground and can probably power the arduino if it has a good regulator (like the pro does) and you don't do anything which will pull a lot of current on the 3.3v. I use an external regulator because the GPS chip and bluetooth together are pushing the limit.

The page above has the current source code for "j1850.c" which outputs the data stream to the serial port at 57600 baud.

This is probably overload, so feel free to ask follow-up questions. I am assuming the nightster has a similar diagnostic connector (one of the four pin connectors with only 3 connected - accessory, ground, and data).
By salsipius
#91119
I actually came across you blog on my own this morning funny enough. Sorry if these questions seem stupid but I am quite a newb with the hardware part

Can you recommend and Arduino to buy (Pro, Pro Mini...) and also give me some details on how you put your c code on it.

I am a little lsot about the code part

So my plan is to read the data into the arduino and then output it to an LCD, if you write c code onto the arduino does that mean that I will need another Arduino to talk to the LCD or can the Ardu do your C + standard Ardu stuff?

Regarding the J1850, If I did have the pro are you saying I can put the J1850 line in with nothing more than a resistor?

Yes the nightster has the same plug, 3 out of 4 wires, can you tell me which wires to put where and can I power the Arduino from the J1850 plug or should I get it from somewhere else?


Thanks for you help so far, I also picked up an ELMScan5 (it supports J1850 VPW) tool for very cheap and was going to have a go at using it as well, any thoughts
By tz
#91140
Can you recommend and Arduino to buy (Pro, Pro Mini...) and also give me some details on how you put your c code on it.

Duemillenove or Pro-Mini. I just use the pro-mini. "avrdude" is the programmer and my makefiles contain the magic command line. I would suggest you learn and play with blinking the LED on the Arduino using the IDE first. Do one or two tutorials.

So my plan is to read the data into the arduino and then output it to an LCD, if you write c code onto the arduino does that mean that I will need another Arduino to talk to the LCD or can the Ardu do your C + standard Ardu stuff?

The display can also be attached to the arduino. I have some displays from Newhaven Display which can run off 3.3v and use I2C (two wire serial bus) and was planning on a side project to do something similar.

Regarding the J1850, If I did have the pro are you saying I can put the J1850 line in with nothing more than a resistor?

Yes. It outputs a variable pulsewidth waveform, so it just needs some kind of input to see it (that doesn't load the J1850 bus - think scope probe). Everything else is available for a display or whatever else.

Yes the nightster has the same plug, 3 out of 4 wires, can you tell me which wires to put where and can I power the Arduino from the J1850 plug or should I get it from somewhere else?

The wires should be red, black, and gray - for accessory 12v, ground, and J1850. I would use a meter to check first, and maybe spring a few dollars for the pins and/or the whole connector. Usually available from Harley dealerships, or JP Cycles or other places. However even alligator clip jumper leads will work for testing (watch not to short - get some fuses while you are there - note my blog's favicon).

As I mentioned, as long as you aren't pulling more than say about 50mA at 3.3v, you can power it directly.

Thanks for you help so far, I also picked up an ELMScan5 (it supports J1850 VPW) tool for very cheap and was going to have a go at using it as well, any thoughts

Set the protocol to J1850 (ATSP2) and put it into monitor mode (ATMM), and you should see the traffic - even if the engine is off. I don't have the pinout in front of me but I made a harley to DB9 connector.