Hi everyone, I am having some trouble with my a project I'm prototyping using an ATMega328P on a thru-hole protoboard in junction with a 4-channel relay board.
I'm testing with a really basic program (similar to the blink program.... I'm just using digital pin 7 for the output) to trigger the relay on and off every 1000 ms. The board that the ATMega is on is regulated to 5v from a 12v battery, and the relays are 5v models, with 12v passing into the common pins. Whenever I attach a small 12v piezo buzzer to the normally open or normally closed pins the ATMega seems to hiccup, and I'm not sure why. I've confirmed that voltage going into the ATMega is NOT dropping below 5.0 volts when the buzzer is running off the 12v battery.
I have a somewhat lengthy video outlining the problem, and was hoping someone wouldn't mind taking a look and offering me some pointers. I'm very new to microcontrollers in general, so I apologize if I'm doing something obviously wrong, but in my experience with 12v relays in the past, there's no reason this shouldn't work. Perhaps I need a diode between digital pin 7 and the trigger on the relay? Here is the video:
Any help would be greatly appreciated!! Thanks everyone!