Adding a little Raspberry Pi to my 82'Heritage Special.

rugbywarrior89

Need more time...
Messages
336
Reaction score
0
Points
16
Location
Rootstown, Ohio
In lieu of the fact that I want to rewire my XS, I have decide to take on a very difficult (and probably stupid) hobby project. I am going to give my motorcycle a BRAIN (MWAHAHAHAH!!)

As some of you may or may not know, a Raspberry Pi is a micro computer about the size of a credit card that people use to do just about anything from robots to high altitude cameras, weather stations, media players, etc. They sell between $20 and $40. Then you buy accessories to for your project (in my case a $10 8-port relay board).

http://www.raspberrypi.org/

http://www.newegg.com/Product/Produ...ATCH&Description=raspberry+pi&N=-1&isNodeId=1

I have decided that I am going to use it to operate my ignition wirelessly via bluetooth and also operate my lights and horn. This is for a few reasons:

1) I have no idea where to find good range RFID controllers that go more then 5 inches and my phone will be my key.
2) the microswitches I want to use on my handlebars do not carry the required current
3) Self cancelling flasher relays are expensive as hell (way mare than $30)
4) Relays to convert momentary switches to latching switches are expensive as hell.
5) Most importantly, this Hobby project excites me to no end:D
6) Why the hell not?!

I know there is more than a few reasons NOT to do this project and I have considered them including pi failure and security concerns. So please, I beg of you to not be a naysayer or a killjoy! I am really looking for some help here and I really want this to work. I will update on here as I go and hopefully have it done over the winter.

This idea is still very much in its infancy and I need to learn how to write code:doh: but I'm sure this can be done.
 
Sounds fun. I was thinking of replacing the speedometer tach with a display powered by a a Raspberry Pi, so I'll watch this closely. Good luck!
 
I'm setting up an Arduino-powered dashboard and I'm using a GPS module to power the speedo and a capacitance coil circuit running off a spark wire for the tach. Eliminating the mechanical bits entirely.
 
I was thinking about doing a GPS and media payer with a nice touch screen but I decided that given my experience (or lack there of) that I should stick with basics for now and not add too many potential sources of failure for the pi.
 
Fair enough. The tach and speedo are my primary goals, whereas it sounds like you've got a plan and they'd basically be add-ons for you.
 
Having a raspberry pi sitting on my desk with no planned project in site... I think your idea rocks!!! I LOVE the RFID ignition idea!!!
 
I have a raspberry pi sitting around, but I've already started the process of designing an arduino nano microcontroller to work with my XS360.
I'd suggest it as an option before you get too invested in the pi. I don't know anything about bluetooth, but I know there are arduino modules for it. Might be more straightforward than dealing with the operating system and driver requirements of a pi.

The aduino based design for my 360 replaces the flasher relay and auto-cancel unit. It is LED or incandescent compatible.
From the auto-cancel connection it can retrieve mileage data. I'm designing it from the outset to handle multiple inputs, one of which will eventually be rpm monitoring.
With that information a lot of performance data can be calculated.

I should have the prototype for the auto-cancelling flasher done by the end of winter.
Inductive or capacitive monitoring of engine rpm is the next big challenge.

I am also doing it for the challenge. :)
 
http://www.electronics-tutorials.com/devices/555-tachometer.htm
This is a capacitive tach circuit I found that seems like it ought to be viable. I'm not sure because I'm really new to this kind of electronics but I'm going to test it out once a few more parts arrive. I'd be interested in your solution for the flasher relay.

EDIT: not knowing how the Pi handles input/output, I'm not sure, but it seems like this one ought to work for a Pi-based system too; the "M" on the bottom right of the diagram is just whatever you send the signal filtered by the 555 to.
 
Last edited:
Add a computer to your XS... Are you crazy? Haven't you watched any of the Terminator movies? :laugh:
Seriously though, it sounds like a great little project, keep us updated.

Posted via Mobile
 
A couple thoughts:

- You must have some sort of fail safe to keep the ignition on in the event your phone looses it's connection. i.e. you start the bike and have to step away while it is warming up, or your phone dies/crashes. Having the bike die while on the road could be catastrophic.
- Boot time, while quick with the Pi, will be a bother. Keeping the Pi running when the bike is off will drain the battery.
- In Canada, an odometer is required on all road vehicles.
- RF shielding will be needed.
- A filtered power supply will be needed. It would also be wise to electrically isolate the tach signal from the Pi to prevent issues.
- A waterproof, vented enclosure will be needed. I'd suggest using a breathable membrane on the vent, like Gore-Tex or Ty-Par. Heat may also become an issue.
- Touch screens are cool, but finding one that is pressure sensitive rather than capacitive is recommended. An e-ink display may not be pretty, but it will work better than an LCD, especially in direct sunlight.
 
I'm pretty keen to see how this works out.
We might run into the same problems with the same solutions.
Do you have a power supply in mind? I am going to attempt to integrate the power supply into my unit using a LM2940CT-5 voltage regulator. They're meant for automotive uses and can provide constant 5V under a greater supply range than standard voltage regulators.
There must be off-the-shelf supplies available that might be easier to work with though.

The ignition could be set to turn on, and stay on, with one tap of the rfid device/phone and off with another, or separate on and off signals from a smartphone app. Walking away while running wouldn't be a problem.
I'd be more concerned about not being able to start the bike if the phone battery dies, but as a convenience feature in addition to a standard ignition it would be pretty cool.

The booting issue could be a big one. The pi would have to be already on to detect the rfid signal from the phone to start the ignition.

Rf shielding for sure, especially around ignition components. Since the wiring harness goes right past the coils the shielding requirements to route anything to the handlebars might be high. I don't know how much flux leaks from an ignition coil but it could be significant.

The tach isolation is a very good suggestion. I'm going to attempt to use an optocoupler and limiting resistors to keep the circuits separate.
I've read about some people trying to use sensors to detect the actual motion of the cam, rather than tapping into the ignition system directly, but noise from the ignition coils seems to render this method almost unusuable.
Tapping into the 12V side of the ignition circuit, or Inductive/capacitive monitoring of the ignition wires seems to be the way to go for my bike at least, with its points ignition. I have to wonder if a TCI bike might be a lot easier to tap into since it is already partially electronic to start with.

A challenging but cool project for sure. :)
 
I haven't really figured out the power supply situation yet. I'm sure they make something. Worst case, you could use a power convertor to a 110V power supply. That would be the Macgyver method, not too pretty.

I was thinking the pi could always stay on. Shouldn't be too much of a problem with a good battery and a trickle charger. I'm hoping I can put the pi to sleep for minimal power consumption and to wake up with the bluetooth connection/phone app.

I think the problem of losing connection might be accomplished easier with a latching relay. As soon as the signal trips the relay, it would stay on until you shut off the kill switch. I figured out a super simple way to make a latching relay with a normal 4 pin relay and a jumper wire in another thread. http://www.xs400.com/forum/showthread.php?t=13139&page=4 starting at post 74

I was just thinking of another possible ignition scenario. Since all my buttons are going to be GPIO inputs, I could have a button combination to turn on the ignition in case the phone died while I was gone. Another thing would be to bypass the pi altogether and run a keyed ignition switch in parallel with the pi just in case the pi failed completely.
 
The tach signal has to come from the negative side of the ignition coil. It is the one that is "switched" by the points or TCI to trigger the spark. The positive side is constant power when the ignition is on, and won't provide a signal.

Keep brainstorming and the solutions will present themselves!
 
Back
Top