Wednesday, March 22, 2017

DIY Motorcycle Electronics

Testing my Arduino-based Turn Signal Controller
For quite a while now, I've been thinking about ways I can apply my knowledge about electronics and software to motorcycles.  I'm a bit of a diy sort of guy, and I'd rather make something than buy it if I can. Making rather than buying is a great way to be creative, and in some cases can also allow you to save money. Because I know a bit about electronics and enough about writing software to make a living at it, creating my own electronics is an excellent way for me to be creative and have fun. And because I love motorcycles, I'd like for some of my hobby electronics projects to be about motorcycles.

I actually have done one such application - an arduino-based LED turn signal controller. When I bought my motorcycle, it was missing the turn signals. I knew I wanted LED turn signals for the simple fact that they are more efficient and more durable than incandescent turn signals. But turn signals do not draw enough current for the flashers that make turn signals flash.

It seems that the typical solution to this problem is to use components called load equalizers. These put some resistance in parallel to the LED signals to shunt enough current for the flashers to function. This, of course, is silly. It completely takes away one of the advantages of LED signals and compromises the other. With the load equalizers, the same amount of demand is placed on the charging system and battery, and keeping the flashers means having a necessary component that is prone to wearing out.

The Turn Signal Controller
By using an Arduino to control the LED signals, I keep the low-current-draw advantage of LED lights, though there is some cost to running the Arduino. By using transistors and a few other components, the controller can provide more current to the LED signals than the Arduino digital outputs can provide on their own. I can programatically control the flash rate, flash pattern, etc. If I press both turn signal buttons simultaneously, I can flash the signals on both sides for hazard lights.

That project has worked out for me well so far, and I've been looking for other opportunities for more motorcycle electronic projects. A few have come to mind.

So one day I realized that I needed to replace my voltage regulator on my Sportster, or at least I thought I did. In retrospect, dirty ground connections may have been causing issues. In any case, I couldn't take the regulator apart to do any testing. When the whole damn regulator housing is filled with epoxy potting, that's not really an option.

The Electronics Inside the Housing
I didn't have time to engineer and build my own regulator. I needed to get my bike going quickly, since I use it to commute. I went ahead and paid the $50 for a new regulator. I did see that there were simple regulator designs posted, and it seems like something I could engineer on my own. By the time I need my next regulator, I would like to have a replacement already built, perhaps using the same housing as my old one.

Another project idea I've had is already partially built. I've got the electronics and software for an arduino-based speedometer already prototyped. It uses a hall effect sensor to signal the arduino controller when magnets pass by. The arduino then calculates the speed, and moves a servo that a speedometer needle will eventually be attached to. I'll post the details on that in a later post.

One really cool possibility to explore is throttle body injection for older carbureted motorcycles. Those who listen to the Cleveland Moto podcast may have heard them discussing this subject. There's definitely some DIY fuel injection projects already available, though most of them seem to focus on cars. The computing power necessary for a fuel injection system is getting to be damn cheap. For most motorcycles, a simple Arduino should be fine, but if not, there's many more powerful alternatives that are actually about as cheap.

One thing to consider for those thinking about rolling their own motorcycle electronics is that no hobbyist will ever have the time and money to do the research and development that any of the major motorcycle companies can do. But for the many applications, you won't need to. Just be mindful that your homemade electronics might not be as reliable as factory electronics, and be mindful of any safety concerns that may cause. Test thoroughly, and when possible, learn from the mistakes and successes of others. Plan to be able to revise your designs. Solve as many problems as possible before taking your custom electronics out on the road.

Don't be afraid to give it a try. So maybe you're no electronics guy and you don't know jack about writing software. Learn what you can and see what diy projects are already available. The worst you can do is fail. In fact, you will have failures. You'll learn from those. (Well, unless they're fatal failures. Just skip those if you can. 😜 ) Just keep at it, and have fun.