State of IO pins, prior to script setting them

My relay keeps clicking when I reset my Core. Its activated by a low signal.

I had assumed the IO pins, (ie D1), would be in tristate, (neither ground nor positive), but it seems, the IO pins go to ground, and can sink a good bit of current. I tested amps and stopped when I got up to 8.7 ma.

If the Core does this, am I to assume that the Photon will also?
Thanks, Jack

Try a pull up resister?

If it is sinking 8.7ma, what size pullup resistor should I try?

@Jack, this is a (kinda) known issue on the Core and it seems to be related specifically to the Dx pins. Have a read:

:smile:

3 Likes

I am still pretty new to this stuff so I googled it and found what looks to be an awesome guide by Sparkfun: https://learn.sparkfun.com/tutorials/pull-up-resistors

There’s a section about calculating it further down.

@peekay123, does that mean a pull up resister is a bad idea or won’t work?

@tjp, in this context it will have no affect since as @Jack found out, the pin is actually being driven LOW thus sinking current. Oddly, the Ax “analog” pins do tri-state (input mode) on reset.

2 Likes

Then, I can just move my relay over to an unused analog pin (ie A2), and all is fixed. Great.

Still don’t know tho, if the Photon will be the same as the Core in this respect. Mine should be here in a couple/three weeks :smile:

Thanks, Jack

@Jack, yes, moving it to an Ax pin is exactly what some other members did to avoid the reset issue. Both the Core and the Photon have known JTAG pin reset characteristics but they are documented. I can’t, however, vouch for the other pins. We’ll have to do some testing and post the results. :smile:

1 Like

I got around that issue by using 2 relays, bridging them and having one set to normally open and the other normally closed. The relays trigger when the core boots up, but doesn’t close the circuit.

@yan, Did you put the two relays on the same IO pin, or did you use two different IO pins ?

Different pins because you only want the normally opened to trigger when you need a closed circuit.

(I apologize if my terminology isn’t correct. I’m fairly new at this)

@yan, no apology necessary. I was just trying to understand. Sounds like an interesting approach.