Using AiM speed sensors for alarms with Arduino

So if you’ve been reading my blog, you know I created a SV650 ECU Decoder which decodes the data stream from the ECU that normally would go to the OEM dash. Recently I upgraded from the GPX Pro to the more powerful and physically bigger AiM MXL2.

So here’s the problem- the new dash is bigger which means I’m having a harder time finding a visible mounting point for my ECU decoder. And while the MXL2 can decode things like water temp, TPS and gear position from the ECU, it can’t decode any EFI warning codes. I didn’t like the prospect of not knowing when the bike was misbehaving due to a bad sensor or damaged wiring harness so I needed to come up with a solution.

Since the SV650 ECU Decoder is powered by an Arduino-like micro-controller called a Teensy, the obvious thing would be to connect it to one of the analog inputs of the MXL2 and use that to trigger an alarm on the MXL2. The problem is I wanted to use all the eight analog inputs of the MXL2 for various sensors and I’d rather not give up useful data from one of those sensors just to add support for the EFI warning light which hopefully should never turn on.

The MXL2 however has four digital wheel speed sensor inputs and I was only using two of them on my motorcycle. I looked in the AiM Race Studio 3 software and sure enough- you can set alarms based on a speed sensor. It was only slightly more work to write code on the Teensy to turn on/off an output pin at 10Hz then it was to just turn it on for when there was an EFI error. I then hooked up the SV650 ECU Decoder to the Speed3 input of the MXL2 and configured it like this:

Configuring the Speed3 input for the EFI Alarm

Configuring the Speed3 input for the EFI Alarm

As you can see, I made the wheel very large (1000in) so that even with a slow 10Hz signal the MXL2 would convert that to a fast enough speed to trip the alarm.

Configuring the alarm on the MXL2 dash for the EFI Alarm condition

Configuring the alarm on the MXL2 dash for the EFI Alarm condition

I was able to do a quick test by disconnecting one of the sensors from the wiring harness and sure enough, the dash display went red, printed “EFI Alarm” and LED 2 went red as well. This allowed me to relocate the SV650 ECU Decoder somewhere else on the bike which wasn’t easily visible without losing functionality.

If I really wanted to get fancy, instead of hard coding the signal at 10Hz, I could use different signal rates for each EFI error code and teach the MXL2 to generate different alarm messages based on the signal rate. I decided not to do this because it was a bit overkill for my needs (the SV650 ECU Decoder has a small display to read the error codes) and because the MXL2 doesn’t allow you to input Hz, but rather does things based on MPH/KPH calculations and I didn’t feel like doing all the math to convert between the two.

Leave a Reply

Your email address will not be published. Required fields are marked *