Motorcycle Control Panel with Arduino + Bluetooth

Great work! I would be glad to help with anything you need. I was in a similar state a few years ago. Although I didn't use arduino, I do use an Atmel. For me the electronics was the easy part. The hard part is getting the form/mechanical stuff right. Cause no matter how great it works, it won't stay long on the bike if it doesn't look good.

Check out my speedo and tachometer.
www.speedwayinstruments.com

Keep up the work.

Justin

Don't overthink the power supply or re-invent. There are many LDO devices that are very small and contain all the protection you need. check out www.maxim-ic.com or www.ti.com. Many of these companies will send you free samples.

Look for something that will handle 40V-60V input and regulate the 5V output. Also make sure it has reverse voltage protection and overtemperature protection.

On your second picture with the bluetooth module attached, what module are you using? and how have you coded that? I am looking to use a bluetooth module I have lying around for one of my projects so I would be interested in any info you have.

Btw, great project.

Mowcius

Could you share the details on the reed switch? Curious what part you used and how you mounted.

Working on a similar project for my bike, and it could save me time, or give me inspiration.

Thanks!

that is so cool, I've just started designing on to fit my XT660X. Any circuit diagram or code would be really appreciated!

Made it into the Make Magazine blog again! Ok, I'm easily amused.
http://blog.makezine.com/archive/2009/06/motorcycle_control_panel_with_ardui.html?CMP=OTC-0D6B48984890

By the way, I was just about to cannibalize another RBBB and a radio shack protoboard to make my next frankenstein when I realized that the whole thing would fit on the RS board - power and all. I'm just doing a wholesale copy of the RBBB circuit (which I like very much) and I have room for my extra power and signal conditioning circuits. With the corners trimmed the board will fit nicely in the space meant for the MC's tachometer.

Don't overthink the power supply or re-invent. There are many LDO devices that are very small and contain all the protection you need. check out www.maxim-ic.com or www.ti.com. Many of these companies will send you free samples.

Look for something that will handle 40V-60V input and regulate the 5V output. Also make sure it has reverse voltage protection and overtemperature protection.

Good pointers, I'll go look at that. I got a 20v regulator but I was still going to put in the diodes and resistor just to spread the heat around. I'm not too nervous about shedding 1/2 watt in a resistor and another watt in the regulator but all this stuff IS right near my gas tank!

Great work! I would be glad to help with anything you need. I was in a similar state a few years ago. Although I didn't use arduino, I do use an Atmel. For me the electronics was the easy part. The hard part is getting the form/mechanical stuff right. Cause no matter how great it works, it won't stay long on the bike if it doesn't look good.

Check out my speedo and tachometer.
www.speedwayinstruments.com

Those are SO sweet. Are the cases all custom made? I hope you're selling a ton of them!

On your second picture with the bluetooth module attached, what module are you using? and how have you coded that? I am looking to use a bluetooth module I have lying around for one of my projects so I would be interested in any info you have.

Btw, great project.

Mowcius

The module is the bluesmirf silver from sparkfun. You don't need to code for it, you just hook it up to +V, ground, TX, RX and the arduino just does serial as normal. You need bluetooth in your PC of course but I have a cheap dongle for mine. It was a bit of a pain to set up the first time but now it just works.

Could you share the details on the reed switch? Curious what part you used and how you mounted.

Working on a similar project for my bike, and it could save me time, or give me inspiration.

Thanks!

The reed switch is just the sensor from a bicycle speedometer and it's mounted on the swing arm of the motorcycle with super glue. I've collected a bunch of these speedos over the years and this one just fit where I wanted it to go. There's a magnet superglued to a bolt that holds the drive sprocket on the rear wheel. The reed switches are not tricky at all. when there's a magnet near them they open. They have no trouble with the speed.

I have tried a hall effect sensor which is more sophisticated but it needs 3 leads instead of 2 (power, gnd, signal) and one of the leads is "hot". If the switch malfunctions it's just either on or off - the hall effect sensor could short something.

The other advantage of the bike speedo is that you can just hook up the speedo head to check your work and you get a free handlebar mount as a bonus.

that is so cool, I've just started designing on to fit my XT660X. Any circuit diagram or code would be really appreciated!

Thank you. I posted the basic code and circuit a while ago for the bicycle prototype. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236701872/0#0 I will post the circuit and code for this one in the next couple of days.

Meet BoB - Brawny on a BoardI've been concentrating on the Brawny version of the Motorcycle Control panel – one with all the features. I had been planning to build it based on a Really Bare Bones Board Arduino clone from Modern Device. The RBBB's are great but I found I was cutting traces and drilling holes and I was still going to have to tack on an extra piece of perf board. I discovered that the piece of radio shack proto-board that I was hacking up would hold the whole circuit very nicely.


The board, with minor trimming will fit in the 6 cm circular area where the tach fits and there's plenty of room for all the components and connectors. I'm sure i could crunch it further but there's no need to push my luck or my assembly skills.

The LCD fits over top of the ATMEGA chip but there's lots of clearance. I'm very pleased so far.

Addendum - Well ICK!
I've been spoiled by the high class plated-through proto-boards I've been working with. The RS board is one side thin copper that will barely take solder after cleaning. Live and learn!

Im interested in the code - especially the RPM / Speed parts.

Ive built a similar thing but for a car, but I cant quite get the RPM working properly.

My prototype code - evil and crufty as it is, is too big to post here! The most obscure thing about it is probably the interrupt handling. Each of the wheel and the tach interrupt routines adds an entry into a log of times. The main loop routine polls the log every 100 ms and runs the required logic. I've posted the tach and wheel routines below because that's where the bulk of the logic is. The reason for the two stage interrupt process is so I can put debugging into the logic without messing up interrupts. I've also posted the actual tach interrupt routine. the wheel routine is simpler because it posts every event where the tach bulks them up by 10.

void processwheel(unsigned long lmillis){ //input is time of interrupt from log
  unsigned long wheeltime; //time for previous revolution
  if (lastwheelint!=0){ //don't do calculations 1st time in
    wheeltime=lmillis-lastwheelint; //track the exact rotation time
    wheelrpm=60000/(float)wheeltime; 
    //Serial.print(" wheeltime="); Serial.print(wheeltime); Serial.print(" wheel rpm="); Serial.print(wheelrpm);
    roadspeed=.123*wheelrpm; //condensed version of 2.05*60*wheelrpm/1000; where 205 is wheel circ. in metres
    //Serial.print(" road speed kph="); Serial.print(roadspeed);
    setgear(); //figure out what gear we're in
  }
  lastwheelint=lmillis;
}
void processtach(unsigned long lmillis){ // input is interrupt time in millis
  unsigned long tachtime; //elapsed time for 10 tach events
  if (lasttachint!=0) { //skip calculation on first time in
    tachtime=lmillis-lasttachint;  //time for last 10 events
    if (tachtime>0){ //just avoid divide by 0
      insttachrpm=60000/(float)tachtime*10;  //rpm based on time in ms for 10 tach pulses
      avgtachrpm=(avgtachrpm*2+insttachrpm)/3; //rolling average rpm
      //Serial.print(" tachtime="); Serial.print(tachtime); Serial.print(" inst tach rpm="); Serial.print(insttachrpm); Serial.print(" avg tach rpm="); Serial.print(avgtachrpm);
    }
  }
  lasttachint=lmillis;
}
void tachmonitor(){  //this is the actual interrupt routine
  static int tachcount;
  if (tachcount <9) { //bulking up tach interrupts by a factor of 10
    tachcount++;
  }
  else {  //every 10th tach pulse we spawn a log entry
    if (ilog<=maxlog){
      lflag[ilog]='T'; //pedal pass flag
      lmillis[ilog]=millis();
      ilog++;
    } 
    else {
      logoflo=true; //we've overrun the log table
    }
    tachcount=0;
  }
}


I've already said I'm easily amused but this project's 15 minutes of fame has spread over onto Hack-a-Day.

Yeah but we read it here first guys...

Mowcius

June 19
BoB is Alive!
I can't imagine why I thought this was simple. I reproduced the RBBB circuit on a Radio Shack proto-board and added the extra power protection and the voltage dividers and debounce circuits needed for the MC control panel. I'm not completely finished the wiring but it got to the point where I could try a sketch and it worked. The good news is that it does fit in the allowable space on the bike so that's something.

Next steps I have to finish wiring the LCD header and the serial hookup then I should be able to port the software. Way too much trouble though. If I do another prototype I'll try out something like the mpguino or some other proto-board as a base .

What is that square white object in the lower right corner? It has five leads connected to the board. :slight_smile:

Pakrat

a connector with 5 leads

mircho

Junior Member

Online

Arduino rocks

Posts: 66

Re: Motorcycle Control Panel with Arduino + Bluetooth
Reply #34 - Today at 08:47:55
a connector with 5 leads

CUTE