Which UNO pins to use to drive 8 relays


I’ve finally got my wireless relay board working (thanks to everyone here who helped :slight_smile: ). However, the relay I have connected to digital pin 4 ‘clicks’ every second (precisely). Putting a scope on pin 4 shows a 500mV pulse every second that corresponds with the relay clicks. I found this web page (Using the ATmegaXXX Microcontroller) which states that digital pin 4 (Atmega pin 6) is also the ‘Serial clock’. I can’t help but wonder if I’m seeing a serial timing pulse or something.

Assuming the Serial Clock is the source of my one-second pulses, I have two questions.

  1. Is there a way to disable the Serial clock without causing problems with serial communications (since I use that for my wireless interface)?

  2. What pins should I use to drive my 8 relays?
    a) Is it ok to use digitalWrite() on the analog output pins?

I should mention that I use two of the analog pins to talk I2C to my Real Time Clock.


PS I should mention that I’m not actually using an UNO board anymore. I’ve built my own board based on the UNO’s Atmega328-P chip.

I found this web page (http://upvector.com/atmega/) which states that digital pin 4 (Atmega pin 6) is also the 'Serial clock'.

You are miss reading the page that is for the UART (Universal Asynchronous Receiver/Transmitter) Interface, not the arduino.

If it is doing this then your code is making it do it. Post a schematic and your code. (use the #icon when posting code)

Oh man...You are so right. Long ago I was dumping heartbeats to a SoftwareSerial connection on that port and forgot all about it.

All fixed.

Thanks! -Mitch