I'm pretty stumped here, tho I'm kind of a novice with electronics...
I've read in several places about how to activate a relay with the Arduino digital output, using a transistor, etc. but I went ahead and did it the "wrong way", I guess. Here's what I've done: http://flickr.com/photo_zoom.gne?id=414926843&size=o or:
Here's the relay I'm using: http://catalog.tycoelectronics.com/TE/bin/TE.Connect?C=1&M=BYPN&PN=V23079B1201B301
The relay switches a motor, 12V, .68A back and forth by reversing its polarity.
The relay coil is 5V, 140mW, so it draws only about 30mA, which is why I went right from the ATMEGA8's digital output to the relay. With no motor attached it works fine... click, click, click goes the relay. However when I hook up the motor the behavior is erratic... For a few cycles it works fine, then it skips a few, then it doesn't work at all! Then I removed the motor and it still didn't work. I figured I fried something, but after re-burning the bootloader and downloading the program again it worked fine (with no motor of course).
Is the fix to simply add a diode across the relay coils, or do I need to add the full transistor deal, etc.?
Thanks in advance!