Made motorcycle computer

12 Apr 2013

Hello I would like to make a motion instrumentation with: RPM, hours of use (for a few hours tells you to do maintenance), speed and mileage. For the counting of hours I thought about using the timer tick (one second) and make comparisons for the type of maintenance. For motor revs thought to count breaks and calculate the revolutions per second and convert revolutions per minute. Difficulties arise for the speedometer, and the switching on and off automatically. Let me explain I would like to turn the system power on the bike and turn the system off after ten seconds of turning off the bike. Given that I would not miss the hours counted (except through reset button) I thought about using standby but how do you?

P.S.: I would use a LPC11U24

12 Apr 2013

This may be useful for the standby http://mbed.org/blog/entry/New-Cortex-M0-mbed-having-a-snooze/

Presumably you can find something to provide an interrupt when the ignition is turned on.

13 Apr 2013

thank you

13 Apr 2013

these functions are compatible with LPC1768 and KL25Z?

13 Apr 2013

You will have some sort of main loop for displaying the results of the rpm, speed and such. In this main loop you can simply poll an input port pin which detects if the ignition is on or off and put the system to sleep accordingly. The detection can be made in several ways: a simple voltage divider or why not use the ADC for this and make a nice 'system voltage' indicator on the display (you also need a voltage divider for this) For measuring distance/speed you need some kind of pulse generator on your front or rear wheel. By measuring the circumference of the wheel and the number of 'ticks' per revolution you can calculate distance and speed. A trip counter is also very handy. I did a similar project some years ago for my '73 VW Bug on a Dallas DS5000 CPU (8051 compat.) I used a pulse wheel from an old mouse connected to the original speedometer cable using the housing of a defunct speedometer. By writing the values on each update to battery backed SRAM (which is default on the DS5000) you can even switch off the CPU with the ignition. The LPC1768 has a RTC with some spare RAM bytes which are saved when buffered by a lithium battery.

13 Apr 2013

Gert van der Knokke wrote:

You will have some sort of main loop for displaying the results of the rpm, speed and such. In this main loop you can simply poll an input port pin which detects if the ignition is on or off and put the system to sleep accordingly. The detection can be made in several ways: a simple voltage divider or why not use the ADC for this and make a nice 'system voltage' indicator on the display (you also need a voltage divider for this) For measuring distance/speed you need some kind of pulse generator on your front or rear wheel. By measuring the circumference of the wheel and the number of 'ticks' per revolution you can calculate distance and speed. A trip counter is also very handy. I did a similar project some years ago for my '73 VW Bug on a Dallas DS5000 CPU (8051 compat.) I used a pulse wheel from an old mouse connected to the original speedometer cable using the housing of a defunct speedometer. By writing the values on each update to battery backed SRAM (which is default on the DS5000) you can even switch off the CPU with the ignition. The LPC1768 has a RTC with some spare RAM bytes which are saved when buffered by a lithium battery.

not to lose the data and avoid the sleep and wakeup I thought to store them all in a I2C eeprom for detecting the speed I thought about using a coil that when exposed to a magnet by a pulse can go?

15 Apr 2013

Davide Luongo wrote:

not to lose the data and avoid the sleep and wakeup I thought to store them all in a I2C eeprom for detecting the speed I thought about using a coil that when exposed to a magnet by a pulse can go?

That is how bicycle computers work, but I believe they use a hall effect sensor but maybe a reed switch would work too.

If you're mounting something on your motorbike's wheel it may be worth seeing a mechanic to balance the wheel afterwards.

How does your existing speedo work? On my bike it's a cable attached to the front wheel that revolves in its sheath with each wheel revolution, that would be pretty horrid to interface with but maybe your bike has something nicer.

15 Apr 2013

Stephen Paulger wrote:

That is how bicycle computers work, but I believe they use a hall effect sensor but maybe a reed switch would work too.

If you're mounting something on your motorbike's wheel it may be worth seeing a mechanic to balance the wheel afterwards.

How does your existing speedo work? On my bike it's a cable attached to the front wheel that revolves in its sheath with each wheel revolution, that would be pretty horrid to interface with but maybe your bike has something nicer.

My motorcycle is a cross it haven't any sensor

15 Apr 2013

A safe way to detect your wheel turning is to count for example the bolt heads of your brake disc with an inductive metal proximity detector like the ones used to count tooth of a gear. On racing bikes this is a common way to measure the rpm's of the front and rear wheels without unbalancing the wheels.

e.g. http://www.gripone.com/en/speed_sensor.htm (no affiliation with this, just a Google hit)

On writing to EEPROM (or Flash) remember that these types of memory have a limited number of writes, SRAM has unlimited write capabilities. The LPC1768 does have 20 bytes of battery-backed up RAM which would be plenty to store distance and trip values) The LPC1768 does use more power but can be switched off simply with the ignition.

16 Apr 2013

I'm sorry if I use a GP2D120X or a CNY70 near disk brake is the same thing...

16 Apr 2013

Davide Luongo wrote:

I'm sorry if I use a GP2D120X or a CNY70 near disk brake is the same thing...

The trouble with optical detection is that it will get dirty or pickup stray light and create a false speed reading. Those proximity sensors can be found on ebay for less than $10 so I would definitely go for that. Just search for inductive proximity sensor.

Make sure you create a sturdy bracket: you do not want to get a cable tangled up or lock up your front wheel.

16 Apr 2013

a substitute for the internal EEPROM is the filesystem.

16 Apr 2013

This is the display I used, here it is still in the test stadium

/media/uploads/gertk/_scaled_2009-06-12_09.17.30.jpg

The display shows the fuel tank level, voltage, limited 3 digit speed (no I did not expect the VW to go over 199 km/h), total km, trip counter and current time. In the empty space on the right I plan to add a rpm graph.

17 Apr 2013

thanks for the idea but I think it is too cumbersome to use a HD44780 16x4 Also I do not care the level of gasoline I'm interested only in the hours of use of the engine, the rpm and speed ... I also have to be mounted on a motocross bike and the spaces are very low!

17 Apr 2013

Davide Luongo wrote:

thanks for the idea but I think it is too cumbersome to use a HD44780 16x4 Also I do not care the level of gasoline I'm interested only in the hours of use of the engine, the rpm and speed ... I also have to be mounted on a motocross bike and the spaces are very low!

The photo was indeed jus an example, the display btw is a full 128x64 graphic :-) And even though it is just black and white it shows a nice 'boot splash' image for a few seconds when you turn the ignition on.

On a motorbike you also need to make sure that none of the components can resonate. Any part with 'legs' or long wires will vibrate and is probably going to break off. I made sure that all components were either SMD, low profile or mounted in such a way they could not move (glued). Also make sure your power supply is properly filtered and protected against 'spikes'. The ignition (and maybe fuel injection?) can generate very nasty spikes which can damage your CPU board with ease. In my VW I had to replace the high voltage ignition cables (they were old anyway) and added a 4700uF 40V capacitor next to the ignition coil to filter the interference which kept corrupting the display.

On your motorcross bike you might even consider of 'potting' all electronics in resin or another compound (after you made sure everything works the way you want of course) as water, sand and dirt will get into anything.