So my tachometer project is working good up until I try to power the ATtiny85 with my motorcycle’s 12V battery. I Am using an LM7805 5V regulator to get down to the proper voltage. The problem is that my outputs (LED’s) freak out and do random things when I power it from the battery if the bike is running. If I connect everything to my motorcycle except use a 9V DC wall adapter and run that through the regulator it works fine. The same goes for swapping the supply with a 9V battery. I have been looking into voltage regulators and the only thing I can see that I am doing wrong is I’m not putting a couple tiny capacitors between the Vin and ground and Vout and ground on my regulator like this: http://thedasdet.deviantart.com/art/5v-Regulator-358912063
I think I am getting huge spikes of voltage from my battery which causes my regulator to fail (even though it is rated up to 18V, and I didn’t think a car battery spikes as much as 50% over itself). But then if that happened, wouldn’t my MC get fried? I don’t know. All I know is that there is noise or some kind of interference coming from my motorcycle battery only when the bike is running.
Attached is my crudely drawn schematic.
Thanks a lot!