PIC Microcontroller in a custom Harley motorcycle project.

In summary, a software engineer is building a custom motorcycle and using a pic microcontroller to control the brake light and indicator lights. The circuit is working well on a bread-board but concerns arise about protecting the microcontroller in the harsh environment of an automotive application. Designing for Electromagnetic Compatibility (EMC) and ensuring processor execution reliability are crucial. Multiple processor redundancy is suggested and the ECC for the engine is purchased from a company called TwinTec.
  • #1
trogan77
4
0
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.

Regards,
Tom

The motorcycle in case you are curious.
 
Engineering news on Phys.org
  • #2
trogan77 said:
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.

Regards,
Tom

The motorcycle in case you are curious.

Welcome to the PF. And very nice quality work so far! :smile:

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:

http://www.google.com/search?source...+pass+emc+tests&gs_upl=0l0l0l5920lllllllllll0

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.
 
  • #3
Thanks for the compliment Berkeman.. and all of the info as well!

Just to clarify one point, this microcontroller will be running only indicator lights for now. If I find it to be stable, I may think about controlling the brake light and blinkers with it too. But as far as the engine is concerned, it has its own ECC that I bought from a company called TwinTec which specializes in that. I'm not that brave. ;) So even if my chip becomes toast, I'll only lose indicator lights and I have a mechanism to switch them over to analog like they had in the old days. ...just in case. Also, this is not ever going to be productionized. This is going in my bike only.

Mainly I'm using this project as a learning experience for myself. If this microcontroller remains part of the motorcycle for the long term, I'll be tickled. But I am prepared to accept defeat in the face of too many major instability problems.

Anyway, this seemed like the place to gather more info for this next electrical system noise hurdle. Thanks again.
 
  • #4
trogan77 said:
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.)

Opto-isolators, perhaps?
 
  • #5
pantaz said:
Opto-isolators, perhaps?
I may have a few of those lying around, actually. Thanks, that seems like a good idea.
 
  • #6
check out automotive voltage regulators

they're three pin just like everyday 7805 but have protection against reverse polarity and overvoltage from botched jumpstarts...

national's selector guide will lead you to them
 

1. What is a PIC microcontroller and how does it work in a custom Harley motorcycle project?

A PIC microcontroller is a small electronic device that contains a microprocessor, memory, and input/output peripherals. In a custom Harley motorcycle project, it acts as the brain of the system, controlling various functions such as engine ignition, fuel injection, and lighting.

2. How is a PIC microcontroller programmed for a custom Harley motorcycle project?

To program a PIC microcontroller for a custom Harley motorcycle project, first, a code or program needs to be written in a programming language such as C or assembly. Then, the code is compiled and uploaded to the microcontroller using a specialized programmer device. The microcontroller can also be programmed using specialized software and hardware tools.

3. Can a PIC microcontroller be used to customize and enhance the performance of a Harley motorcycle?

Yes, a PIC microcontroller can be used to customize and enhance the performance of a Harley motorcycle. With its ability to control various functions and processes, it can be programmed to optimize engine performance, improve fuel efficiency, and add new features such as cruise control or GPS navigation.

4. Is it necessary to have technical knowledge to use a PIC microcontroller in a custom Harley motorcycle project?

Yes, it is necessary to have technical knowledge to use a PIC microcontroller in a custom Harley motorcycle project. This includes understanding programming languages, microcontroller architecture, and how to use specialized tools for programming and debugging.

5. Are there any precautions to take when using a PIC microcontroller in a custom Harley motorcycle project?

Yes, there are a few precautions to take when using a PIC microcontroller in a custom Harley motorcycle project. It is important to understand the electrical and mechanical components of the motorcycle to ensure proper integration and functioning of the microcontroller. Additionally, proper grounding and protection against water and vibration should be considered to prevent damage to the microcontroller.

Similar threads

  • Electrical Engineering
Replies
4
Views
764
  • Electrical Engineering
Replies
3
Views
2K
  • Electrical Engineering
Replies
5
Views
2K
Replies
31
Views
2K
  • Electrical Engineering
Replies
1
Views
2K
  • Electrical Engineering
Replies
5
Views
2K
  • Electrical Engineering
Replies
18
Views
3K
  • Electrical Engineering
Replies
11
Views
7K
  • Electrical Engineering
Replies
17
Views
6K
Replies
2
Views
2K
Back
Top