Ground pin delay

Is there a way to set a delay for the vic pin or the ground pin on a particle photon. I am trying to keep a relay from triggering a loop when power is cycled…

Fhen power cycles down, relays return to their “rest” position. If the power-off condition triggers unwanted action, you should review your circuit.

If the problem is triggered during power-up, you may need to add a bootup-delay to your code. That’s simple because millis() returns the number of milliseconds since boot, so you can use something like this …

if ((triggerCondition) && (millis() > 5000)) {
triggerAction();
}

it does trigger when the relay powers up have tried a few delays with no luck

If I had a problem in the power up cycle and it disappeared after the first action was taken, I’d start by looking to make sure I had initialized all of the variables and fields properly.

If you want to share some code, I’ll be glad to put another set of eyes on it.

To answer your original question: No.
There is no way to “delay” a physical power rail. These lines are directly wired to the supply.

Your setup is not really clear. It would be helpful to see how you have things wired up (or at least a description). What exactly do you mean by “when the relay powers up”? Is it powered up separately from the Photon, or are you talking about when the Photon has power applied to it also?

It is a pretty simple setup. I am using it for my garage door… I hacked the controller on the wall. All it has to do is complete a circuit like a switch on the wall. The relay is connected to the Vic on the particle photon and the ground on the photon I have the garage door wires connected to the relay. Using the blynk app with a momentary push button. It works great but if the power goes out when it comes back on the relay cycles when the photon powers up and the door opens.

This has to do with the behavior on of the GPIO wired to the relay.

Fixing this will involve modifying or cutting the signal trace and wiring it to another GPIO.

@ScruffR should have a good idea of which pins can do the job. :slight_smile:

I started down the same road, and I found it much easier to hack a remote control. All I had to do was to short across the button on the remote when I wanted to send a signal. Side benefits included less wiring and allowing the Photon to live inside the climate controlled house where it always operates within the prescribed thermal specs, and where WiFi signals are strong.

I did not even think of that… hmmmm… Great idea…did it solve the problem of triggering when power was reset too photon?. As for wifi range I have found that the external antenna setting with a small antenna range is really impressive.

You never told us what pin you were using to control the relay. You need to stay away from the pins used for JTAG (D3…D7) since they start off as JTAG pins with the respective pull-resistors attached, till the system takes over and removes the internal pull-resistors.
The safest bet are any of the A pins (including DAC and WKP).