StromTrooper banner

1 - 20 of 181 Posts

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #2 (Edited)
High Level Architecture

This is what I'm thinking about, very high level:


Your feedback and suggestions are welcome.
 

·
Registered
Joined
·
44 Posts
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
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #4
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
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..
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #6
Phase 1 learn about OBD network , dataloging, automotive networking protocol IEEE

Link to some light reading


Bibliography on Secure Vehicular Communications
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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #7 (Edited)

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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.
 

·
Registered
Joined
·
1,253 Posts
Are you doing cost projections? This looks to be an interesting project but if the cost per unit is too high I expect that you will see little uptake.
 

·
Registered
Joined
·
1,900 Posts
The terminologies confuse me :confused:but you have my interest in the functions you want to add.
Watching with interest.
Mike
 

·
Premium Member
Joined
·
3,722 Posts
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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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..)
 

·
Registered
Joined
·
9 Posts
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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #16 (Edited)

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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).
 

·
Registered
Joined
·
9 Posts
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?
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #19 (Edited)
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?
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:
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #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.
 
1 - 20 of 181 Posts
Top