[Solved!] How to reduce electrical noise from motorcycle alternator?

I’ve been working on adding custom brake and turn signal controls to my motorcycle seen here

My code and circuit worked great when wired into the motorcycle battery. Then when I actually finished the motorcycle engine and ran it, my lights went haywire! When the engine is off, the lights work fine; engine on and they blink rapidly. Turn the engine off and they work normal again.

What I imagine is happening is that some dirty electrical frequency is getting into my Arduino inputs and telling the Arduino that the buttons have been pushed when they actually haven’t. I’m thinking I’ll have to add ferrite beads or possibly capacitors somehow?

The full electrical schematic is attached as a Fritzing file. Thanks!

Motorcycle Wiring Schematic.fzz (34.4 KB)

Oh, and unfortunately I wont actually be able to try any troubleshooting on this for a while as I am moving cross country and the engine is broken again :(

Once I have the engine fixed I may be able to run the bike without the alternator attached, which would eliminate that as the source of the noise. If the noise is still present with the alternator disconnected, my next guess would be the ignition coils/spark plugs. We'll have to wait and see...

loudboy: may be able to run the bike without the alternator attached, which would eliminate that as the source of the noise.

I would have thought that having the alternator running is rather more important than any Arduino-controlled brake and turn signals. You might try solving the problem using the standard suppressors and ignition cables used in cars.

Suggest you start by finding out whether the problem is EM radiated noise, or noise on the power supply, or something else.

You could find whether it's EM radiation by removing the external wiring to the sensors, leaving any external pullup/pulldown resistors in place. If it's EM radiation, you could address that by screening.

You could find out whether it's noise on the power supply by giving the logic components a known clean power supply i.e. not powering them from the bike's electrical system. If it's power supply noise, you could address that by adding a low pass filter to the incoming power line or by using a better regulator to convert the noisy 12V ish supply to a clean filtered 5V.

peter is smart! do you have a spare battery lying around? with the whole thing installed on your bike, but wired to the spare battery sitting on the floor, startup your bike and see if the issue survives. then you know if its radiated noise or electrical noise quick and easy

If your motorcycle has a non-resistor spark plug you will get ~100x more RF noise. Many name-brand plugs (NGK, Champion, AC Delco) will have an “R” in the plug code to indicate a resistor.

I don't know about bikes, but in cars it is pretty hard to get a non-resistor plug unless you wanted to on purpose. they are pretty standard nowadays.

permnoob: in cars it is pretty hard to get a non-resistor plug unless you wanted to on purpose.

That's not my experience. You need to specify the resistance characteristics (along with all the other properties) when you select the plug type, but non-resistive plugs are readily available and no harder to get than the resistive types.

To revive my long dormant post and hopefully help someone else, here's an update.

I've finally come ashore for long enough to set up a proper garage and put some energy and brainpower into my motorcycle. As suggested above, I have tested the electrical system with an independent, clean power source but this did not resolve the issue.

User Chagrin mentioned (literally years ago) that sparkplugs without internal resistors can cause a huge amount of RF interference. Indeed, the sparkplugs that I have installed are no resistor type and the lights erratic behavior does seem to increase in frequency when the bike is revved tto higher RPM. Tomorrow I will buy and install resistor type sparkplugs and report back my findings.

Yes! Chagrin was correct! The normal spark plugs for a 1971 Honda CB350 are NGK Model B8ES. I swapped in BR8ES (R standing for Resistor) and all erratic behavior has been eliminated!