When Ethernet Connection Lost - Relay ON


Hello Everyone,
I’m using Arduino Uno r3 with wiznet w5100 Ethernet Shield, connected with usb cable to Windows 7 Computer and Cayenne Web-Android platform

I’m developing a simple relay module and want to remote it via web browser or Cayenne App. It works fine Sofar but there is a bug which makes relay mode on without my order.

The problem is: If the ethernet shield lost connection with pc, Relay is automatically on until i get connection again.

Any ideas about solution?

P.s: I’m using example skectc of cayenne for Relay module with virtual pin


This is most likely do to the default state of the output (plus keep in mind you can in mind you can invert the logic on the widget). If you start the arduino you need to find if the output is high or low, then when the script starts or cayenne takes control. Does the relay change states? If so, you should just flip polarity on your relay. The simplest way is to connect a meter between positive and the output pin and monitor the voltage during a power up and loss of internet. Once you see how the output responds you should be able to connect your relay accordingly. I have had this issue with the raspberrry pi as well. I hope this helps.


What is you relay type? Active HIGH or active LOW?


There may be the issue. I always try to purchase relays that has both. They usually have jumpers which select either high or low. Some relays do not give you this option, so reversing polarity is the only option.


I like the Active High version! :slight_smile:


I dont know Which version there is no explanation about it. I just know its 4 way 5v relay module Screenshot attached.


ı have changed the polarity but it did not work, once Cayenne lost control relay goes on until cayenne takes back the control :frowning:


When you apply power, does it goes ON or OFF ? :slight_smile:


The relay you have pictured above should work by changing the vcc jumper. This jumper should change the input from high to low. The picture shows the jumper in the high position.