StromTrooper banner

Dl650 mk 1b

46K views 180 replies 28 participants last post by  cjlindstrom 
#1 · (Edited)
Dl650 mk 1b - Consolidated 2nd LCD display for more indicators

I've been playing with an idea in my head for quite some time, even before the 2012 Glee (that I will call here "DL650 MK2") came out.
[Yes, I know it is military lingo.. :) I like it!]

Adding my own set of meters in a consolidated solution would be a nice addition to the MK 1 stock bike.
I'm not looking to buy one component from this vendor, and another from another vendor. But I have my own all-in-one solution.
In particular I wanted these meters: (2&3 were added to the MK2 by Suzuki)
1. Battery Volt Meter
2. Ambient Air Temperature
3. Gear Indicator

I'm a software engineer/architect with some background in electronics (high school level), and after doing some research it doesn't look so complex.
I want to have a DIY project that is fully open source under a GPL license - that is, all the diagrams, software, design documents etc. would be open for everybody to download and use, but only for non-commercial usage.

For display I can select either LED or LCD display. That should be allowed to be configured. The solution should eventually support different displays in a plug-and-play manner with some jumpers.
The solution's core component would be built around a microcontroller that has A2D (Analog to Digital) capabilities. AVR or PIC are the natural candidates, I lean towards AVR.

Communication between the MCU and display must be using the I2C protocol. It is a simple, standard protocol.

As for the meters:
1. Battery Volt meter - that's a simple A2D conversion. Perhaps a simple voltage divider is needed in order to take down 15V to 5V range.
2. Ambient Air Temperature - Should be pretty simple using either a thermistor or another specialized MCU that will connect with I2C.
3. Gear indicator - I did some research, and basically the DL650 outputs its gear position to the bike ECU using 7 different voltage levels.
Basically each gear (1-6 + N) has its own unique volt.

EDIT: Here is a link to another DIY project that was using simple voltage comparators (not MCU based with display like I'm planning):
Gear Indicator Plans

Also a discussion in ADVRider: Gear position Indicator for Vstrom - ADVrider

The voltage values are:
1st gear = 1.782v
2nd gear = 2.242v
3rd gear = 2.960v
4th gear = 3.630v
5th gear = 4.310v
6th gear = 4.660v
Neutral = 5.000v

To connect to the gear position wires, a connector is needed. Jim Davis from EB wrote to me that this part is needed: Sumitomo Sealed 3P090wp-MT.
Once the MCU samples the gear position voltage, it should be very easy to figure to the current gear position by a simple comparison to a-priori well known values.

If you want to help me with this project, please feel free to join. I can code any piece of software (C/Assembly) - that's not a problem, but could use some help with the electronics part - looking that I don't have missing components, reverse protection, etc..
But in general, code review (and review) is a must thing for a successful project.

Then there is a question of making the protection cases for the MCU and Display, so they are weather proof but also look nice and don't look too bulky - I'm not really sure how to do it right now.
 
See less See more
#3 ·
I think the wee has an intake air temp sensor it might be used for your app
Did I just say app how about bluetooth to android? Is there PID data avalibale from the ecu? Most cars use can2 and PID data can be seen on a lap top with the right software Garmen has a gps thet looks at instant fuel economy via the ALDL connector
 
#4 ·
Well..skys are the limit here :)
The MCU can connect to almost anything..bluetooth, etc.

I do not know any details about connecting to the ECU - PID or ALDL.
It seems a little out-of-scope for me for phase 1, but I'm sure that once this solution starts working it can be easily expanded to many other applications.

One easy application, but I think it is kind of wrong, is to build a TRE (lock to 4th gear) by making the MCU output the 4th voltage constantly (Except for N) to the ECU, therefore tricking the ECU to think it is in 4th gear most of the time (or N).

I mean, you can even show messages (SMS, Emails) on the bike's display with the right android app.
But please try to help me make it to phase 1 first..
 
#6 ·
Thanks for your feed back.
I have no problem learning new technologies, but I must ask you: What is the purpose? What are the use-cases?
OBD - Are you thinking of a DIY dealer mode diagnostic tool?
On-board diagnostics - Wikipedia, the free encyclopedia

Data logger - What kind of data would you like to log? How is that useful in context of riding?

I really am not looking into building a diagnostic tool, but rather a second display that will add information missing in Mk1, but found in Mk2. Hence Mk1B.

For me, phase 1 will be kept simple (because I follow the KISS principle, Keep It Simple Stupid, which is a cousin of FOF, Function over Form..).
Getting the architecture depicted above to work flawlessly, in a robust and reliable way (water proof) will be a great achievement (for me).
Later in Phase 2, other features, in particular the advanced ones, can be considered. It should be easy to expand this architecture to many more use-cases.
 
#7 · (Edited)
#8 · (Edited)
Screen/Display Design

This is my current design of the 16x2 LCD Display:


I'm actually making some nice progress. Most of the research (components in particular) is done.
Soon will start buying the components from DigiKey and start assembling the prototype and coding the 'Firmware'/Program.

In the prototype phase, I first plan to do everything without the V-Strom, and emulate/simulate the gear and battery by using two DAC converters (i.e. generating volts programmatically by the Lego NXT MCU). This would allow me to 'virtually' change the gear position and volts without really using the motorcycle.. It seems a good method for rapid development and unit testing.
 
#10 ·
The terminologies confuse me :confused:but you have my interest in the functions you want to add.
Watching with interest.
Mike
 
#11 ·
When you get them done let me know, I'll buy one. It sounds like a fun project. I've done a lot of software and electronics over the years, although direct microprocessor programming is a bit over my head, so this sounds like it would be a great one to play with.
 
#12 ·
Thank you all for your interest.

@Doug - As for costs, a 100% valid concern/question.
I will prepare a detailed BOM and post the costs in this thread, later on.
[There are also some static one time costs for me - For example: A micro-controller development board, chips needed for emulation.]

The most expensive part is the LCD module - currently at $20.
But there is a difference between prototype costs and mass production costs, naturally, due to discounts on volumes.

My current very rough cost projection for a single module is less than $100.
Considering that other commercial modules, but less capable, cost more, I think it is a reasonable starting point.

That been said: As much as I would like to get this project done tomorrow, I have a demanding day job, one wife, 3 kids and one dog and not to forget one 'White Pearl' that needs a weekly riding so she doesn't get sad..:mrgreen:
so this may take some time to complete..The winter is optimal since I can't ride, but his project is too cool for me to just wait.

My phased approached means I have to finish a prototype first.
 
#13 · (Edited)
BOM - Costs

I sat down and wrote all possible expenses in an Excel spreadsheet.
My current calculations show about $95 for the hardware, but I would add another $25 as a cushion for unknown/hidden costs.
The box/electronic enclosure is a big question mark.
A simple generic plastic box costs about $10, but if a special plastic mold would be done, or CNC, then costs can get to be higher, of course.
I plan to have two boxes - one for the display (near the dashboard) and one under the seat that will host the micro controller and electronics.

A printed board is another cost which can add quite a lot to the over all cost - for a DIY project I see no reason to use it, and instead a cheap through hole board can be used.

And please remember all these costs are for a single non-production unit.

(Some other cool possibilities to expand the framework in Phase 2: Adding a digital compass..)
 
#14 ·
I'm In

I have been thinking of a project very similar to this for a while. Haven't had the time to delve too deeply yet, but I'm now able to throw in my support. My plan was to base the entire thing on an Arduino, which is open source and very easy to work with (models range from $19 - 35). Programming environment is accessible for those like me without a proper coding background (open source dev environment is based on the Processing language and runtime is Flash).

Like yours, my plan also includes Gear Position Indicator, Ambient Temp, and DCv stats, but eventually would add an inclinometer and GPS with data logging (to see speed, direction and lean - I run the same routes pretty often and would like to track my stats as I become a better rider).

I've done some PCB design and development and am comfortable with the hardware development side, but would love to collaborate with a coder.
 
#15 ·
I have been thinking of a project very similar to this for a while. Haven't had the time to delve too deeply yet, but I'm now able to throw in my support. My plan was to base the entire thing on an Arduino, which is open source and very easy to work with (models range from $19 - 35). Programming environment is accessible for those like me without a proper coding background (open source dev environment is based on the Processing language and runtime is Flash).

Like yours, my plan also includes Gear Position Indicator, Ambient Temp, and DCv stats, but eventually would add an inclinometer and GPS with data logging (to see speed, direction and lean - I run the same routes pretty often and would like to track my stats as I become a better rider).

I've done some PCB design and development and am comfortable with the hardware development side, but would love to collaborate with a coder.
Cool.
I agree about Arduino - Was planning to get it in the 2nd phase.
One can also use Arduino as an AVR programmer.
Did you think of using Arduino board as the final board, or just as an intermediate development board?

For the very first feasibility phase I thought of using my NXT - it has already a fully stable development environment (it is very similar to Arduino if you think about it..) as it has a built-in display, keys, A2D ports, bluetooth, I2C, USB, a persistent storage file system (great for logging).
In particular I find the NXT useful for I2C programming and debugging.
Check out some of the projects done by Prof. Sivan Toledo (Tel-Aviv University): Sivan Toledo's Lego Projects

Sivan is one really smart and creative guy. He also answers emails and seems like a nice person that likes to share information and knowledge and help others.

I planned to code my entire prototype in NXC and NBC (A C and assembly like languages, for NXT) and then migrate the code (the logic) to Arduino with AVR Mega.

Then again, if only I have the NXT it is not optimal.
 
#16 · (Edited)
#17 · (Edited)
A few design notes on gear detection

Looking at the problems other gear position sensor projects had with the display erratically 'jumping' it was hard not to notice that they were using analog comparators that compared to one discrete value.
The problem with such comparison that it takes a very small deviation from the original voltage value to mess up the calculation.
Since I have a microcontroller it seems better to make a decision on the selected gear using some more advanced logic that takes errors into consideration.
The A-Priori gear voltage values are known (see above in thread).
I decided to divide the whole 0-5V+ range into 'zones' so that between each two gears there would be 2 X 1/3 allowed buffers (above current gear and below next gear) and one 1/3 'dead zone' in the middle of them.
6% error will be used for the 1 and N gears.

So the zones will look like that:
1: 1.675 .. 1.935
2: 2.089 .. 2.481
3: 2.721 .. 3.183
4: 3.407 .. 3.857
5: 4.083 .. 4.427
6: 4.543 .. 4.773
N: 4.887 .. 5.500

Any other value should be considered E ('Error').

This solution should also eliminate the need for the system to 'Auto-Learn' the bike, as long as the deviation is not too large (which I suspect would be an indicator of a faulty gear box).

Another possible problem could be if the N shows up for a very brief time just when gears change.
One way to workaround this is to define that N will be displayed only if it was selected/detected continuously for the last, say, 100msec.

This has to be tested and proved, but in theory it should make the system display gears in a more stable manner (less jumpy).
 
#18 ·
I do own an Ardiuno Duemillenove and have been playing with it a bit. I thought to use it as a final product for a one-off, for myself. However, if this is to become a stand-alone kit, it may make more sense to design an application-specific PCB (hardened for road use with proper connectors and housing) based on an Atmega 128 (about $4). The arduino makes a good dev platform and final code will port very easily - the only difference being the lack of an Arduino boot loader (though, I think that including the boot loader could make SW updates easier for less nerdy users).

I think the Mega is overkill for this project. It has far more I/O than necessary and is more expensive (and physically larger). Though, if you view it as a development platform, it can be an excellent choice.

I've used my 'duino with a Maxim DS18B20 temp sensor (I2C) with no need for intermediate components. Couldn't be simpler, really - just connects directly to a digital port on the 'duino. It relies on a library that's already fully debugged and readily available (as do most sensors in this dev environment).

As for the GPI, a single analog port will suffice. The 'duino has stable reference voltage internally or can accept an external reference voltage. From Arduino page: "The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin "

I will begin playing with GP sensing in the weeks ahead. Just need to order the connector for the bike-end of the business. How do you feel about jumping directly onto the Arduino platform so that we can exchange code and push this ball forward together?
 
#19 · (Edited)
I agree with all of your comments. :thumbup:

Was thinking of the Mega as a development kit only, but the Uno might be just fine.
What do you think is a better choice to start with: The cheap Arduino Uno or more expensive Mega?
Even if we have different Arduinos I'm sure that the code can be built (with #if directives) to be cross compatible. They can't be that different.

As for boot loader - sure, this seems almost mandatory today for firmware upgrades. It is also very common and should be easy to do, so why not?

I do not have experience with Arduino and AVR, but do have with NXT (that oddly enough is based on AVR :) ) and other micro controllers (Long time ago but 8051 & 8086/8, 80286).
Then again C is C and so is assembly. The registers are just differently named.

As for I2C - Yes, I already read about the Wire library. Seems pretty straight forward. Like you, I want to keep it simple stupid, and not invent anything that is not really required.

Regd. temp sensor, and actually all other components: I prefer DIP packaging for the prototype (again KISS principle). If/When this project becomes 'production' with a printed PCB then I think smaller packages could/should be used.
So I chose the DS1631+-ND for that reason.

As for measuring voltages, could use your ideas here, but I was thinking of a simple voltage divider that would divide by 4 (4 is a quick shift left of two so the MCU can easily convert it back to the original value) - i.e. take the battery ~12-14.4V, divide it with high resistors (to get a very low current) and then sample it as ~3-3.5V.
EDIT: Simple voltage divider is dangerous - Opto-Isolators to be used instead.
No need to use AREF, just use the simple stock AVR functionality.


Please see my prototype design, so far:
 
#20 ·
Some design thoughts - display module location

I'm also thinking right now where to put the display module and its enclosure.
The paper I used is true to size - Enclosure size and in particular LCD size (80mmx36mm). The enclosure can be made smaller, but the extra space on the 'stock' one I found does allow putting buttons and labels.

I currently see three options:
1. Somehow attached to my current Strombone/RAM/GPS


My GPS is already taking most of the space in the HUD, and I don't want to overload weight on my strombone/RAM mount.

2. On the center of the handle bar:


Attached to the handle with a short RAM mount. It is an easy and cheap way to get it done - they big minus is that it is not in the 'HUD' area.

If I go that route, one other thought that came to my mind is to attach a small blue led above my GPS so it acts an overdrive indicator. I keep trying to shift to 7th gear.. :)
This would be a bit redundant, as the display shows the gear position, but would be easy to implement - anyway, for phase 2..

3. Use the MadStad brackets (either one side, or somehow hang the display on a bar that would connect the two sides..):


If attached to one side only the weight could bend the madstad, it is not very thick.

I tend to go with option 2, due to KISS principle. It is the simplest implementation.
 
#21 · (Edited)
Design thoughts - measuring a 12V battery

OK, I'm going to change what I wrote before about voltage dividers - bad idea. :thumbdown:
It is OK with a small 9V battery (my background is with low voltage and amperage), not with a 12V motorcycle battery..don't want the circuit to get fried.. or get me fried! :yikes:

Did some research, and found that the advised solution is using an opto- coupler.
Opto-isolators: An introduction to using them with microprocessors- ec1optoiso

A recommended IC is: MCT61-ND
http://www.fairchildsemi.com/ds/MC/MCT6.pdf

It seems simple enough.
High Voltage: Anode-Cathode go to battery (+ and -).
Low voltage: Port of the AVR connects to Emitter and Collector is grounded.

From what I understand one needs to add an input resistor (10K ohm), output resistor (10K or 4.7K ohm). Input and output resistor are current limiters. A diode is not needed as this is DC not AC.

See method 2:
http://www.arduino.cc/playground/uploads/Learning/Level_shifting_4_arduino.pdf

That been said..I'm starting to think that an Opto Isolator is the way to go also for the gear position indicator connector - this way there is no way the motorcycle's circuit can be mixed with the Mk1B circuit.
It is basically a DC-DC isolation and protection, given the high ampers that can be produced by the bike, and given that the ECU can be harmed otherwise due to potential reverse current.
 
#22 · (Edited)
Mounting - design

My current thoughts of mounting is using option 2 - the center of the handle bar, using the RAM system.

There are three pieces:
1. RAM Mount Motorcycle Handlebar Clamp

ram-b-367u

RAM Mount Motorcycle Handlebar Clamp RAM-B-367U, RAM-B-367U

(Image seems to be actually on a v-strom.. ;) )


2. RAM Mount Aluminum 1.75 inch Short Length Dual 1.0 inch Socket Arm
ram-b-201u-a

RAM Mount Short Arm B-Socket RAM-B-201U-A, RAM-B-201U-A



3. RAM Mount Aluminum AMPS Plate with 1'' Ball and Roadmate Hardware (Plate that is screwed to back of plastic enclosure)

http://www.gpscity.com/ram-mount-universal-hardware-and-amps-plate-ram-b-347-g1.html

ram-b-347-g1

 
#23 · (Edited)
Design - Electronic Enclosure/Case

Following advice from good fellow stromtroopers, I figured that I need to look for 'Electronic Enclosures'.. :mrgreen:

Found this case: 715K-ND, $3.03
Digi-Key - 715K-ND (Manufacturer - 715)

Also comes with optional covers - The phenolic cover looks pretty cool. $2.27
Digi-Key - 2050K-ND

 
#24 ·
Passed 'Point Of No Return'

That's it..just made the first order from Digikey for the prototype.
No more design - time to implement!
All the parts and solution are fully figured out in the mind, now need to transfer it to reality.
I hope I get this project done quickly, and not screw up/get stuck :)

I'll start with small incremental steps ('success oriented') and try to document and photograph the stages.
 
#25 ·
Bigman: I have been brewing up a response to your comments on optoisolators and will send it soon. There are a few outstanding points on that front. I'm still abroad and up to my eyeballs, but will catch with you when I get stateside next week.

happy building!
 
#26 ·
@fess: sure, let's talk. Actually if you have some time I need to consult with you on the subject of SMPS (Switched-Mode Power Supply).
I have some worries that the electrolyte capacitors will dry up..people on internet forums are so confusing. you ask them one question and get another 3 unrelated answers..
I asked about LM2574 component and was told to use LM2940. Then some other people say that LM2940 is not good. 10 people 50 opinions.
 
#27 · (Edited)
Note on SMPS

Got some help from the good folks on other electronics forums, one of them rides a Honda Shadow! and he was most helpful guy :), of course.

Decided to go with LMHV2574 - The High Voltage version.
It seems motorcycles/automotive can have volt spikes of 60V.
It is very different than designing a power supply for a typical house gadget.

Pretty darn expensive just for a DC-DC power supply - ~$11, but I'm quality driven here.

Here is the diagram from the data sheet:
From left to right - Unregulated DC (12-60V) comes in, Regulated 5V comes out.

 
#28 ·
Some progress..finally..

Thanks to the ugly 'Irene' I managed to get some work done, until she cut my power today at noon. :thumbdown:

My 60V->5V automotive voltage regulator is producing 3.5V instead of 5V, but that is because the breadboard is not suitable, even for a prototype. A PCB is needed - the breadboard has too much resistance and causes the feedback mechanism to go south.
So I got a generic PCB from RadioShack, but it will take more time.

In the mean while, I taught myself how to program the I2C protocol - it is pretty straight forward and works great.
Started with an I2C IO Expander chip (not part of this project) just for testing using my Lego NXT. Next I'm going to hookup the temperature I2C chip and the I2C DAC/ADC chip (I plan to simulate the gear volts with it and also measure volts until I get the final microcontroller instead of the NXT).

I also prepared the wires for the LCD display, it too will be hooked up soon using the I2C protocol. My first text would be "Hello V-Strom" :)

 
#29 ·
More progress - temperature sensor working

Got the digital temperature I2C chip to work!
It was much easier than I thought it would be.

Here is a video of the original tests I did, with NXT and I2C (not in the original project, but I'm thinking of adding buttons as user interface so the PCF8574 chip is a good emulator..):
Video: PCF8574 I2C Prototype

And here is the temperature sensor working, it sounds like an ER because I put a beep for debugging, so I know when the NXT is sampling.
I used the lamp to heat up the temperature sensor for testing purposes - the video clearly shows the warming up and then cooling down.
Temperatures come out of of the sensor in Celsius, but converting it to Fahrenheit is just adding two lines of code.

Video: Temperature Sensor Prototype
 
#30 ·
And more progress - DAC/ADC I2C chip working

I managed yesterday to connect to the PCF8591 - basically it means I can emulate the motorcycle gear position by generating an accurate 'virtual' volt level.
This would allow me to test how the system works with gear changes without actually connecting it to the real bike voltages.
Technically this is the way to create a TRE if I wanted to do so.
I can simply supply voltage to the ECU using this mapping table:
N -> Volts of N
1 -> Volts of 4th
2 -> Volts of 4th
3 -> Volts of 4th
4 -> Volts of 4th
5 -> Volts of 4th
6 -> Volts of 4th

Therefore tricking the ECU to think that it is either in 4th gear or in Neutral..I don't see much value in doing so on the DL650 (It seems that the engine is not powerful enough to make advantage of that).
But this is how a TRE works in theory. Why some vendors charge so much for such a simple device and also decorate it with fancy marketing BS is beyond me.
 
#31 ·
#32 ·
Great link!
Yes, it is very similar, and I intend to learn from that project for sure :thumbup::thumbup:
My approach is a simpler and cheaper one (key for success of products), I'm looking for less functionality, that guy went for a full blown solution.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top