Motorcycle Computer, Try Number 1

If you check out the post Heated Jacked PWM Controller, you’ll notice that while I’ve figured out the electronics behind this, I’d yet to figure out the logistics behind a computerized controller.

The original plan used a Raspberry Pi A+, and also used a Adafruit LCD I2C Backpack. This actually made it to a few test rides on the bike.  It worked! Well, sometimes…

Short story – This box sat under my seat and housed the Raspberry Pi, MOSFETs, and power supply. This is after I disassembled the first failed attempt.

This unit mounts to my handlebars (and this pic actually has some testing going on).

Originally, I wanted to control the box using as few wires as possible – the screen takes six (not counting the backlight colors), and each encoder needs two, each button needs one, and buttons need ground. The I2C backpack made controlling the screen possible with only two wires, so I was able to get it down to <16 conductors, or two Cat5e cables.

BUT – read anything about I2C (which I failed to do) – and you’ll realize a shortcoming.  It’s extremely susceptible to any magnetic or electrical interference. It’s really designed for chips residing on the same PCB.

So the end result of the Raspberry Pi based system: it worked only when the bike was off. No kidding – without the bike on, there was no interference on the I2C lines, and the screen worked perfectly. I even had a little screen configured to graphically represent the setting of the jacket. The MOSFET worked great, and so did the rotary encoders. For a peek at that old code, see my github repository.

If the I2C line started seeing errors and missing commands, the screen would display gibberish. Unfortunately, that was really anytime the bike was running. Turns out, metal spinning, fuel pumps pumping, and high-voltage spark plugs firing doesn’t make it a good environment for sensitive protocols like I2C (that’s why things like CAN bus exist). These I2C errors would then make my program hang.  I could have coded some I2C refreshes in, but it doesn’t solve the root cause.

Back to the drawing board – for a hardware update.

One Comment

  1. Pingback: Motorcycle Computer: The Screen Module | Phil's Pi Projects

Leave a Reply

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