Bluetooth Motorcycle Control Panel With Arduino

Motorcycle_in_neutral

[Bill2009] has made some nice progress on a control panel for his motorcycle over at the arduino.cc forums.  It can show speed, tachometer readings for the wheel and engine, as well as indicate the current gear. He reads the square wave coming off of his tachometer input and pulses from a reed switch mounted on the wheel to calculate all this. To top it all off he can monitor the data via a Bluetooth module attached to the board, which is much better than trying to balance a laptop on your knees while cruising down the highway.  He is working on getting the size down so that he can mount the whole assembly inside of his motorcycle. He also plans to add new software features like wind resistance calculations and0 to 60mph timing.

39 thoughts on “Bluetooth Motorcycle Control Panel With Arduino

  1. @spork

    Oddly enough, I don’t agree. He says that the tachometer comes off as a square wave. I’m guessing the reed switch does too. It’s pretty simple code to do a second to second timer to count the amount of pulses since the last check.Then the rest is reading documentation. You have to read the motorcycle’s handbook for the gear ratios, the LCD’s guide for the display, and the Bluetooth modules documentation for it. Unless you had the same bike and wanted to make an exact clone, I think he has enough information.

  2. yea i agree with [gerrit], it seems pretty well documented to me. i know that when i’m doing a write-up i often try to figure out a balance between putting in all the nitty-gritty details with leaving out some things in order to save the reader some time.

  3. @gerrit
    I was more interested in the bike part. Am I to understand that he took the connectors off the actual speedometer in order to get input on the new one?
    After reading I wanted to make a logger that will read the data from my bike while keeping the actual speedometer working. The real trick here is the connection/wiring, especially on a sports bike. (Think of the logger + a GPS unit to get track times and shift data)

    Side note, gear ratios should be counted out by hand when possible, as they are changed pretty often and the manual could be unreliable.

  4. I use my Nokia N810 internet tablet for the same purpose. On my harley, there is a J1850 stream, so I just link that into an obdpros OBD2-to-bluetooth module (which has an autostart mode) and I have fuel level, RPM, Speed, distance, instantaneous fuels consumption, and even the turn signals. I already have GPS (10Hz – Wintec WBT 300) going to KML, so I integrate the OBD data in the logs so I can replay and test. I have a dashboard app. The n810’s screen is readable in the sunlight though loses color saturation.

    It is all in the nokia internet tablet talk forums and on maemo.org as minigpsd (it also works under any linux-like OS). I also have a version for my OBD-II as OBD2 in the car and my Valentine V1 radar detector is also linked in. All via bluetooth.

    (I’m working on reversing the algorithm and tones for the V1 – I already have the display working where it will come to the top for an alert).

  5. Um there is no “inside” of a motorcycle unless you count the engine or the Gas tank. At least on real motorcycles there isn’t. Some of the children’s toy crotch rockets like the ninja are so wrapped in plastic I guess there is a “inside”..

    @spork. All you want is available in a simple GPS+ Wii controller You can get dead nuts accuracy with shifting from a wiimote. Plus a GPS will give far more accurate speed than the for entertainment only gauges on all motorcycles. Even my 1300GT BMW is off by 7mph at 50mph and it’s the most expensive BMW bike you can buy.

    Interfacing to the bike is a waste of time, install more accurate sensors instead of the low grade junk the bike makers use and get better data.

    Plus why BT? why not log it all to a SD card? It’s dumb to be logging to a PC.

  6. @fartface
    Bluetooth is awful, I agree.

    The bike GAUGE is off, but the actual reed switch is not. It can’t be. So if you measure it correctly, you are good to go. An accelerometer would probably not be bad either. In fact I may implement one for error checking/correction.

    The GPS is used to log coordinates at intervals more or less for ghost timing on a track, rather than capturing at faster intervals to see speed.

    The combination of both will help me with my lap times, because I’ll see where I’m going to fast/slow or shifting early/late. Also, I bet the data would make for an awesome graph.

  7. @fartface…

    You should know better than to say something like that. While I am no crotch rocket “fanboy”(of all the bikes I’ve owned, only one had any “plastic sheathing” of any sort), calling a motorcycle a “toy” just because it has aerodynamic cowling is just ridiculous. Actually, now that I think about it, it’s sort of funny how the majority of the bikes you call “toys” can vastly outperform the majority of the bikes you call “real”. I once had a Kawasaki Ninja up to over 165mph, but I would never try that on one of your so-called “real” bikes…

  8. I agree. This project is interesting to me because it is similar to something I did to my 2000 Suzuki Hayabusa eight years ago. I even sold about a dozen of them to other enthusiasts. Mine was pic based (16c711), I did the same gear position calculation mentioned in the article, but I used the hall effect sensor already on the output shaft. I also added an O2 sensor. I could log a few minutes of RPM, speed, and mixture to a bank of EEPROMs.

    As for the “real bike” angle. My Hayabusa isn’t stock. It makes 199.1 horsepower at the rear wheel and can actually go 200mph (yes, tested). Anything that wheelies at 140 can’t be called a toy.

  9. Oh…. the inaccuracy of stock motorcycle instruments is an interesting topic. I don’t believe it has anything to do with the quality of the parts used. My bike’s speedo was way off from the factory, but the odometer was dead on. Interestingly, both are driven from the same sensor on the output shaft. It seems to me like motorcycle speedometers are purposely built to read five to seven percent high.

  10. about ‘real’ bikes, i owned an Honda VTR 250.
    it was import from the usa, and was built in 1988(!)
    according to fartface, it’s a toy bike, and well, it might even look like one too.

    when riding between 60 and 75 (speed limit over here) it got 54 miles out of one gallon. when riding at it’s top 100 mph, it still got 47 mpg!

    so, what’s a real bike, if it’s got no real use?

  11. Bikes (and cars for that matter) speedo’s are built to read a certain percentage over their real speed, mainly for safety reasons.

    I live in the UK, so I dont know what the regulations over in the US are, but as above, bikes (and cars) that are built for the road are built with a percentage over read.

    I also ride a Ninja (ZX9R), it is both my every day mode of transport and my weekend toy (never learnt to drive) and it certainly isn’t a toy. It currently programmed in with a speedo healer which reduces the effect of the factory speced over read. 30Mph is bang on the money, tested with GPS, then every 20Mph upwards is 1 Mph out or near as damnit anyway.

    30 = spot on
    50 = 49
    70 = 68
    90 = 88

    So that also shows the preset over read. If a speedo healer could be developed to chace the % changed at various speeds you could infact get a totally accurate speedo, but this over read can sometimes play safe, especially with the amount of s’cameras we have over here.

  12. Note that all speedometers will be affected by tire size and wear – that is simple geometry. In my car, I read 72mph when the GPS says 70.

    Modern instrument clusters are simply frequency meters (often at the transmission controller, or engine controller for bikes) so don’t compensate. Older ones use a rotating shaft with magnet using the same idea as regenerative baking (or some similar method) so can be farther off.

  13. quan-time: What is the update rate on the tach? I can only get about 10 fps on my n810 using GTK+ and pushing things to be efficient, while the datastream updates about 16Hz.

  14. Thanks for the mention, sorry for the lack of details. I was posting it to amuse arduino drivers and frighten motorcyclists.

    Some of the code is posted on the arduino forums, as Gerrit says the algorithms for rpm and gear calculation are pretty obvious. It’s a bit tricky to get a balance between responsiveness and precision though. When you look at a speedo or tach you just see a number, and a pretty large one at that. At the pointy end of gear selection you’re counting how many times the engine fires while the wheel goes around once. That’s a small number, anywhere from 4 to 12 so it’s easy to bobble it. You can’t wait a lot more than 1 revolution because each one is moving the bike 2+ meters and in a low gear can be taking seconds.

    Someone above mentions using a gps and wiimote – the GPS would work fine if you wanted to be able to look down once in a while at highway speed and see what gear you were in – I don’t think it would work well at low speed. The wiimote idea is interesting but I don’t see how you’d pick out a gear change.

    I’m in deep envy of quan-time who posted the video! http://www.youtube.com/watch?v=FKaJrCT9yP0 – but I’m aiming for something rather moree subtle. Still WOW!

    I’m also in envy of tz who posted about his nokia harley hookup – I’ll follow that for sure.

    I started this with a prototype on a mountain bike in March and I’m still having a lot of fun with it. Thanks for the encouragement and the ideas.
    http://cid-6648e3bd665ceac9.spaces.live.com/blog/cns!6648E3BD665CEAC9!128.entry?&_c02_vws=1

  15. @billhates – I don’t know if you’re being serious or sarcastic, so discard this if its not applicable.

    I don’t get why some people around here are so averse to any project that uses an arduino. It seems like we forget the primary measure of a hack is about the creative useful/novelty items one may produce, and not necessarily the specific path one took to get there.

    There seems to be this misconception that the more complex solution is always the best. You could put together a replica of this device that’s not reliant on the arduino environment, but if they have the exact same functionality, is your device really any “better”?

    This person made a positive contribution by sharing a project that they have worked hard to create. Let’s try to give constructive criticism instead of throwing the baby out with the bathwater. If you have advice to offer on improving the design, or what he could gain by swapping out the arduino then share it and contribute positively instead of discrediting the whole project based upon one design decision.

    :)

  16. @absolutezero, yeah it’s a great project but from what i’ve seen of Arduino’s they seem to have been thought up by steve jobs, it seems no matter what you want to do with them you need an addon of some description that doesn’t come cheap, and there always a newer version or maybe im just missinformed or biased or both, doesn’t anyone use Pic’s anymore, everything you could need in one package, im completeing a similar project connected to my car through the OBD interface and displaying stats on a terminal (Graphic LCD) and yes driven by a Pic 16F877 at no extra cost of addons or obsolete hardware versions

  17. I have an arduino mega on order. But I’ll need to tweak the software to read variable pulse widths. J1850 should be directly readable on a module, as would the Valentine V1 stream, but I would need the two IC inputs on the mega (or two of the smaller chips).

    Both the AVR and PIC have their limitations – almost everything needs additional hardware. For that matter they don’t come with LEDs or LCD displays.

    But I can do the Arduino on linux, mac, or windows.

    I just looked at the datasheet of the 16f877 – I see nothing there that would be better at any automotive bus I know of (J1850 of either flavor, CAN, or ISO9141/14230). All would need hardware and software.

    The chips are more similar than different. I happen to be using an AVR at work and found the opensource tools, but if the same were available for the PIC I would probably be using one of those instead.

  18. It seems to me like having a reed switch mounted to the wheel might be something else to upgrade. The little reed in there could probably handle the hours and hours of on/off thousands of times each minute, but a hall effect sensor might work a little better because of the fewer moving parts.

  19. mike: You have a point, the reed switch might be good for millions and millions of cycles but that would only be thousands of miles. I rejected the hall effect sensor because it meant running 5v to the rear wheel but maybe it’s a better idea in the long run.

  20. “it seems no matter what you want to do with them you need an addon of some description that doesn’t come cheap, and there always a newer version or maybe im just missinformed or biased or both”

    @FunkyGibbon:

    It works with all your regular components (sensors, leds, lcds, etc).

    At its most basic, its really just a way to get a microcontroller into a project while abstracting away some of the details of doing so.

    There are a lot of clones and such out there, but they’re mostly based off of the same atmega chip, and in the end, have pretty much the same functionality (digital i/o, analog i/o, serial com, and software control over that i/o).

    The duemilanove (~$35) is the one i’ve been developing/breadboarding with, but I just ordered a couple duinostamp kits (~$10) which are pretty minimalistic. I’ll be using these to implement my finalized designs.

  21. @TZ: the update is in the order of a few ms.. was running like poopy on that vid, but its almost realtime.. but 15fps-ish.. Its still quite smooth.

    @KYLE: true, but i still made mine all myself. Saying that, i did buy the touch LCD, but i stripped it and made the housing / rest of it.

    @BILL ROWE: im half tempted to ditch the dash and go for something sleek. Ive been looking around for a way to make my own custom LCD. get the crystals fabricated to my requirements. Alas, thats hugely expensive, but the chinese will do it.
    Im half deciding to get some sort of ~5″ LCD with a back light. Would make power requirements drop, and open a few more options ive been thinking of if i fab my own driver unit.

  22. Glad to see I’m not the only one putting microcontrollers on my bike.

    I don’t like arduinos or pics and I’ll tell you why: $10 for a bare bones arduino stamp? I can get the atmega168 in an arduino for about $4 and some projects don’t need that much power; infact a lot of the projects I see that use a $30 arduino can be made using a $1.50 attiny. kudos to the arduino for being an open source design, but for $1.50 I can still use the same great development tools you use on the arduino. I used to use pics. I started right when the first flash based pics came out. they were ok and at the time were the only option for hobbyists, but like many others I grew tired of ‘free trial’ compilers and windows only software. atmel stole microchips idea and did it right: cheap versitile microcontrollers that don’t need any external parts to operate and open source cross platform development tools. my avr programmer cost $23 it uses a USB connection (who has a printer port these days?) and I can develop on any os I like. and since avr-gcc is open source I’m free to sell anything I make without any legal concerns.

    BTW:
    I’m more of a cafe guy myself but crotch rockets are not toys any more then a handgun is a toy. they just get a bad rep ’cause they look so silly.

  23. The real reason “they” ride “real” bikes is to blame the bike for the shaking they are really doing over a buck twenty! (if they don’t fall apart before then..

    Member of Club200 8/3/2000 202.4mph 1999 “built” Hayabusa

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.