I tried to look up the programmable relays that GreenGiant mentioned, but I just don't know enough about them to filter for what you need. (My search was getting muddled by timing relays that can be programmed with large times, measured in seconds or minutes.)
Sound like your getting there, though. The BASIC Stamp just might work.
In this manual:
http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf
I'm looking at page 14, Table 1.2 and for the output pins labled p1 -15 it says:
General-purpose I/O pins: each can sink 25 mA and source 20
mA. However, the total of all pins should not exceed 50 mA (sink)
and 40 mA (source) if using the internal 5-volt regulator. The total
per 8-pin groups (P0 – P7 or P8 – 15) should not exceed 50 mA
(sink) and 40 mA (source) if using an external 5-volt regulator.
So, I think you just need a relay that can switch 12V, but is opperated at 5V and draws less than 20mA. (Opps, I just found out that is really low for a relay. If you can find one like that or find the solid state equivelent of a relay, but with the low current draw, then great...)
(...otherwise) Here is a link to an article where someone is using the output of an Arduino to control a relay:
http://www.glacialwanderer.com/hobbyrobotics/?p=9
I didn't read the article, but when I saw the schematic, I thought this is what you need.
Schematic:
http://www.glacialwanderer.com/_blog/blog2008/04_April/hb_relay5.jpg
(The article might be a good read, becuse he probably explains his part selection.)
I made a schematic!!! (Really, I just copied his layout and re-labled it for your bike. It's attached.)
Unknowns:
1. Where he has a 1k resistor coming from the Arduino you might have a different value. It would be based on the current draw of the coil of the relay you choose, and characteristings of the transister used. (And an easy calculation for the masters on here. I might be able to do it if someone else here confirms my calculation, but we need the other info first.)
2. The diode can probably be the same, but doesn't have to be. It protects the transistor. When the transistor shuts off, there is energy in the coil of the relay that has to be disipated, that all. Lots of different diodes might work.
3. He does this with 5V and you'll use 12V. If you had a 5 V supply, you could duplicate his circuit alsmot exactly, but 12 is fine. You just might have slightly different parts.
4. The transistor. He uses a 2n2222. I don't have transistor characteristics memorized. (Not even for this very common one) Here is what it needs, I think:
The max collector current needs to be more than the current draw of the relay coil. And there is a characteristic that represents the ratio between the collector current and the base current. (I don't remember what it is called.) For instance if the collector current is 5 times the base current and we have a maximum available of 20mA that we can take from the BS2, then the collector can pass 100mA, which still might not be enough for the relay. (need to know more about the relay) If the collector current was 20 times the base current, we would have 400mA available for the relay, which should be plenty.
5. The relay. It has to be fast and that's about it. You want to control the width of the gap in power to the coils between 10ms and 150ms, so you don't want a relay that takes 200ms to re-engage power when it's done. I guess if you can, you want to pick one the has a low current draw at the coil, so that transistor selection is easier. If it happened to have a built-in protection diode, that would be a nice plus.
To the experts out there... will this work? Or could this work? Or Is there maybe a much much easier way to do this? Ha, ha!!
Are there relays that switch at speeds of 10 to 20 ms or so or will he need something solid state?
Do relays usually draw in the 50mA to 200mA range?
What is that transister characteristic called that's used to calculate back and forth between the base current and the collector current? I think for audio amplification it is "beta", but I can't remember if that same value would be used here for power switching or if it is called something else.
-tim
Edit:
Its the "gain" of the transistor I was thinkning of. On the data sheet it would be the "DC beta.) (bDC)
That value should be AT LEAST about 20 or so, but the higher that value is, the less restrictive your relay selection will be.
As an example, I looked up the 2n2222 and it would be fine.
A gain of 75 and max collector current of 800mA.
Also I did a google search about relay switching speed and the first worthwhile hit came from THIS SITE. YE-AH!
Here
https://www.electronicspoint.com/relay-switching-speed-t119276.html they say 50hz to 200hz for a typical relay which works out to 5ms to 20ms, so it shouldn't be difficult to find one that works. They also talk about alternatives for faster switching.
:end of edit