Multiple Relay Problems

  • I am having difficulty when running nodes with multiple relays (up to 4). The first relay (pin x) runs properly, but remaining relays (pin x+1, pin x+2, etc.) only pulse on for a half or second or so. Vera indicates it is still on, as well as the debug. An "OFF" command from Vera, causes it pulse again, while Vera and the debug report it off. Things I have tried include:

    • running the relays on a separate power supply -no difference.
    • tried many different versions of multi-relay sketches found on the forum here, including main example
    • swapped out arduinos (both nano and pro-mini)
    • wiped eprom of arduino between reprogramming
    • deleted node and re-included on Vera multiple times
    • limited total number of relays to 2, 3, or 4 - no difference.
    • used single 5 volt relay boards as well a quad board - no difference

    Anyone have any other ideas I can try....I am about out. Thanks.

  • Contest Winner

    @patchmaster Good it be a power problem? How did you power the relays? Directly from the Arduino? Als it would help if you'd add the output of a serial monitor.

  • Well I have seemed to figure it out. You evidently should not skip over any digital output pins on the arduino in the sketch. Once I moved the first relay to D3 (D2 is used by the radio), it has worked flawless. Unused pins after the used ones are okay. Hope it may help someone else out having similar problems.

  • Contest Winner

    @patchmaster I'm not sure, but I've allways thought that D2 is currently not in use by the radio (according to the build section of the MySensors website)

  • I am not sure either. I have always wired up D2 to the radio in case it is used in the future. All I know is once I moved the first relay from pin D4 to D3 and of course revised the sketch, it began to work perfectly every time.

  • Plugin Developer



    Did you change the defines in the beginning of the main example sketch?

    #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 1 // Total number of attached relays

  • Yes I did. As I mentioned in a couple of posts back, it is working now. Seemed to be solely a problem of skipping over pin D3. All of my previous attempts started on D4 and skipped over D3. Once I moved it back, it has been flawless. Thanks.

  • Plugin Developer

    But then it's interesting why it didn't work beginning at D4.

Log in to reply

Suggested Topics