View Single Post
Dec15-11, 08:02 PM
berkeman's Avatar
P: 41,140
Quote Quote by trogan77 View Post
Hi guys... be kind as I am a software engineer by trade and this is my first little side-project in EE.

So I'm building a custom motorcycle from the ground-up and it is nearly complete. I decided for the brake light and various indicator lights, that I would control them using a pic microcontroller for which I have already written and tested my program. Everything seems to be working wonderfully on the bread-board. I have a 12v DC power supply running the circuit (although I think on the motorcycle, the voltage may be around 14v) and the microcontroller is behind a voltage regulator to give it the 3.3v it requires. For the indicator lights, I have a bunch of LEDs that I blink or fade using PWM as necessary, and there is a small transistor paired with each of them which helps the pic switch them on/off. The circuit will certainly draw less than 3 Amps altogether. All of that seems to have been pretty straightforward.

Here is the part that I'm scratching my head over. I know that in automotive applications, the electrical system is a very harsh one with EMI, voltage spikes from the ignition system, overvoltages, undervoltages, and various gremlins which I may be unaware of.

How can one best protect a microcontroller in such an environment? I'm assuming that I'll need to put the voltage regulator and microcontroller behind a filter of sorts but I don't know how to design that piece. I have also read that there are some chips designed specifically for this purpose but I don't know much about that.

Also, how can one protect the pins of the microcontroller where they connect to various switch inputs? (eg: low oil pressure sensor, neutral switch, directional switch, etc.)

I hope I have provided you with enough information but please let me know if you would like more details. Any recommendations you can provide will be thoroughly appreciated.


The motorcycle in case you are curious.
Welcome to the PF. And very nice quality work so far!

Designing an Engine Control Computer (ECC) and hardening it against electrical transients and RF interference is very non-trivial. Is your motorcycle intended to be licensed and ridden on public roads? Or will it be more of a show vehicle?

The area of Electromagnetic Compatibility (EMC) is quite large, and involves a lot of design and fabrication techniques. Here is a Google search with typical web pages with EMC info:

But to really do a good job at hardening your ECC and the bike's electrical system, that may need you to partner with somebody who has a lot of experience in this area.

And beyond the EMC hardening aspects, there is also the issue of processor execution reliability and rider safety. The system needs to have some "fail safe" aspects built into it, and it would be best if there were redundancy of critical processing components like the PIC. One design technique would have 3 PICs all running the same program simultaneously, and "voting" on the outcome of that processing via an external control circuit. I'm not sure if commercial ECCs use multiple processor redundancy to increase reliability, though. In things like plane flight computers and such, I think it is relatively common.

Others will hopefully chime in with thoughts as well. But a lot hinges on whether you want to license this for public road riding, I think.